diff --git a/tasks/main.yml b/tasks/main.yml index 5d6f3734..3978915e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,20 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Detect whether the init system is upstart of systemd. -- 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 - - name: Gather variables for each operating system include_vars: "{{ item }}" with_first_found: diff --git a/tasks/swift_init_common.yml b/tasks/swift_init_common.yml index dd8150ce..0893e9f4 100644 --- a/tasks/swift_init_common.yml +++ b/tasks/swift_init_common.yml @@ -15,11 +15,13 @@ - include: swift_init_upstart.yml static: no - when: pid1_name == "init" + when: + - ansible_service_mgr == 'upstart' - include: swift_init_systemd.yml static: no - when: pid1_name == "systemd" + when: + - ansible_service_mgr == 'systemd' - name: Load service service: