Skip to content

Instantly share code, notes, and snippets.

@mlabouardy
Created January 5, 2019 11:14
Show Gist options
  • Select an option

  • Save mlabouardy/38d4a55798aa4ea0bd373275162d41fc to your computer and use it in GitHub Desktop.

Select an option

Save mlabouardy/38d4a55798aa4ea0bd373275162d41fc to your computer and use it in GitHub Desktop.
Provision GCP instances to Swarm cluster
---
- name: Install Python
hosts: managers:workers
gather_facts: False
roles:
- python
- name: Init Swarm cluster
hosts: managers
gather_facts: False
roles:
- swarm-init
- name: Join Swarm cluster
hosts: workers
gather_facts: False
vars:
token: "{{ hostvars[groups['managers'][0]]['worker_token']['stdout'] }}"
manager: "{{ hostvars[groups['managers'][0]]['inventory_hostname'] }}"
roles:
- swarm-join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment