From 737dfbeb30050d686ca92a19c3ca4c0afc7ee97e Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Thu, 15 Mar 2018 16:10:37 +0100 Subject: [PATCH] Add debug mode --- README.md | 4 ++++ Vagrantfile | 4 ++-- defaults/main.yml | 6 ++++++ tasks/htpasswd.yml | 4 ++-- tasks/ssl/acme.yml | 2 +- tasks/ssl/standard.yml | 6 +++--- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e8b2100..1ad3ccb 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,10 @@ FreeBSD: - `nginx_custom_http`: instructions list (will put data in `/etc/nginx/conf.d/custom.conf`) - `nginx_module_packages`: package list module to install +### Misc + +- `nginx_debug_role`: set _true_ if you need to see output of no\_log tasks + About modules ------------- diff --git a/Vagrantfile b/Vagrantfile index d2673eb..bcfdcca 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -38,7 +38,7 @@ Vagrant.configure("2") do |config| ansible.playbook = "tests/test.yml" ansible.verbose = 'vv' ansible.become = true - ansible.extra_vars = opts[:vars] + ansible.extra_vars = opts[:vars].merge({ "nginx_debug_role": true }) end end end @@ -54,7 +54,7 @@ Vagrant.configure("2") do |config| ansible.playbook = "tests/test.yml" ansible.verbose = 'vv' ansible.become = true - ansible.extra_vars = opts[:vars] + ansible.extra_vars = opts[:vars].merge({ "nginx_debug_role": true }) end end end diff --git a/defaults/main.yml b/defaults/main.yml index f86e57d..bd0005b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -130,3 +130,9 @@ nginx_acmesh_test: false # - On Debian, if you use Owncloud from Upstream repository, you must set this var to "/var/www/owncloud" # - TODO: force this var in vars/FreeBSD.yml nginx_owncloud_root: '/usr/share/owncloud' + + +# +# Debug +# +nginx_debug_role: false diff --git a/tasks/htpasswd.yml b/tasks/htpasswd.yml index 97bff15..34b4a2e 100644 --- a/tasks/htpasswd.yml +++ b/tasks/htpasswd.yml @@ -6,7 +6,7 @@ state: absent with_items: "{{ nginx_htpasswd }}" when: item.state is defined and item.state == 'absent' - no_log: true + no_log: not nginx_debug_role - name: HTPASSWD | Manage files htpasswd: @@ -18,4 +18,4 @@ - "{{ nginx_htpasswd }}" - users when: item.0.state is not defined or item.0.state == 'present' - no_log: true + no_log: not nginx_debug_role diff --git a/tasks/ssl/acme.yml b/tasks/ssl/acme.yml index 77a841e..a64e26f 100644 --- a/tasks/ssl/acme.yml +++ b/tasks/ssl/acme.yml @@ -61,7 +61,7 @@ with_items: "{{ acme_create }}" register: acme_get failed_when: acme_get.rc != 0 and acme_get.rc != 2 - no_log: true + no_log: not nginx_debug_role - name: FILE | Create SSL dir per site file: diff --git a/tasks/ssl/standard.yml b/tasks/ssl/standard.yml index 24207ec..42dd695 100644 --- a/tasks/ssl/standard.yml +++ b/tasks/ssl/standard.yml @@ -22,7 +22,7 @@ state: directory with_items: "{{ nginx_ssl_pairs }}" when: item.dest_key is not defined or item.dest_cert is not defined - no_log: true + no_log: not nginx_debug_role - name: COPY | Deploy SSL keys copy: @@ -32,7 +32,7 @@ with_items: "{{ nginx_ssl_pairs }}" when: item.key is defined notify: restart nginx - no_log: true + no_log: not nginx_debug_role - name: COPY | Deploy SSL certs copy: @@ -42,7 +42,7 @@ with_items: "{{ nginx_ssl_pairs }}" when: item.cert is defined notify: restart nginx - no_log: true + no_log: not nginx_debug_role - name: Check DH command status async_status: