From 1f270a49a137ef37cdef5d096cba3b547cba26d8 Mon Sep 17 00:00:00 2001 From: Maarten Bezemer Date: Wed, 16 Nov 2016 07:42:20 +0100 Subject: [PATCH] Always disable or enable the mesos-master and mesos-slave services (#66) --- tasks/mesos.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/mesos.yml b/tasks/mesos.yml index 8f687a7..430b08c 100644 --- a/tasks/mesos.yml +++ b/tasks/mesos.yml @@ -71,10 +71,10 @@ - Reload daemon - Restart mesos-slave -- name: Disable mesos-master service - service: name=mesos-master enabled=no - when: mesos_install_mode == "slave" and systemd_check.stat.exists == true +- name: Enable/Disable mesos-master service + service: name=mesos-master enabled="{{ (mesos_install_mode == 'slave') | ternary('no', 'yes') }}" + when: systemd_check.stat.exists == true -- name: Disable mesos-slave service - service: name=mesos-slave enabled=no - when: mesos_install_mode == "master" and systemd_check.stat.exists == true +- name: Enable/Disable mesos-slave service + service: name=mesos-slave enabled="{{ (mesos_install_mode == 'master') | ternary('no', 'yes') }}" + when: systemd_check.stat.exists == true