Skip to content

Instantly share code, notes, and snippets.

@sycobuny
Created November 12, 2015 22:46
Show Gist options
  • Save sycobuny/21dfe7ed1ee146a3f83d to your computer and use it in GitHub Desktop.
Save sycobuny/21dfe7ed1ee146a3f83d to your computer and use it in GitHub Desktop.
Silly example ansible dynamic inventory
[defaults]
inventory = ./inventory.pl
#!/usr/bin/env perl
use warnings;
use strict;
print <<OUTPUT;
{
"excluded" : ["someserver.example.com"],
"_meta" : {
"hostvars" : {
"someserver.example.com": {}
}
}
}
OUTPUT
$ 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