From 92b29acd0db4d24a15c7116152a2335fac9dac63 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 29 May 2014 17:47:03 -0700 Subject: [PATCH] Add playbook for cleaning workspaces Sometimes we need to clean the workspaces. While we have a command documented, go ahead and make a playbook for it. Change-Id: I1887dec24563811a71157c000b2d8ae9b7850d6a --- doc/source/gerrit.rst | 2 +- .../openstack_project/files/ansible/clean_workspaces.yaml | 4 ++++ modules/openstack_project/manifests/puppetmaster.pp | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 modules/openstack_project/files/ansible/clean_workspaces.yaml diff --git a/doc/source/gerrit.rst b/doc/source/gerrit.rst index c7feb1b747..b0f0214275 100644 --- a/doc/source/gerrit.rst +++ b/doc/source/gerrit.rst @@ -474,7 +474,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 salt '*.slave.openstack.org' cmd.run 'rm -rf ~jenkins/workspace/*PROJECT*' + sudo ansible-playbook -f 10 /etc/ansible/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/clean_workspaces.yaml new file mode 100644 index 0000000000..78cc611a38 --- /dev/null +++ b/modules/openstack_project/files/ansible/clean_workspaces.yaml @@ -0,0 +1,4 @@ +--- +- hosts: *.slave.openstack.org + tasks: + - shell: 'rm -rf ~jenkins/workspace/*{{ project }}*' diff --git a/modules/openstack_project/manifests/puppetmaster.pp b/modules/openstack_project/manifests/puppetmaster.pp index 376ca06060..8459fd585d 100644 --- a/modules/openstack_project/manifests/puppetmaster.pp +++ b/modules/openstack_project/manifests/puppetmaster.pp @@ -123,4 +123,9 @@ class openstack_project::puppetmaster ( require => Class[ansible], } + file { '/etc/ansible/clean_workspaces.yaml': + ensure => present, + source => 'puppet:///modules/openstack_project/ansible/clean_workspaces.yaml', + require => Class[ansible], + } }