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:
Jean-Philippe Evrard 2017-01-19 13:28:59 +00:00
parent ee0665f4a1
commit a347dcb333
2 changed files with 4 additions and 7 deletions

View File

@ -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"

View File

@ -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