Skip to content

Commit

Permalink
refactoring haproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamrah committed Sep 18, 2014
1 parent 627695b commit 27ab5c5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 38 deletions.
9 changes: 2 additions & 7 deletions Ansiblefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@

site "https://galaxy.ansible.com/api/v1"

role "info.haproxy"

role "ansible-java8",
#path: "../ansible-java8"
github: "mhamrah/ansible-java8"
role "ansible-docker",
#path: "../ansible-docker"
github: "mhamrah/ansible-docker"
role "ansible-marathon",
#path: "../ansible-marathon"
github: "mhamrah/ansible-marathon"
path: "../ansible-marathon"
#github: "mhamrah/ansible-marathon"
role "ansible-mesos",
#path: "../ansible-mesos"
github: "mhamrah/ansible-mesos"
30 changes: 6 additions & 24 deletions Ansiblefile.lock
Original file line number Diff line number Diff line change
@@ -1,42 +1,24 @@
GIT
remote: https://github.com/Pheromone/ansible-haproxy
ref: master
sha: a2146ee4d14070d2c6f88e2b1cc942b5730690da
specs:
info.haproxy (0.0.0)

GIT
remote: https://github.com/mhamrah/ansible-docker
ref: master
sha: d6ea62f084cb53aba56108ec818a0ed892086c0c
specs:
ansible-docker (0.0.0)

GIT
remote: https://github.com/mhamrah/ansible-java8
ref: master
sha: 1f7167867fe472a8ab8a4f4f8348cb4b8da07981
specs:
ansible-java8 (0.0.0)

GIT
remote: https://github.com/mhamrah/ansible-marathon
ref: master
sha: 1b237e6806a3fbbb8208d58eebd8d6185b4d41c4
specs:
ansible-marathon (0.0.0)

GIT
remote: https://github.com/mhamrah/ansible-mesos
ref: master
sha: a57c4c9e78c90e92222fd9e22a29d5d8906e379d
sha: 21db6d296a9d316aa4ad14d2fe9a8ac671155079
specs:
ansible-mesos (0.0.0)

PATH
remote: ../ansible-marathon
specs:
ansible-marathon (0.0.0)

DEPENDENCIES
ansible-docker (>= 0)
ansible-java8 (>= 0)
ansible-marathon (>= 0)
ansible-mesos (>= 0)
info.haproxy (>= 0)

30 changes: 30 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.ssh.forward_agent = true
config.vm.synced_folder Dir.getwd, "/home/vagrant/ansible-mesos-playbook"

# ubuntu
config.vm.define 'ubuntu', primary: true do |c|
c.vm.network "private_network", ip: "192.168.100.2"
c.vm.box = "trusty-server-cloudimg-amd64-vagrant-disk1"
c.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
c.vm.provision "shell" do |s|
s.inline = "apt-get update -y; apt-get install ansible -y;"
s.privileged = true
end
end

# centos:
# config.vm.define 'centos' do |c|
# c.vm.network "private_network", ip: "192.168.100.3"
# c.vm.box = "centos65-x86_64-20140116"
# c.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box"
# c.vm.provision "shell" do |s|
# s.inline = "/bin/true"
# s.privileged = true
# end
# end

end
15 changes: 8 additions & 7 deletions playbook.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
- hosts: [mesos_masters]
sudo: True
tasks:
- name: Install vim
pre_tasks:
- name: Install Packages
apt: pkg={{ item }} state=present
with_items:
- git
- vim
- htop
- haproxy
- name: Sets haproxy to enabled
lineinfile: dest=/etc/default/haproxy regexp="^ENABLED" line="ENABLED=1"
roles:
- { role: './librarian_roles/ansible-docker', tags:['os-tools'] }
- { role: './librarian_roles/ansible-java8', tags:['runtimes', 'java']}
- { role: './librarian_roles/info.haproxy' }
- { role: './librarian_roles/ansible-mesos', mesos_cluster_name: "mlh_mesos", mesos_options: "--log_dir=$LOGS", tags: ['mesos', 'platforms'] }
- { role: './librarian_roles/ansible-mesos', mesos_install_mode: 'master', mesos_cluster_name: 'mlh_mesos', tags: ['mesos', 'platforms'] }
- { role: './librarian_roles/ansible-marathon', tags:['mesos-tools'] }

- hosts: [mesos_slaves]
sudo: True
roles:
- { role: './librarian_roles/ansible-docker', tags:['os-tools'] }
- { role: './librarian_roles/ansible-java8', tags:['runtimes', 'java']}
- { role: './librarian_roles/ansible-mesos', mesos_install_mode: "slave", mesos_version: "0.19.0", mesos_options: "--log_dir=$LOGS", tags: ['mesos', 'platforms'] }
- { role: './librarian_roles/ansible-mesos', mesos_install_mode: "slave", tags: ['mesos', 'platforms'] }

0 comments on commit 27ab5c5

Please sign in to comment.