Last active
January 26, 2016 11:28
-
-
Save riton/b393a2942b859be666e7 to your computer and use it in GitHub Desktop.
Ansible read inventory from FileDescriptor
This file contains 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
#!/bin/bash | |
for host in a b c d e | |
do | |
echo "host${host}" | |
done |
This file contains 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
# /usr/bin/ansible --version | |
# ansible 1.5.4 | |
$ /usr/bin/ansible -i <(./cmdb.sh) all --list-hosts | |
hosta | |
hostb | |
hostc | |
hostd | |
hoste |
This file contains 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
# ./ansible --version | |
# ansible 1.9.4 | |
$ ./ansible -i <(./cmdb.sh) all --list-hosts | |
No hosts matched | |
# With comma after the () | |
$ ./ansible -i <(/tmp/cmdb.sh), all --list-hosts -vvv | |
/proc/self/fd/11 |
This file contains 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
# ansible --version | |
# ansible 2.0.0.1 | |
$ ansible -i <(./cmdb.sh) all --list-hosts | |
ERROR! ERROR! the file_name '/proc/self/fd/11' does not exist, or is not readable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment