Split nodepool service state into own task

It is possible we want to enable a service on boot, but don't want to
ensure it is currently running. This splits our systemd tasks into 2
different checks now.

Change-Id: Ib37371031a871d0d57b390e2430ea1efb3094171
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2019-01-20 16:58:20 -05:00
parent d9a53413cf
commit c3c980e21d

View File

@ -140,16 +140,36 @@
daemon_reload: "{{ nodepool_service_nodepool_builder_daemon_reload }}"
enabled: "{{ nodepool_service_nodepool_builder_enabled }}"
name: "{{ nodepool_service_nodepool_builder_name }}"
state: "{{ nodepool_service_nodepool_builder_state }}"
register: nodepool_service_nodepool_builder
when: nodepool_service_nodepool_builder_manage
- name: Set nodepool-builder service state
become: true
systemd:
daemon_reload: "{{ nodepool_service_nodepool_builder_daemon_reload }}"
name: "{{ nodepool_service_nodepool_builder_name }}"
state: "{{ nodepool_service_nodepool_builder_state }}"
register: nodepool_service_nodepool_builder_state_info
when:
- nodepool_service_nodepool_builder_manage
- nodepool_service_nodepool_builder_state in ['reloaded', 'restarted', 'started', 'stopped']
- name: Enable nodepool-launcher service
become: true
systemd:
daemon_reload: "{{ nodepool_service_nodepool_launcher_daemon_reload }}"
enabled: "{{ nodepool_service_nodepool_launcher_enabled }}"
name: "{{ nodepool_service_nodepool_launcher_name }}"
state: "{{ nodepool_service_nodepool_launcher_state }}"
register: nodepool_service_nodepool_launcher
when: nodepool_service_nodepool_launcher_manage
- name: Set nodepool-launcher service state
become: true
systemd:
daemon_reload: "{{ nodepool_service_nodepool_launcher_daemon_reload }}"
name: "{{ nodepool_service_nodepool_launcher_name }}"
state: "{{ nodepool_service_nodepool_launcher_state }}"
register: nodepool_service_nodepool_launcher_state_info
when:
- nodepool_service_nodepool_launcher_manage
- nodepool_service_nodepool_launcher_state in ['reloaded', 'restarted', 'started', 'stopped']