From e6bb441709f8cc5576a10cce56bcacee21bfbcbe Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 30 May 2018 10:29:43 -0700 Subject: [PATCH] Switch to using new ansible openstack inventory script There were updates upstream in ansible to rename this script due to import issues. Additionally this switches us from using shade to openstacksdk to get the inventory contents dynamically. Note that we ensure the old file is absent prior to adding the new file to avoid a race where we'll have two dynamic inventory scripts providing the same functionality. Change-Id: I76b1099bf0cf3bfead17f96e456cdce87d0e8a49 --- .../manifests/puppetmaster.pp | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/openstack_project/manifests/puppetmaster.pp b/modules/openstack_project/manifests/puppetmaster.pp index 8d5795f807..10cb964b88 100644 --- a/modules/openstack_project/manifests/puppetmaster.pp +++ b/modules/openstack_project/manifests/puppetmaster.pp @@ -262,10 +262,7 @@ class openstack_project::puppetmaster ( vcsrepo { '/opt/ansible': ensure => latest, provider => git, - # Pinned here because the shade + openstacksdk merger resulted in the - # openstack.py inventory script below getting renamed and may require new - # deps. - revision => 'v2.5.3', + revision => 'devel', source => 'https://github.com/ansible/ansible', } @@ -281,14 +278,25 @@ class openstack_project::puppetmaster ( } file { '/etc/ansible/hosts/openstack': + ensure => absent, owner => 'root', group => 'root', mode => '0755', - source => '/opt/ansible/contrib/inventory/openstack.py', - replace => true, require => Vcsrepo['/opt/ansible'], } + file { '/etc/ansible/hosts/openstack_inventory': + owner => 'root', + group => 'root', + mode => '0755', + source => '/opt/ansible/contrib/inventory/openstack_inventory.py', + replace => true, + require => [ + File['/etc/ansible/hosts/openstack'], + Vcsrepo['/opt/ansible'], + ], + } + file { '/etc/ansible/hosts/static': ensure => absent, }