blob: 65d8360ebbfdab07e12b824fd26fa86dca0b0070 [file] [log] [blame]
---
# tasks file for apigee-opdk-debug-mode
- block:
- name: Collect all bash scripts
find:
paths: '{{ apigee_installation_home }}'
contains: '^{{ bash_regex }}'
file_type: file
recurse: yes
register: debug_scripts
- name: Add debug flag
lineinfile:
path: "{{ item.path }}"
backrefs: yes
backup: yes
regexp: '^({{ bash_regex }})'
line: '\1 -x'
with_items: "{{ debug_scripts.files }}"
when: opdk_debug_mode is defined and opdk_debug_mode | trim | lower == 'on'
- block:
- name: Collect all bash scripts
find:
paths: '{{ apigee_installation_home }}'
contains: '^{{ bash_regex }} -x'
register: debug_scripts
- name: Add debug flag
lineinfile:
path: "{{ item.path }}"
backrefs: yes
backup: yes
regexp: '^({{ bash_regex }}$).*(-x)'
line: '\1'
with_items: "{{ debug_scripts.files }}"
when: opdk_debug_mode is defined and opdk_debug_mode | trim | lower == 'off'