Created
November 12, 2015 22:46
-
-
Save sycobuny/21dfe7ed1ee146a3f83d to your computer and use it in GitHub Desktop.
Silly example ansible dynamic inventory
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
[defaults] | |
inventory = ./inventory.pl |
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/env perl | |
use warnings; | |
use strict; | |
print <<OUTPUT; | |
{ | |
"excluded" : ["someserver.example.com"], | |
"_meta" : { | |
"hostvars" : { | |
"someserver.example.com": {} | |
} | |
} | |
} | |
OUTPUT |
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 --list-hosts excluded | |
someserver.example.com | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment