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