Add playbook to upgrade puppet

Add a playbook to rerun install_puppet.sh with PUPPET_VERSION=4. Also
make the install_modules.sh script smarter about figuring out the puppet
version so that the update_puppet.yaml playbook, which updates the
puppet config and puppet modules but not the puppet package, does not
need to be changed.

When we're ready to start upgrading nodes, we'll add them to the puppet4
group in `modules/openstack_project/files/puppetmaster/groups.txt`.

Change-Id: Ic41d277b2d70e7c25669e0c07e668fb9479b8abf
This commit is contained in:
Colleen Murphy 2018-06-04 23:55:11 +02:00
parent a40867b8bf
commit d4d0ae0e40
3 changed files with 18 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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