| --- |
| # tasks file for apigee-opdk-debug-mode |
| - block: |
| - name: Collect all bash scripts |
| find: |
| paths: '{{ apigee_installation_home }}' |
| contains: '^{{ bash_regex }}$' |
| register: debug_scripts |
| |
| - name: Examine debug_scripts |
| debug: |
| var: debug_scripts |
| |
| - name: Add debug flag |
| lineinfile: |
| path: "{{ item.path }}" |
| backrefs: yes |
| backup: yes |
| regexp: '^({{ bash_regex }})' |
| line: '\1 -x' |
| with_items: "{{ debug_scripts }}" |
| |
| when: opdk_debug_mode is defined and opdk_debug_mode | trim | lowercase== '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 }}" |
| |
| when: opdk_debug_mode is defined and opdk_debug_mode | trim | lowercase == 'off' |