Created
April 13, 2016 17:05
-
-
Save jbrisbin/603789d39d0d242ecba67ae88d3e39f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -sS master.mesos:5050/slaves/json | jq -r '.slaves[] | .hostname' >inventory.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
gather_facts: no | |
tasks: | |
- name: install weave | |
get_url: url=http://git.io/weave dest=/usr/local/bin/weave mode=0755 | |
- name: find my ip | |
shell: ip addr show dev eth1 | egrep 'scope global' | cut -d\/ -f1 | awk '{print \$2}' | |
register: self_ip | |
- name: find slaves | |
shell: curl -sS master.mesos:5050/slaves/json | jq -r '.slaves[] | .hostname' | egrep -v {{self_ip.stdout}} | |
register: mesos_slaves | |
- name: stop weave | |
shell: weave stop | |
- name: start weave | |
shell: weave launch --ipalloc-range 192.168.0.0/16 {{ mesos_slaves.stdout_lines | join(' ') }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment