Use ansible_service_mgr fact
This patch removes some extra tasks for detecting systemd and uses the fact instead. Partial-Bug: #1640125 Change-Id: I213b38b166de724990958a316e577478d7e4823c
This commit is contained in:
parent
9db98e22e1
commit
68e8cc6854
@ -24,19 +24,6 @@
|
||||
tags:
|
||||
- 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: repo_pre_install.yml
|
||||
- include: repo_install.yml
|
||||
- include: repo_post_install.yml
|
||||
|
@ -151,7 +151,7 @@
|
||||
owner: "root"
|
||||
group: "root"
|
||||
when:
|
||||
- pid1_name == "init"
|
||||
- ansible_service_mgr == 'upstart'
|
||||
- ansible_distribution == "Ubuntu"
|
||||
notify:
|
||||
- Init reload
|
||||
@ -170,7 +170,7 @@
|
||||
- { src: "git.service.j2", dest: "/lib/systemd/system/git@.service" }
|
||||
- { src: "git.socket.j2", dest: "/lib/systemd/system/git.socket" }
|
||||
when:
|
||||
- pid1_name == "systemd"
|
||||
- ansible_service_mgr == 'systemd'
|
||||
notify:
|
||||
- reload git socket
|
||||
tags:
|
||||
|
Loading…
Reference in New Issue
Block a user