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 <jean-philippe.evrard@rackspace.co.uk>
This commit is contained in:
parent
ee0665f4a1
commit
a347dcb333
|
@ -14,15 +14,17 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Restart Apache
|
- name: Restart Apache
|
||||||
service:
|
systemd:
|
||||||
name: "apache2"
|
name: "apache2"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
|
daemon_reload: yes
|
||||||
register: apache_restart
|
register: apache_restart
|
||||||
until: apache_restart|success
|
until: apache_restart|success
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
- name: Restart barbican services
|
- name: Restart barbican services
|
||||||
service:
|
systemd:
|
||||||
name: "{{ barbican_uwsgi_program_name }}"
|
name: "{{ barbican_uwsgi_program_name }}"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
|
|
||||||
|
|
|
@ -44,10 +44,5 @@
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
group: "root"
|
group: "root"
|
||||||
register: systemd_init
|
|
||||||
|
|
||||||
- name: Reload the systemd daemon
|
|
||||||
command: "systemctl daemon-reload"
|
|
||||||
when: systemd_init | changed
|
|
||||||
notify:
|
notify:
|
||||||
- Restart barbican services
|
- Restart barbican services
|
||||||
|
|
Loading…
Reference in New Issue