Created
January 5, 2019 11:14
-
-
Save mlabouardy/38d4a55798aa4ea0bd373275162d41fc to your computer and use it in GitHub Desktop.
Provision GCP instances to Swarm cluster
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
| --- | |
| - 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