Last active
July 23, 2016 17:12
-
-
Save runcom/af602acfc6510f539f05fb5f21c95a1e to your computer and use it in GitHub Desktop.
This file contains 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
SWARM_SECRET=91pqsf3o0nax7mrfoiy5zy1d9 \ | |
SWARM_CA_HASH=sha256:6b802f9d75708d71ea07c95c16ff5c26eaea01899010b6f401f63185ddacd375 \ | |
SWARM_MASTER=192.168.122.57 \ | |
ansible-playbook setup_worker.yml -i workers --ask-pass |
This file contains 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: workers | |
tasks: | |
- redhat_subscription: state=present username=youruser@redhat.com password=secretpassword autosubscribe=true | |
- yum: name=* state=latest | |
- shell: curl -fsSL https://test.docker.com/ | sh | |
- shell: sed -i 's/ExecStart=\/usr\/bin\/dockerd -H fd:\/\//ExecStart=\/usr\/bin\/dockerd -H fd:\/\/ --label test=test/g' /usr/lib/systemd/system/docker.service | |
- service: name=docker state=started | |
- shell: docker swarm join --secret {{ lookup('env','SWARM_SECRET') }} --ca-hash {{ lookup('env','SWARM_CA_HASH') }} {{ lookup('env','SWARM_MASTER') }} |
This file contains 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
[all:vars] | |
ansible_connection=ssh | |
ansible_ssh_user=root | |
ansible_ssh_pass=password | |
[workers] | |
192.168.122.164 | |
192.168.122.95 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment