Skip to content

Commit 2b0caa2

Browse files
committed
updating readme; reverting test directory to upstream master
1 parent f291247 commit 2b0caa2

File tree

8 files changed

+58
-60
lines changed

8 files changed

+58
-60
lines changed

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
ansible-mesos
22
=============
33

4-
Mesos Playbook for Ansible, with multi-master zookeeper support and docker and native mesos executors configured. Install this on Ubuntu 14.04 LTS or RHEL/Centos 6.5. RHEL/Centos 7 will fail with zookeeper issues. [Read the blog post](http://blog.michaelhamrah.com/2014/06/setting-up-a-multi-node-mesos-cluster-running-docker-haproxy-and-marathon-with-ansible/) for a descriptive overview of how this relates to running the [mhamrah/ansible-mesos-playbook](https://github.com/mhamrah/ansible-mesos-playbook).
4+
## Requirements
5+
6+
- ansible-zookeeper, or a zookeeper server
57

6-
NOTE: This role requires the following roles:
8+
## Overview
79

8-
- ansible-java, or java already installed on the host.
10+
The ansible-mesos role supports the installation and configuration of a mesos cluster with roles for master, slave or a master-slave configuration.
911

10-
## Overview
12+
It optionally supports the installation of docker with slave containerizers configured for both docker and native mesos execution.
13+
14+
## Configuration
15+
16+
Combined with [Ansible groups](http://docs.ansible.com/intro_inventory.html#hosts-and-groups) this role makes it easy to specify a multi-node Mesos master for high availability. There is one variable in your playbook to override:
1117

12-
- Installs Docker
13-
- Works in conjuction with Ansible groups and group_vars to configure a multi-node cluster for masters and zookeeper.
14-
- Supports master, slave, and master-slave installations per node
15-
- Configures slave containerizers as docker,mesos for docker and native mesos support
16-
- Puts configuration in /etc/default/mesos, /etc/default/mesos-master and /etc/default/mesos-slave as per [Mesos documentation](http://mesos.apache.org/documentation/latest/configuration/).
17-
- Removes the default mesosphere /etc/mesos, /etc/mesos-master and /etc/mesos-slave configuration files (favors environment variables, /etc/defaults)
18-
- Uses upstart to launch /usr/bin/mesos-init-wrapper
18+
* ```zookeeper_hostnames``` specifies the list of zookeeper nodes used by Mesos for HA. By default this is the current node hostname and the default zookeeper port ```localhost:2181```. It can be constructed in your playbook by combining all nodes in your zookeeper group:
1919

20-
See [mhamrah/ansible-mesos-playbook](https://github.com/mhamrah/ansible-mesos-playbook) for an example playbook which sets up a multi-node mesos cluster. The example also includes [Ansible-Marathon](https://github.com/mhamrah/ansible-marathon) for running applications on Mesos.
20+
- { role: 'ansible-mesos', zookeeper_hostnames: "{{ groups.zookeeper_hosts | join(':' + zookeeper_client_port + ',') }}:{{ zookeeper_client_port }}" }
2121

22-
## Notes
22+
which produces ```zookeeper1:2181,zookeeper2:2181,zookeeper3:2181```. This gets merged into the mesos_zookeeper_masters uri.
23+
24+
You may also want to specify a ```mesos_quorum``` value of ```n/2 + 1```, where n is the number of nodes, as Mesos uses a ```replicated_log``` by default.
2325

24-
Currently defaults to Mesos 0.20.1.
26+
See the ```vars/main.yml``` file for specific role settings and [the Mesos configuration page for Mesos settings](http://mesos.apache.org/documentation/latest/configuration/).

Vagrantfile

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,37 @@ Vagrant.configure("2") do |config|
55
config.ssh.forward_agent = true
66
config.vm.synced_folder Dir.getwd, "/home/vagrant/roles/ansible-mesos", nfs: true
77

8-
# ubuntu
9-
config.vm.define 'ubuntu', primary: true do |c|
8+
# ubuntu 12.04 that Travis CI is using
9+
config.vm.define 'travis', primary: true do |c|
1010
c.vm.network "private_network", ip: "192.168.100.2"
11+
c.vm.box = "precise-server-cloudimg-amd64-vagrant-disk1"
12+
c.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
13+
c.vm.provision "shell" do |s|
14+
s.inline = "apt-get update -y; apt-get install python-software-properties; add-apt-repository ppa:rquillo/ansible; apt-get update -y; apt-get install ansible -y"
15+
s.privileged = true
16+
end
17+
end
18+
19+
# ubuntu 14.04
20+
config.vm.define 'ubuntu', primary: true do |c|
21+
c.vm.network "private_network", ip: "192.168.100.3"
1122
c.vm.box = "trusty-server-cloudimg-amd64-vagrant-disk1"
12-
c.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
13-
c.vm.provision "shell" do |s|
14-
s.inline = "apt-get update -y; apt-get install ansible -y;"
15-
s.privileged = true
23+
c.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
24+
c.vm.provision "shell" do |s|
25+
s.inline = "apt-get update -y; apt-get install python-software-properties; add-apt-repository ppa:voronov84/andreyv; apt-get update -y; apt-get install ansible -y"
26+
s.privileged = true
1627
end
1728
end
1829

19-
# centos:
20-
# config.vm.define 'centos' do |c|
21-
# c.vm.network "private_network", ip: "192.168.100.3"
22-
# c.vm.box = "centos65-x86_64-20140116"
23-
# c.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box"
24-
# c.vm.provision "shell" do |s|
25-
# s.inline = "/bin/true"
26-
# s.privileged = true
27-
# end
28-
# end
30+
# centos 6:
31+
config.vm.define 'centos' do |c|
32+
c.vm.network "private_network", ip: "192.168.100.4"
33+
c.vm.box = "centos65-x86_64-20140116"
34+
c.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box"
35+
c.vm.provision "shell" do |s|
36+
s.inline = "yum update gmp; yum install ansible -y"
37+
s.privileged = true
38+
end
39+
end
2940

3041
end

meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
galaxy_info:
33
author: Jason Giedymin
4-
description: Ansible NodeJS Playbook Role
4+
description: Ansible Mesos Playbook Role
55
company: http://jasongiedymin.com
66
license: Apache 2
77
min_ansible_version: 1.2

tests/inventory

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
[mesos_masters]
2-
localhost zoo_id=1
1+
[localhost]
2+
localhost

tests/main.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,25 @@
33
connection: local
44
sudo: yes
55
tasks:
6-
# Tests
6+
# Check service status for Mesos Master
77
- name: Check mesos-master service
88
shell: service mesos-master status | grep "running"
99
register: master_service_status
1010
ignore_errors: yes
11+
12+
- name: Doing status only
13+
shell: service mesos-master status
14+
register: master_service_status_only
15+
ignore_errors: yes
16+
1117
- fail: msg="mesos-master service is not running."
1218
when: master_service_status.stdout == ""
1319

20+
# Check service status for Mesos Slave
1421
- name: Check mesos-slave service
1522
shell: service mesos-slave status | grep "running"
1623
register: slave_service_status
1724
ignore_errors: yes
25+
1826
- fail: msg="mesos-slave service is not running."
1927
when: slave_service_status.stdout == ""

tests/packer.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
connection: local
88
sudo: yes
99
roles:
10-
- {role: ../../, mesos_quroum: "1", mesos_cluster_name: "test", mesos_ip: "{{ ansible_eth1.ipv4.address }}", mesos_install_mode: "master-slave"}
10+
- {role: ../../, mesos_install_mode: "master-slave"}
1111

1212
- include: main.yml

vars/main.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ mesos_playbook_version: "0.3.0"
44
mesos_install_mode: "master" # {master|slave|master-slave}
55
mesos_version: "0.20.1"
66

7-
# exec info
8-
mesos_bin_name: mesos
9-
mesos_local_bin: "{{mesos_bin_name}}-local"
10-
mesos_master_bin: "{{mesos_bin_name}}-master"
11-
mesos_slave_bin: "{{mesos_bin_name}}-slave"
12-
137
# conf file settings
148
mesos_cluster_name: "mesos_cluster"
159
mesos_ip: "{{ansible_default_ipv4.address}}"
@@ -18,7 +12,8 @@ mesos_log_location: "/var/log/mesos"
1812
mesos_ulimit: "-n 8192"
1913
mesos_options: "--log_dir=$LOGS"
2014
mesos_work_dir: "/var/mesos"
21-
mesos_quorum: "2"
15+
mesos_quorum: "1"
16+
zookeeper_client_port: "2181"
2217
zookeeper_hostnames: "{{ mesos_hostname }}:{{ zookeeper_client_port }}"
2318
mesos_zookeeper_masters: "zk://{{ zookeeper_hostnames }}/mesos"
2419

0 commit comments

Comments
 (0)