Skip to content

Instantly share code, notes, and snippets.

@kuon
Created December 22, 2014 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuon/8153e6c253e089836ef8 to your computer and use it in GitHub Desktop.
Save kuon/8153e6c253e089836ef8 to your computer and use it in GitHub Desktop.
Share host variables with ansible
---
- 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