Use ansible_service_mgr fact
This patch removes some extra tasks for detecting systemd and uses the fact instead. Partial-Bug: #1640125 Change-Id: I630b9543d6f57292f523b39b9f862ecea9f87439
This commit is contained in:
parent
25fa6661ae
commit
d93457eaf7
|
@ -27,19 +27,6 @@
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
- name: Check init system
|
|
||||||
command: cat /proc/1/comm
|
|
||||||
changed_when: false
|
|
||||||
register: _pid1_name
|
|
||||||
tags:
|
|
||||||
- always
|
|
||||||
|
|
||||||
- name: Set the name of pid1
|
|
||||||
set_fact:
|
|
||||||
pid1_name: "{{ _pid1_name.stdout }}"
|
|
||||||
tags:
|
|
||||||
- always
|
|
||||||
|
|
||||||
- include: pre-install.yml
|
- include: pre-install.yml
|
||||||
tags:
|
tags:
|
||||||
- monasca-install
|
- monasca-install
|
||||||
|
|
|
@ -14,10 +14,12 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- include: monasca_init_upstart.yml
|
- include: monasca_init_upstart.yml
|
||||||
when: pid1_name == "init"
|
when:
|
||||||
|
- ansible_service_mgr == 'upstart'
|
||||||
|
|
||||||
- include: monasca_init_systemd.yml
|
- include: monasca_init_systemd.yml
|
||||||
when: pid1_name == "systemd"
|
when:
|
||||||
|
- ansible_service_mgr == 'systemd'
|
||||||
|
|
||||||
- name: Load service
|
- name: Load service
|
||||||
service:
|
service:
|
||||||
|
|
Loading…
Reference in New Issue