Zero out the inventory cache instead of removing it

https://github.com/ansible/ansible/pull/14882 landed, so the inventory
will understand that an empty cache means the inventory needs
refetching. Zero out the file, and start consuming inventory from the
master branch of ansible since mordred controls that file anyway.

Change-Id: I2a4f4b21c50bfa94a229dd109e3d21f47552f0a1
This commit is contained in:
Monty Taylor 2016-03-09 12:02:06 -06:00
parent f94594a98e
commit cdead64021
2 changed files with 7 additions and 5 deletions

View File

@ -256,10 +256,12 @@ def main():
options.network, options.boot_from_volume,
options.config_drive)
dns.print_dns(cloud, server)
# Remove the ansible inventory cache so that next run finds the new
# server
if os.path.exists('/var/cache/ansible-inventory/ansible-inventory.cache'):
os.unlink('/var/cache/ansible-inventory/ansible-inventory.cache')
# Zero the ansible inventory cache so that next run finds the new server
inventory_cache = '/var/cache/ansible-inventory/ansible-inventory.cache'
if os.path.exists(inventory_cache):
with open(inventory_cache, 'w'):
pass
os.system('/usr/local/bin/expand-groups.sh')
if __name__ == '__main__':

View File

@ -227,7 +227,7 @@ class openstack_project::puppetmaster (
vcsrepo { '/opt/ansible':
ensure => latest,
provider => git,
revision => 'stable-2.0',
revision => 'devel',
source => 'https://github.com/ansible/ansible',
}