diff --git a/install_modules.sh b/install_modules.sh index 58e399f3be..8b048f7cd0 100755 --- a/install_modules.sh +++ b/install_modules.sh @@ -14,7 +14,10 @@ # License for the specific language governing permissions and limitations # under the License. -export PUPPET_VERSION=${PUPPET_VERSION:-3} +function puppet_version { + PATH=/opt/puppetlabs/bin:$PATH puppet --version | cut -d '.' -f 1 +} +export PUPPET_VERSION=$(puppet_version) if [ "$PUPPET_VERSION" == "3" ] ; then export MODULE_PATH=/etc/puppet/modules diff --git a/playbooks/update_puppet_version.yaml b/playbooks/update_puppet_version.yaml new file mode 100644 index 0000000000..c8d3f1bf4d --- /dev/null +++ b/playbooks/update_puppet_version.yaml @@ -0,0 +1,12 @@ +- hosts: 'puppet4' + gather_facts: false + tasks: + - git: + repo: https://git.openstack.org/openstack-infra/system-config + dest: /opt/system-config/production + force: yes + - shell: ./install_puppet.sh + args: + chdir: /opt/system-config/production + environment: + PUPPET_VERSION: 4 diff --git a/run_all.sh b/run_all.sh index 35ed289a94..fed06832cd 100755 --- a/run_all.sh +++ b/run_all.sh @@ -32,6 +32,8 @@ set +e # First, sync the puppet repos with all the machines timeout -k 2m 120m ansible-playbook -f 10 ${ANSIBLE_PLAYBOOKS}/update_puppet.yaml +# Update the puppet version +timeout -k 2m 120m ansible-playbook -f 10 ${ANSIBLE_PLAYBOOKS}/update_puppet_version.yaml # Run the git/gerrit/zuul sequence, since it's important that they all work together timeout -k 2m 120m ansible-playbook -f 10 ${ANSIBLE_PLAYBOOKS}/remote_puppet_git.yaml # Run AFS changes separately so we can make sure to only do one at a time