Use ansible_service_mgr fact
This patch removes some extra tasks for detecting systemd and uses the `ansible_service_mgr` fact instead. Partial-Bug: #1640125 Change-Id: I4c35f5e92ea9ba4ed297c683aa4e8ebdcbe3fb4e
This commit is contained in:
parent
f28e43f39c
commit
4ad359df03
@ -51,7 +51,7 @@
|
||||
group: root
|
||||
mode: 0644
|
||||
when:
|
||||
- pid1_name == "init"
|
||||
- ansible_service_mgr == 'upstart'
|
||||
tags:
|
||||
- lxc-files
|
||||
- lxc-net
|
||||
@ -62,7 +62,7 @@
|
||||
path: /etc/systemd/system/lxc-net.service
|
||||
state: link
|
||||
when:
|
||||
- pid1_name == "systemd"
|
||||
- ansible_service_mgr == 'systemd'
|
||||
tags:
|
||||
- lxc-files
|
||||
- lxc-net
|
||||
|
@ -42,19 +42,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: lxc_pre_install.yml
|
||||
- include: lxc_install.yml
|
||||
- include: lxc_post_install.yml
|
||||
|
Loading…
x
Reference in New Issue
Block a user