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: I70f1fb61fe879011a6bfd9517f98b8c07f793a81
This commit is contained in:
Logan V 2016-11-09 22:40:22 -06:00 committed by Jesse Pretorius (odyssey4me)
parent 24ba34384b
commit 9984f9cb09
2 changed files with 4 additions and 15 deletions

View File

@ -15,10 +15,12 @@
# limitations under the License. # limitations under the License.
- include: cinder_init_upstart.yml - include: cinder_init_upstart.yml
when: pid1_name == "init" when:
- ansible_service_mgr == 'upstart'
- include: cinder_init_systemd.yml - include: cinder_init_systemd.yml
when: pid1_name == "systemd" when:
- ansible_service_mgr == 'systemd'
- name: Load service - name: Load service
service: service:

View File

@ -25,19 +25,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: cinder_pre_install.yml - include: cinder_pre_install.yml
tags: tags:
- cinder-install - cinder-install