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 11:05:05 +00:00
parent c533438e65
commit c87d755f57
3 changed files with 4 additions and 16 deletions

View File

@ -14,21 +14,19 @@
# limitations under the License.
- name: Restart almanach collector
service:
systemd:
name: "{{ almanach_collector_program_name }}"
state: "restarted"
pattern: "{{ almanach_collector_program_name }}"
daemon_reload: "yes"
- name: Restart almanach api
service:
systemd:
name: "{{ almanach_api_program_name }}"
state: "restarted"
pattern: "{{ almanach_api_program_name }}"
- name: Restart almanach services
service:
systemd:
name: "{{ item }}"
state: "restarted"
pattern: "{{ item }}"
with_items: "{{ almanach_service_names }}"
failed_when: false

View File

@ -20,10 +20,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 almanach services

View File

@ -20,10 +20,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 almanach services