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: I1a30b79a759057afb74f24f2239f474b60c1db35
This commit is contained in:
Logan V 2016-11-09 22:24:03 -06:00
parent 909fe09ef5
commit 714b846aad
3 changed files with 4 additions and 17 deletions

@ -16,7 +16,7 @@
- name: Reload the systemd daemon
command: "systemctl daemon-reload"
when:
- pid1_name == "systemd"
- ansible_service_mgr == 'systemd'
- name: Restart mysql
service:

@ -88,7 +88,7 @@
src: "upstart.limits.conf.j2"
dest: "/etc/security/limits.conf"
when:
- pid1_name != "systemd"
- ansible_service_mgr == 'systemd'
notify:
- Restart mysql
tags:
@ -102,7 +102,7 @@
owner: "root"
mode: "0755"
when:
- pid1_name == "systemd"
- ansible_service_mgr == 'systemd'
- name: Apply resource limits (systemd)
template:
@ -110,7 +110,7 @@
dest: "/etc/systemd/system/mariadb.service.d/limits.conf"
mode: "0644"
when:
- pid1_name == "systemd"
- ansible_service_mgr == 'systemd'
notify:
- Reload the systemd daemon
- Restart mysql

@ -36,19 +36,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: galera_upgrade_check.yml
- include: galera_cluster_state.yml
- include: galera_pre_install.yml