Skip to content

Instantly share code, notes, and snippets.

@gthieleb
Last active September 9, 2016 06:17
Show Gist options
  • Save gthieleb/87d9c9a4c717a1625926918e59a37840 to your computer and use it in GitHub Desktop.
Save gthieleb/87d9c9a4c717a1625926918e59a37840 to your computer and use it in GitHub Desktop.
ansible pointing to another hosts file
# since 2.x use inventory
cat > ~/.ansible.cfg << EOF
[defaults]
inventory = ~/.ansible/hosts
EOF
test -d ~/.ansible || mkdir ~/.ansible
# put your hosts here
cat > ~/.ansible/hosts << EOF
[vms]
vm01
vm02
vm03
EOF
@gthieleb
Copy link
Author

gthieleb commented Sep 9, 2016

mkdir ~/.ansible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment