Created
December 22, 2014 08:24
-
-
Save kuon/8153e6c253e089836ef8 to your computer and use it in GitHub Desktop.
Share host variables with ansible
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: etcd | |
gather_facts: false | |
sudo: false | |
tasks: | |
- command: etcdctl get somepassword | |
register: somepassword | |
- hosts: other | |
sudo: true | |
gather_facts: false | |
tasks: | |
- name: Test | |
command: 'echo {{ hostvars[groups.etcd[0]].somepassword }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment