---
- name: Starting Mesos slave container
  kolla_docker:
    action: "start_container"
    common_options: "{{ docker_common_options }}"
    environment:
      MESOS_HOSTNAME: "{{ inventory_hostname }}"
      MESOS_IP: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
      MESOS_MASTER: "zk://{% for host in groups['zookeeper'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:2181{% if not loop.last %},{% endif %}{% endfor %}/mesos"
      MESOS_SWITCH_USER: "false"
      MESOS_LOG_DIR: "/var/log/mesos"
      MESOS_LOGGING_LEVEL: "INFO"
      MESOS_DOCKER_REMOVE_DELAY: "{{ mesos_docker_remove_delay }}"
    image: "{{ mesos_slave_image_full }}"
    name: "mesos_slave"
    privileged: True
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup
      - /var/run/docker.sock:/var/run/docker.sock

---
- name: Starting Mesos slave container
  kolla_docker:
    action: "start_container"
    common_options: "{{ docker_common_options }}"
    environment:
      MESOS_HOSTNAME: "{{ inventory_hostname }}"
      MESOS_IP: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
      MESOS_MASTER: "zk://{% for host in groups['zookeeper'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:2181{% if not loop.last %},{% endif %}{% endfor %}/mesos"
      MESOS_SWITCH_USER: "false"
      MESOS_LOG_DIR: "/var/log/mesos"
      MESOS_LOGGING_LEVEL: "INFO"
      MESOS_DOCKER_REMOVE_DELAY: "{{ mesos_docker_remove_delay }}"
      MESOS_ATTRIBUTES: "openstack_role:{% if 'controller' in group_names %}controller{% elif 'compute' in group_names %}compute{% endif %}"
      MESOS_SYSTEMD_ENABLE_SUPPORT: "false"
    image: "{{ mesos_slave_image_full }}"
    name: "mesos_slave"
    privileged: True
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup
      - /var/run/docker.sock:/var/run/docker.sock

Tag Mesos slaves with their OpenStack roles
Tag Mesos slaves with their OpenStack roles

To distinguish controller nodes from compute nodes, we need
to tag Mesos slaves. After that, we can use constraints in
Marathon to orchestrate applictions properly.

Change-Id: Ied5608b3aa34eca6ab2ca707bc4a633a23cab1fb
Partially-Implements: blueprint multinode
