---
- name: restart mesos leader
  sudo: yes
  shell: /bin/systemctl restart mesos-master

- name: remove mesos follower metadata
  sudo: yes
  shell: "{{ item }}"
  with_items:
    - /bin/systemctl stop mesos-slave
    - /bin/rm -rf /tmp/mesos/meta
    - /bin/systemctl start mesos-slave

- name: restart mesos follower
  sudo: yes
  shell: /bin/systemctl restart mesos-slave

- name: register mesos leader with consul
  shell: curl --fail -v -X PUT --data @/etc/consul/register.d/mesos-leader.json  http://localhost:8500/v1/agent/service/register

- name: register mesos follower with consul
  shell: curl --fail -v -X PUT --data @/etc/consul/register.d/mesos-follower.json  http://localhost:8500/v1/agent/service/register

---
- name: restart mesos leader
  sudo: yes
  shell: /bin/systemctl restart mesos-master

- name: remove mesos follower metadata
  sudo: yes
  shell: "{{ item }}"
  with_items:
    - /bin/systemctl stop mesos-slave
    - /bin/rm -rf /tmp/mesos/meta
    - /bin/systemctl start mesos-slave

- name: restart mesos follower
  sudo: yes
  shell: /bin/systemctl restart mesos-slave

- name: reload consul
  sudo: yes
  shell: "{{ consul_bin }} reload"

Move from curl to consul reload for service registration
Move from curl to consul reload for service registration
