blob: d17f09e70fdbb5062d8059e24ee159ef52fa224f [file] [log] [blame]
---
# tasks file for apigee-opdk-debug-mode
- block:
- name: Collect all bash scripts to set debug mode
find:
paths: "{{ apigee_installation_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
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 to unset debug mode
find:
paths: "{{ apigee_installation_home }}/{{ component_name | default('') }}"
contains: '.*bash -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'