Use OpenStack for inventory instead of puppet

With the puppetmaster not there anymore, we should consume inventory
from OpenStack rather than from puppet.

It turns out that because of the way static and dynamic inventories get
merged, the static file needs to stand alone. SO - if you need to
disable a dynamic host from OpenStack (pretty much all of our hosts) you
need to not only add it to dynamic:children, you need to add an emtpy
group into the static file too, otherwise you'll get an error like:

 root@puppetmaster:~# ansible -i newinv '!disabled' --list-hosts
 ERROR: newinv/static:4: child group is not defined: (jenkins-dev.openstack.org)

Change-Id: Ic6809ed0b7014d7aebd414bf3a342e3a37eb10b6
This commit is contained in:
Monty Taylor
2015-11-25 11:36:30 -05:00
parent 6c18aef1d9
commit 714c934d0c
5 changed files with 35 additions and 9 deletions

View File

@@ -296,6 +296,9 @@ def main():
options.keep, options.net_label, options.floating_ip_pool,
options.boot_from_volume)
dns.print_dns(client, options.name)
# Remove the ansible inventory cache so that next run finds the new
# server
os.unlink('/var/cache/ansible-inventory.json')
if __name__ == '__main__':
main()