blob: ef2c812fae5ee8184bac5ae1d8a9c216ab919c0d [file] [log] [blame]
---
# tasks file for apigee-opdk-debug-mode
- block:
- name: Collect all bash scripts to set debug mode
find:
paths: "{{ apigee_home }}/{{ component_name | default('') }}"
contains: '^{{ bash_regex }}'
file_type: file
recurse: yes
register: debug_scripts
- name: Add debug flag
lineinfile:
path: "{{ item.path }}"
backrefs: 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 to unset debug mode
find:
paths: "{{ apigee_home }}/{{ component_name | default('') }}"
contains: '^{{ bash_regex }} -x'
file_type: file
recurse: yes
register: debug_scripts
- name: Add debug flag
lineinfile:
path: "{{ item.path }}"
backrefs: 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'