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:
Logan V 2016-11-09 22:29:09 -06:00 committed by Jesse Pretorius (odyssey4me)
parent f28e43f39c
commit 4ad359df03
2 changed files with 2 additions and 15 deletions

View File

@ -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

View File

@ -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