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
c533438e65
commit
c87d755f57
|
@ -14,21 +14,19 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Restart almanach collector
|
- name: Restart almanach collector
|
||||||
service:
|
systemd:
|
||||||
name: "{{ almanach_collector_program_name }}"
|
name: "{{ almanach_collector_program_name }}"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
pattern: "{{ almanach_collector_program_name }}"
|
daemon_reload: "yes"
|
||||||
|
|
||||||
- name: Restart almanach api
|
- name: Restart almanach api
|
||||||
service:
|
systemd:
|
||||||
name: "{{ almanach_api_program_name }}"
|
name: "{{ almanach_api_program_name }}"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
pattern: "{{ almanach_api_program_name }}"
|
|
||||||
|
|
||||||
- name: Restart almanach services
|
- name: Restart almanach services
|
||||||
service:
|
systemd:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
pattern: "{{ item }}"
|
|
||||||
with_items: "{{ almanach_service_names }}"
|
with_items: "{{ almanach_service_names }}"
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
|
@ -20,10 +20,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 almanach services
|
- Restart almanach services
|
||||||
|
|
|
@ -20,10 +20,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 almanach services
|
- Restart almanach services
|
||||||
|
|
Loading…
Reference in New Issue