Skip to content

Commit

Permalink
reorganizing
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamrah committed Nov 10, 2014
1 parent 0ef0f25 commit 9ca0869
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 46 deletions.
14 changes: 11 additions & 3 deletions Ansiblefile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,36 @@ GIT
GIT
remote: https://github.com/mhamrah/ansible-marathon
ref: master
sha: 97561fc9b9afb4f95a3541e66d61145c0ec2d903
sha: c8b9dde6ce543df6bb61f890a74c49cc688bc944
specs:
ansible-marathon (0.0.0)

GIT
remote: https://github.com/mhamrah/ansible-mesos
ref: master
sha: f1fb0e20412c614acf8a281821ecfdb2da6aa12c
sha: d9b67e65e76914d7b53734690b86cd90118d767d
specs:
ansible-mesos (0.0.0)

GIT
remote: https://github.com/mhamrah/ansible-zookeeper
ref: master
sha: 142a6fc388fc721da1ec741e52d86f2e870ded2a
sha: ba4340361486b58f13d7581e9a0ba87c11ec4b49
specs:
ansible-zookeeper (0.0.0)

GIT
remote: https://github.com/tmtk75/ansible-consul
ref: master
sha: 8658962cbd788083ec8ea45715a7408f32bfb5d9
specs:
tmtk75.consul (0.0.0)

DEPENDENCIES
ansible-docker (>= 0)
ansible-java8 (>= 0)
ansible-marathon (>= 0)
ansible-mesos (>= 0)
ansible-zookeeper (>= 0)
tmtk75.consul (>= 0)

33 changes: 33 additions & 0 deletions common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- hosts: [all]
sudo: True
tags: ['system']
pre_tasks:
- name: Install Debian Packages
apt: pkg={{ item }} state=present
with_items:
- git
- vim
- htop
- unzip
when: ansible_os_family == "Debian"
- name: Downloading and enable the EPEL repository definitions.
yum: name=http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm state=present
when: ansible_os_family == "RedHat"
- name: Install Redhat Packages
yum: pkg={{ item }} state=present
with_items:
- java7
- git
- vim
- htop
- unzip
when: ansible_os_family == "RedHat"
- name: Disable iptables
action: service name=iptables state=stopped enabled=false
when: ansible_os_family == "RedHat"
- name: Remove require tty
lineinfile: regexp="requiretty" dest=/etc/sudoers state=absent
- name: Remove require tty - alt
lineinfile: regexp="requiretty" dest=/etc/sudoers/os_defaults state=absent

2 changes: 1 addition & 1 deletion hosts.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mesos_masters]
ec2-54-204-214-172.compute-1.amazonaws.com zoo_id=1
ec2-54-204-214-172.compute-1.amazonaws.com zoo_id=1 consul_bootstrap=true
ec2-54-235-59-210.compute-1.amazonaws.com zoo_id=2
ec2-54-83-161-83.compute-1.amazonaws.com zoo_id=3

Expand Down
21 changes: 21 additions & 0 deletions mesos_primaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- hosts: [mesos_primaries]
sudo: True
pre_tasks:
- name: Install HAProxy (RedHat)
yum: pkg=haproxy state=present
when: ansible_os_family == "RedHat"
- name: Install HAProxy (Ubuntu)
apt: pkg=haproxy state=present
when: ansible_os_family == "Debian"
- name: Sets haproxy to enabled (Ubuntu)
lineinfile: dest=/etc/default/haproxy regexp="^ENABLED" line="ENABLED=1"
when: ansible_os_family == "Debian"
roles:
- { role: 'ansible-java8', tags:['runtimes', 'java'], when: ansible_os_family == 'Debian' }
- { role: 'ansible-zookeeper', zookeeper_hosts: "{{ groups.mesos_primaries}}", tags:['zookeeper'] }
- { role: 'ansible-mesos', mesos_quorum: "2", zookeeper_hostnames: "{{ groups.mesos_primaries | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}", mesos_install_mode: 'master', mesos_cluster_name: 'mlh_mesos', tags: ['mesos', 'platforms'] }
- { role: 'ansible-marathon', zookeeper_hostnames: "{{ groups.mesos_primaries | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}", tags:['mesos-tools'] }
- { role: 'ansible-consul', consul_client_address: "0.0.0.0", consul_version: "0.4.1", consul_datacenter: "sea", consul_is_server: true, consul_servers: "{{ groups.mesos_primaries }}", consul_is_ui: true, consul_join_at_start: true }


12 changes: 12 additions & 0 deletions mesos_workers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- hosts: [mesos_workers]
sudo: True
pre_tasks:
- name: Remove require tty
lineinfile: regexp="tty" dest=/etc/sudoers/os_defaults state=absent
tags: ['system']
roles:
- { role: 'ansible-docker', tags:['docker'] }
- { role: 'ansible-java8', tags:['java'], when: ansible_os_family == 'Debian' }
- { role: 'ansible-mesos', mesos_containerizers: "docker,mesos", zookeeper_hostnames: "{{ groups.mesos_primaries | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}", mesos_install_mode: "slave", tags: ['mesos'] }
- { role: 'ansible-consul', consul_client_address: "0.0.0.0", consul_is_server: false, consul_datacenter: "sea", consul_servers: "{{ groups.mesos_primaries }}", consul_join_at_start: true, tags:['consul'] }
46 changes: 4 additions & 42 deletions playbook.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
- hosts: [mesos_masters]
sudo: True
pre_tasks:
- name: Install Debian Packages
apt: pkg={{ item }} state=present
with_items:
- git
- vim
- htop
- haproxy
when: ansible_os_family == "Debian"
- name: Downloading and enable the EPEL repository definitions.
action: command rpm -Uvh --replacepkgs http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
when: ansible_os_family == "RedHat"
- name: Install Redhat Packages
yum: pkg={{ item }} state=present
with_items:
- java7
- git
- vim
- htop
- haproxy
when: ansible_os_family == "RedHat"
- name: Disable iptables
action: service name=iptables state=stopped enabled=false
when: ansible_os_family == "RedHat"
- name: Sets haproxy to enabled
lineinfile: dest=/etc/default/haproxy regexp="^ENABLED" line="ENABLED=1"
when: ansible_os_family == "Debian"

roles:
- { role: 'ansible-java8', tags:['runtimes', 'java'], when: ansible_os_family == 'Debian' }
- { role: 'ansible-zookeeper', zookeeper_hosts: "{{ groups.mesos_masters}}", tags:['zookeeper'] }
- { role: 'ansible-mesos', mesos_quorum: "2", zookeeper_hostnames: "{{ groups.mesos_masters | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}", mesos_install_mode: 'master', mesos_cluster_name: 'mlh_mesos', tags: ['mesos', 'platforms'] }
- { role: 'ansible-marathon', zookeeper_hostnames: "{{ groups.mesos_masters | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}", tags:['mesos-tools'] }

- hosts: [mesos_slaves]
sudo: True
roles:
- { role: 'ansible-docker', tags:['runtimes', 'docker'] }
- { role: 'ansible-java8', tags:['runtimes', 'java'], when: ansible_os_family == 'Debian' }
- { role: 'ansible-mesos', mesos_containerizers: "docker,mesos", zookeeper_hostnames: "{{ groups.mesos_masters | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}", mesos_install_mode: "slave", tags: ['mesos', 'platforms'] }
---
- include: common.yml
- include: mesos_primaries.yml
- include: mesos_workers.yml

0 comments on commit 9ca0869

Please sign in to comment.