From 75c068f7677deb9352e929d9211cfd5b5d0bcbb0 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 21 Oct 2014 10:49:08 -0500 Subject: [PATCH] Put playbooks in a directory Listing each of them individually in the puppetmaster.pp file is just plain crazypants. Change-Id: Ice621be7d62ec8ff5bc680cf24c237c38f8f30e5 --- doc/source/gerrit.rst | 2 +- .../{ => playbooks}/clean_workspaces.yaml | 0 .../{ => playbooks}/remote_puppet_afs.yaml | 0 .../{ => playbooks}/remote_puppet_else.yaml | 0 .../{ => playbooks}/remote_puppet_git.yaml | 0 .../manifests/puppetmaster.pp | 31 ++++++++----------- run_all.sh | 6 ++-- 7 files changed, 17 insertions(+), 22 deletions(-) rename modules/openstack_project/files/ansible/{ => playbooks}/clean_workspaces.yaml (100%) rename modules/openstack_project/files/ansible/{ => playbooks}/remote_puppet_afs.yaml (100%) rename modules/openstack_project/files/ansible/{ => playbooks}/remote_puppet_else.yaml (100%) rename modules/openstack_project/files/ansible/{ => playbooks}/remote_puppet_git.yaml (100%) diff --git a/doc/source/gerrit.rst b/doc/source/gerrit.rst index 34d094a441..4f94b92c9f 100644 --- a/doc/source/gerrit.rst +++ b/doc/source/gerrit.rst @@ -482,7 +482,7 @@ To rename a project: changing, gate jobs may fail due to outdated remote URLs. Clear the workspaces on persistent Jenkins slaves to mitigate this:: - sudo ansible-playbook -f 10 /etc/ansible/clean_workspaces.yaml --extra-vars "project=PROJECTNAME" + sudo ansible-playbook -f 10 /etc/ansible/playbooks/clean_workspaces.yaml --extra-vars "project=PROJECTNAME" #. Again, if this is an org move rather than a rename and the GitHub project has been created but is empty, trigger replication to diff --git a/modules/openstack_project/files/ansible/clean_workspaces.yaml b/modules/openstack_project/files/ansible/playbooks/clean_workspaces.yaml similarity index 100% rename from modules/openstack_project/files/ansible/clean_workspaces.yaml rename to modules/openstack_project/files/ansible/playbooks/clean_workspaces.yaml diff --git a/modules/openstack_project/files/ansible/remote_puppet_afs.yaml b/modules/openstack_project/files/ansible/playbooks/remote_puppet_afs.yaml similarity index 100% rename from modules/openstack_project/files/ansible/remote_puppet_afs.yaml rename to modules/openstack_project/files/ansible/playbooks/remote_puppet_afs.yaml diff --git a/modules/openstack_project/files/ansible/remote_puppet_else.yaml b/modules/openstack_project/files/ansible/playbooks/remote_puppet_else.yaml similarity index 100% rename from modules/openstack_project/files/ansible/remote_puppet_else.yaml rename to modules/openstack_project/files/ansible/playbooks/remote_puppet_else.yaml diff --git a/modules/openstack_project/files/ansible/remote_puppet_git.yaml b/modules/openstack_project/files/ansible/playbooks/remote_puppet_git.yaml similarity index 100% rename from modules/openstack_project/files/ansible/remote_puppet_git.yaml rename to modules/openstack_project/files/ansible/playbooks/remote_puppet_git.yaml diff --git a/modules/openstack_project/manifests/puppetmaster.pp b/modules/openstack_project/manifests/puppetmaster.pp index 19f50d7dbe..3b7fdc0169 100644 --- a/modules/openstack_project/manifests/puppetmaster.pp +++ b/modules/openstack_project/manifests/puppetmaster.pp @@ -18,10 +18,6 @@ class openstack_project::puppetmaster ( ca_server => $ca_server, } - $ansible_remote_puppet_else_source = 'puppet:///modules/openstack_project/ansible/remote_puppet_else.yaml' - $ansible_remote_puppet_afs_source = 'puppet:///modules/openstack_project/ansible/remote_puppet_afs.yaml' - $ansible_remote_puppet_git_source = 'puppet:///modules/openstack_project/ansible/remote_puppet_git.yaml' - file {'/etc/puppet/environments': ensure => directory, owner => 'root', @@ -166,27 +162,26 @@ class openstack_project::puppetmaster ( # Playbooks # - file { '/etc/ansible/remote_puppet_else.yaml': - ensure => present, - source => $ansible_remote_puppet_else_source, + file { '/etc/ansible/playbooks': + ensure => directory, + recurse => true, + source => 'puppet:///modules/openstack_project/ansible/playbooks', require => Class[ansible], } + file { '/etc/ansible/remote_puppet.yaml': + ensure => absent, + } file { '/etc/ansible/remote_puppet_afs.yaml': - ensure => present, - source => $ansible_remote_puppet_afs_source, - require => Class[ansible], + ensure => absent, + } + file { '/etc/ansible/remote_puppet_else.yaml': + ensure => absent, } - file { '/etc/ansible/remote_puppet_git.yaml': - ensure => present, - source => $ansible_remote_puppet_git_source, - require => Class[ansible], + ensure => absent, } - file { '/etc/ansible/clean_workspaces.yaml': - ensure => present, - source => 'puppet:///modules/openstack_project/ansible/clean_workspaces.yaml', - require => Class[ansible], + ensure => absent, } } diff --git a/run_all.sh b/run_all.sh index 4982b59e2c..58d1821c96 100755 --- a/run_all.sh +++ b/run_all.sh @@ -25,9 +25,9 @@ touch manifests/site.pp # First run the git/gerrit sequence, since it's important that they all work # together -ansible-playbook /etc/ansible/remote_puppet_git.yaml >> /var/log/puppet_run_all.log 2>&1 +ansible-playbook /etc/ansible/playbooks/remote_puppet_git.yaml >> /var/log/puppet_run_all.log 2>&1 # Run AFS changes separately so we can make sure to only do one at a time # (turns out quorum is nice to have) -ansible-playbook -f 1 /etc/ansible/remote_puppet_afs.yaml >> /var/log/puppet_run_all.log 2>&1 +ansible-playbook -f 1 /etc/ansible/playbooks/remote_puppet_afs.yaml >> /var/log/puppet_run_all.log 2>&1 # Run everything else. We do not care if the other things worked -ansible-playbook /etc/ansible/remote_puppet_else.yaml >> /var/log/puppet_run_all.log 2>&1 +ansible-playbook /etc/ansible/playbooks/remote_puppet_else.yaml >> /var/log/puppet_run_all.log 2>&1