Project

General

Profile

Upgrading from Puppet 4 to 5 » History » Version 2

Anonymous, 07/17/2017 06:42 AM

1 1 Anonymous
h1. Upgrading from Puppet 4 to 5
2
3
_This wiki page was written at the release of Foreman 1.16 and should be used +at your own risk+._
4
5
{{toc}}
6
7
This wiki page is a rough guide on how to upgrade from Puppet 4 to Puppet 5 when using Foreman. It doesn't replace Puppet's own documentation - you need to take both into account, and it's not for the faint-hearted.
8
9
Remember, Puppet is a separate piece of software to Foreman. Foreman integrates with Puppet in only a few places (e.g. reports, ENC and smart proxy class imports) but the Foreman installer may have set it up for you initially.
10
11
If you're unfamiliar with how Puppet works, then you should consider setting up a new installation and migrating hosts instead.
12
13
h2. Planning
14
15
Ensure you are running Foreman 1.16 or higher, previous versions are not compatible with Puppet 5. See "Upgrading to Foreman 1.16":http://theforeman.org/manuals/1.16/index.html#3.6Upgrade for more information.
16
17
* As with any upgrade, the smaller the step, the easier it will be. Ensure you've already upgraded to the latest 4.x release and fixed any deprecations from the release notes before moving to 5. This will save time later.
18
* Ensure your Puppet modules are going to be compatible with Puppet 5
19 2 Anonymous
* If you're using PuppetDB, you need to upgrade its PostgreSQL database to 9.6.
20 1 Anonymous
* Plan to upgrade your masters before your agents, because the master can serve older agents, but not the other way around.
21
* Back up everything, especially SSL keys and certificates.
22
23 2 Anonymous
h2. Doing
24 1 Anonymous
25 2 Anonymous
h3. Make sure, everything is foreman-installer managed.
26 1 Anonymous
27 2 Anonymous
This means, if you're running @foreman-installer -n@, no changes should be visible in @/var/log/foreman-installer/foreman.log@. Otherwise, change your installer configuration to match your desired configuration.
28 1 Anonymous
29 2 Anonymous
h3. Change Repositories
30 1 Anonymous
31 2 Anonymous
Configure the new Puppet 5 repositories with the "Using Puppet 5 Platform":https://docs.puppet.com/puppet/latest/puppet_platform.html#using-puppet-5-platform instructions.
32 1 Anonymous
33 2 Anonymous
Optionally, remove the respective PC1 package (@puppetlabs-release-pc1@ or similar).
34 1 Anonymous
35 2 Anonymous
h3. Upgrade Puppet Packages.
36
37
Run @yum update@ or @apt-get dist-upgrade@. If you want to upgrade only Puppet packages, pull these out from the list of package to get updated from these commands.
38
39
Be sure to replace @/etc/puppetlabs/puppetserver/conf.d/web-routes.conf@ with the version that's coming with the Puppetserver 5 package.
40
41
h3. Prepare And Run The Installer
42
43
Reinstall the @puppet-agent-oauth@ package, by running @yum reinstall puppet-agent-oauth@ or @apt-get install --reinstall puppet-agent-oauth@.
44
45
Run the installer, resetting parameters, which changed for Puppetserver 5:
46
@foreman-installer --reset-puppet-server-jvm-extra-args --reset-puppet-server-puppetserver-version --reset-puppet-server-puppetserver-metrics --reset-puppet-server-puppetserver-experimental@
47
48
h2. Done
49
50
You should be good.