AnsibleShipyard / ansible-mesos

Mesos Playbook for Ansible
Apache License 2.0
169 stars 104 forks source link

Would you provide an all in one example for zookeeper, mesos and marathon ? #63

Open eromoe opened 8 years ago

eromoe commented 8 years ago

Hello!

As a rookie to ansible, I have some questions to bind them togetother:

  1. There is a variable: zookeeper_client_port: "2181" in ansible-mesos, but not in ansible-marathon.
  2. Both ansible-mesos and ansible-marathon have zookeeper_hostnames, how can I set a global variable for them?
  3. ansible-mesos readme write as zookeeper_hostnames: "{{ groups.zookeeper_hosts | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}. ( I think groups.zookeeper_hosts equals to groups[zookeeper_hosts] here, isn't it ). But in ansible-zookeeper, the example is zookeeper_hosts: "{{groups['zookeepers']}}".

Now, I write a .yml like below:

- name: install java
- hosts: all
  roles:
    - role: geerlingguy.java
      when: "ansible_os_family == 'RedHat'"
      java_packages:
        - java-1.8.0-openjdk

- name: Zookeeper cluster setup
  hosts: zookeepers
  sudo: yes
  roles:
    - role: AnsibleShipyard.ansible-zookeeper
      zookeeper_hosts: "{{groups['zookeepers']}}"

- name: install mesos
- hosts: mesos-cluster
  roles:
    - role: mesos # I reset the name, because install from github
      zookeeper_client_port: 2181
      zookeeper_hostnames: "{{ groups.zookeepers | join(':' + zookeeper_client_port + ',')  }}:{{ zookeeper_client_port  }}"
      mesos_containerizers: "docker,mesos"

- name: install marathon
- hosts: marathon-cluster
  roles:
    - role: marathon
      zookeeper_hostnames: "{{ groups.zookeepers | join(':2181,')  }}:2181"
      mesos_containerizers: "docker,mesos"

If there are a full example would be nice for learn and reuse.

Light-Gao commented 6 years ago

https://github.com/Light-Gao/lightpaas Maybe you are interested in that project. But it's new ...