From a05a3f209be76a5eaba921de3dc429f29f7f6d4a Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Sun, 1 Mar 2015 14:25:40 +0100 Subject: [PATCH 1/2] Create /etc/cron.d only if required. --- tasks/manage_pki_realms.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/manage_pki_realms.yml b/tasks/manage_pki_realms.yml index dec1f0b..470313e 100644 --- a/tasks/manage_pki_realms.yml +++ b/tasks/manage_pki_realms.yml @@ -35,6 +35,7 @@ state: directory name: /etc/cron.d mode: 0755 + when: pki_dhparams_regenerate - name: Regenerate Diffie-Hellman parameters periodically cron: From 04a53b9fd4ed3b03eaa6dafaf4fa3abd44d60c94 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Sun, 1 Mar 2015 14:26:08 +0100 Subject: [PATCH 2/2] Simplify conditions. pki_dhparams_regenerate is always defined via defaults/main.yml. --- tasks/manage_pki_realms.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/manage_pki_realms.yml b/tasks/manage_pki_realms.yml index 470313e..9d057c1 100644 --- a/tasks/manage_pki_realms.yml +++ b/tasks/manage_pki_realms.yml @@ -45,14 +45,14 @@ user: 'root' job: 'cd {{ pki_base_path }} ; make regenerate-dhparams > /dev/null 2>&1' cron_file: 'pki-regenerate-dhparams' - when: pki_dhparams_regenerate is defined and pki_dhparams_regenerate + when: pki_dhparams_regenerate - name: Disable periodic DHparams regeneration cron: name: 'Regenerate Diffie-Hellman parameters in all PKI realms' cron_file: 'pki-regenerate-dhparams' state: 'absent' - when: pki_dhparams_regenerate is defined and not pki_dhparams_regenerate + when: not pki_dhparams_regenerate|bool - name: Create realm source directories file: