system-config/playbooks/update_puppet_version.yaml
Clark Boylan 2cfd85c792 Only install puppet 4 if not already installed
The reinstallation of puppet 4 on every ansible run was assumed to be a
non issue that we could disable after our complete conversion to puppet
4 (via removal of the explicit install playbook and reliance on our
launch tooling). However, Installation of this package actually causes
the removal of Gerrit rc.d files which the next puppet run reinstalls.

Avoid this back and forth and the unnecesasry additional package
installation by checking if the puppet 4 bin path exists prior to
reinstalling puppet 4.

Change-Id: I47821ae799412f6cb9693b617ae6e7e630590c15
2019-03-08 09:04:11 -08:00

21 lines
755 B
YAML

- hosts: 'puppet4'
name: "Puppet-version: install puppet-4 on puppet-4 hosts"
gather_facts: false
tasks:
- name: "Check if puppet 4 is already installed"
stat:
path: /opt/puppetlabs/puppet/bin/puppet
register: puppet4_bin_path
- name: "Get puppet installation script"
get_url:
url: http://git.openstack.org/cgit/openstack-infra/system-config/plain/install_puppet.sh
dest: /tmp/install_puppet.sh
mode: 0755
checksum: sha256:741b8cfdc039e817bd598511dd7203da16701f213775e639994e8bb278a68239
when: not puppet4_bin_path.stat.exists
- name: "Install puppet 4 if not already installed"
shell: /tmp/install_puppet.sh
environment:
PUPPET_VERSION: 4
when: not puppet4_bin_path.stat.exists