(image from digitalocean)
This recipe is not fully functional yet !!!
When deploying a task from the marathon UI, the deployment hangs forever if mesos master is not the first one of the list (!). I'm currently digging into this bug.
Vagrantfile defines 6 VMs: 3 mesos masters (running mesos/marathon) + 3 mesos slaves running docker
Copy your public key into roles/copy-authorized-key/files/id_rsa_ansible.pub
Run 'vagrant up' command: 6 VMs (with IP from 192.168.1.211 to 192.168.1.216) are created
Run 'ansible-playbook -i inventory/test.ini -k -u vagrant -s init.yml' command
Run 'ansible-playbook -i inventory/test.ini main.yml' command
Check Mesos and Marathon dashboards from a browser
Note: you may be redirected towards the actual master (if 192.168.1.211 is not the one elected)
Create task within marathon dashboard
Scale task from within Marathon dashboard
The host file defines the inventory/ENVIRONMENT.ini (mesos master and mesos slaves)
eg:
[zookeepers]
192.168.1.211
192.168.1.212
192.168.1.213
[mesos-masters]
192.168.1.211
192.168.1.212
192.168.1.213
[mesos-slaves]
192.168.1.214
192.168.1.215
192.168.1.216
[marathons]
192.168.1.211
192.168.1.212
192.168.1.213
This first task initiate the server creating a user named mongors
Depending upon the node access, several bootstrap scenario can be used:
ansible-playbook -i inventory/ENVIRONMENT.ini -k -u vagrant -s init.yml
note: vagrant ssh password will be requested (sudo password not requested as vagrant user is authorized to sudo without any password by default)
ansible-playbook -i inventory/ENVIRONMENT.ini -k -u root init.yml
note: root ssh password will be requested
ansible-playbook -i inventory/ENVIRONMENT.ini -k -K -u USER -s init.yml
note: both user's ssh password + sudo password will be requested
Once the nodes are registered, the replica set can be created using the following command:
ansible-playbook -i inventory/ENVIRONMENT.ini main.yml
MIT License - Copyright © 2015 GridPocket
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.