From a347dcb333080de7d96931be633ce65be2d30336 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 19 Jan 2017 13:28:59 +0000 Subject: [PATCH] Use systemd module instead of shell Using ansible systemd module to daemon reload and service reload is the solution for the future. Let's embrace it! Change-Id: I808c72fbea6353da102f4d4569b446ec9fbe8df1 Signed-off-by: Jean-Philippe Evrard --- handlers/main.yml | 6 ++++-- tasks/barbican_init_systemd.yml | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index ffb4bd7..cfba926 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -14,15 +14,17 @@ # limitations under the License. - name: Restart Apache - service: + systemd: name: "apache2" state: "restarted" + daemon_reload: yes register: apache_restart until: apache_restart|success retries: 5 delay: 2 - name: Restart barbican services - service: + systemd: name: "{{ barbican_uwsgi_program_name }}" state: "restarted" + diff --git a/tasks/barbican_init_systemd.yml b/tasks/barbican_init_systemd.yml index 51bfab9..ccac7c9 100644 --- a/tasks/barbican_init_systemd.yml +++ b/tasks/barbican_init_systemd.yml @@ -44,10 +44,5 @@ mode: "0644" owner: "root" group: "root" - register: systemd_init - -- name: Reload the systemd daemon - command: "systemctl daemon-reload" - when: systemd_init | changed notify: - Restart barbican services