Created
April 10, 2014 02:08
-
-
Save tgerla/10337114 to your computer and use it in GitHub Desktop.
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
--- | |
ip_vlan_mapping: | |
"192.168.1.100": 992 | |
"192.168.1.101": 997 | |
"192.168.1.102": 993 |
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
Timothys-MacBook-Pro:ansible-test tgerla$ ansible-playbook -i localhost, test-vars.yml | |
PLAY [localhost] ************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [localhost] | |
TASK: [debug msg="VLAN for our IP is {{ip_vlan_mapping[ip]}}"] **************** | |
ok: [localhost] => { | |
"msg": "VLAN for our IP is 997" | |
} | |
PLAY RECAP ******************************************************************** | |
localhost : ok=2 changed=0 unreachable=0 failed=0 |
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
--- | |
- hosts: localhost | |
connection: local | |
vars: | |
ip: 192.168.1.101 | |
tasks: | |
- debug: msg="VLAN for our IP is {{ ip_vlan_mapping[ip] }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment