diff --git a/doc/source/sysadmin.rst b/doc/source/sysadmin.rst index 510af8c0da..6aa8675ba5 100644 --- a/doc/source/sysadmin.rst +++ b/doc/source/sysadmin.rst @@ -306,6 +306,11 @@ instance by name, you need to put its name in `disabled:children`. If you want to refer to a single instance by UUID, or if there are statically defined hosts that need to be disabled, you should put those in `disabled`. +Because of the way static and dynamic inventories get merged by ansible, the +static file needs to stand alone. 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. + Disabling puppet via ansible inventory does not disable puppet from being run directly on the host, it merely prevents the puppetmaster from causing puppet to be run. If you choose to run puppet manually on a host, take care diff --git a/launch/launch-node.py b/launch/launch-node.py index 2ea21b4f4c..b4beae0aa1 100755 --- a/launch/launch-node.py +++ b/launch/launch-node.py @@ -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() diff --git a/modules/openstack_project/files/puppetmaster/static-inventory b/modules/openstack_project/files/puppetmaster/static-inventory index 0734230670..3c934856f3 100644 --- a/modules/openstack_project/files/puppetmaster/static-inventory +++ b/modules/openstack_project/files/puppetmaster/static-inventory @@ -1,4 +1,20 @@ [disabled] + +[jenkins-dev.openstack.org] + +[hound.openstack.org] + +[pypi.bhs1.openstack.org] + +[pypi.region-b.geo-1.openstack.org] + +[pypi.sjc1.openstack.org] + +[review-dev.openstack.org] + +[subunit-worker01.openstack.org] + +[disabled:children] ci-backup-rs-ord.openstack.org jenkins-dev.openstack.org hound.openstack.org @@ -7,5 +23,3 @@ pypi.region-b.geo-1.openstack.org pypi.sjc1.openstack.org review-dev.openstack.org subunit-worker01.openstack.org - -[disabled:children] diff --git a/modules/openstack_project/manifests/puppetmaster.pp b/modules/openstack_project/manifests/puppetmaster.pp index a33a25b20a..ca694d677c 100644 --- a/modules/openstack_project/manifests/puppetmaster.pp +++ b/modules/openstack_project/manifests/puppetmaster.pp @@ -184,12 +184,16 @@ class openstack_project::puppetmaster ( } file { '/etc/ansible/hosts/puppet': - owner => 'root', - group => 'root', - mode => '0755', - subscribe => Class['::ansible'], - source => '/usr/local/bin/puppet-inventory', - replace => true, + ensure => absent, + } + + file { '/etc/ansible/hosts/openstack': + owner => 'root', + group => 'root', + mode => '0755', + source => '/opt/ansible/contrib/inventory/openstack.py', + replace => true, + require => Vcsrepo['/opt/ansible'], } file { '/etc/ansible/hosts/static': diff --git a/modules/openstack_project/templates/puppetmaster/ansible-clouds.yaml.erb b/modules/openstack_project/templates/puppetmaster/ansible-clouds.yaml.erb index 4fd3cf1cca..64ac3ca519 100644 --- a/modules/openstack_project/templates/puppetmaster/ansible-clouds.yaml.erb +++ b/modules/openstack_project/templates/puppetmaster/ansible-clouds.yaml.erb @@ -1,6 +1,6 @@ cache: expiration_time: 86400 - path: /var/cache/ansible-inventory.json + path: /var/cache/ansible-inventory clouds: openstackci2-hpcloud: profile: hp