Skip to content

Instantly share code, notes, and snippets.

/inv

Created May 22, 2014 01:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9be9ca03edb506da6271 to your computer and use it in GitHub Desktop.
Save anonymous/9be9ca03edb506da6271 to your computer and use it in GitHub Desktop.
localhost
$ ansible-playbook site.yml -i inv
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
localhost: importing /Users/.../vars_Darwin.yml
TASK: [show vars] *************************************************************
ok: [localhost] => {
"msg": "test_var=b"
}
PLAY RECAP ********************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0
- hosts: all
vars_files:
- [ 'vars_{{ansible_os_family}}.yml', 'vars_b.yml' ]
tasks:
- name: show var
action: debug msg="test_var={{test_var}}"
---
test_var: 'b'
---
test_var: 'Darwin'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment