Created
February 17, 2019 04:58
-
-
Save genzj/eaa8dfd1b26b3dea298785cf2db99e43 to your computer and use it in GitHub Desktop.
An example of an ansible dynamic inventory script in Python
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
{ | |
"group001": { | |
"hosts": ["host001", "host002"], | |
"vars": { | |
"var1": true | |
}, | |
"children": ["group002"] | |
}, | |
"group002": { | |
"hosts": ["host003","host004"], | |
"vars": { | |
"var2": 500 | |
}, | |
"children":[] | |
}, | |
"server": { | |
"hosts": ["ansible-target.local"], | |
"vars": { | |
"ansible_ssh_private_key_file": "~/ansible-exercise-key", | |
"ansible_user": "ansible" | |
}, | |
"children":[] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment