From 598eda5aae9624b3a58faf92d0e3de596e9119c2 Mon Sep 17 00:00:00 2001 From: Richard Megginson Date: Thu, 5 Aug 2021 18:26:25 -0600 Subject: [PATCH 1/2] fix yamllint issues; add set -euo pipefail for shell fix yamllint issues; add set -euo pipefail for shell --- roles/rsyslog/tasks/main.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/roles/rsyslog/tasks/main.yml b/roles/rsyslog/tasks/main.yml index f20ada24..5e207245 100644 --- a/roles/rsyslog/tasks/main.yml +++ b/roles/rsyslog/tasks/main.yml @@ -82,12 +82,7 @@ changed_when: false - name: Purge original conf - shell: "/bin/rm -rf {{ __rsyslog_config_dir }}/*" - # 'file' module "state=absent" does not work with "path=/some/dir/*" (wildcard) - # 'file' module should support "state=empty" see: https://github.com/ansible/ansible/issues/18910 - # file: - # state: empty - # path: "{{ __rsyslog_config_dir }}" + shell: set -euo pipefail; /bin/rm -rf {{ __rsyslog_config_dir }}/* when: __rsyslog_purge_original_conf | bool | d(false) vars: __rsyslog_backup_dir: '{{ rsyslog_backup_dir | From 528232e0a3f2e72083ff77d34449c52470676ad8 Mon Sep 17 00:00:00 2001 From: Richard Megginson Date: Fri, 6 Aug 2021 10:36:01 -0600 Subject: [PATCH 2/2] fix linter errors fix linter errors --- roles/rsyslog/tasks/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/roles/rsyslog/tasks/main.yml b/roles/rsyslog/tasks/main.yml index 91cbd81e..6a3fb8c1 100644 --- a/roles/rsyslog/tasks/main.yml +++ b/roles/rsyslog/tasks/main.yml @@ -85,11 +85,6 @@ shell: |- set -euo pipefail /bin/rm -rf {{ __rsyslog_config_dir }}/* - # 'file' module "state=absent" does not work with "path=/some/dir/*" (wildcard) - # 'file' module should support "state=empty" see: https://github.com/ansible/ansible/issues/18910 - # file: - # state: empty - # path: "{{ __rsyslog_config_dir }}" when: __rsyslog_purge_original_conf | bool | d(false) vars: __rsyslog_backup_dir: '{{ rsyslog_backup_dir |