Project

General

Profile

Upgrading from Puppet 3 to 4 » History » Version 2

Dominic Cleal, 05/26/2016 08:13 AM
start of config files

1 1 Dominic Cleal
h1. Upgrading from Puppet 3 to 4
2
3
+_This wiki page is a work in progress for the release of Foreman 1.12 and is currently incomplete._+
4
5
This wiki page is a rough guide on how to upgrade from Puppet 3 to Puppet 4 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.
6
7
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. Most of the work is changing the Puppet installation and then updating paths and configs in Foreman to suit.
8
9
If you're unfamiliar with how Puppet works, then you should consider setting up a new installation and migrating hosts instead.
10
11
h2. Planning
12
13
Ensure you are running Foreman 1.12 or higher, previous versions are not compatible with Puppet 4, while 1.12 is compatible with both 3 and 4, so carry out that upgrade first. See "Upgrading to Foreman 1.12":http://theforeman.org/manuals/1.12/index.html#3.6Upgrade for more information.
14
15
*Start with "Puppet 3.x to 4.x: Get upgrade-ready":https://docs.puppet.com/puppet/latest/reference/upgrade_major_pre.html* - it has many excellent points, including:
16
17
* As with any upgrade, the smaller the step, the easier it will be. Ensure you've already upgraded to the latest 3.x release and fixed any deprecations from the release notes before moving to 4. This will save time later.
18
* Ensure your Puppet modules are going to be compatible with Puppet 4's new ("future") parser
19
* Plan to upgrade your masters before your agents, because the master can serve older agents, but not the other way around.
20
* Back up everything, especially SSL keys and certificates.
21 2 Dominic Cleal
* Ensure you have enough RAM, Puppet Server defaults to requiring at _least_ 2GB
22 1 Dominic Cleal
23
The guide will assume you're using regular 'puppet' packages either from your OS (or EPEL) or from Puppet Labs repositories. Puppet 4 packages are All-In-One (AIO) packages and work quite differently, introducing lots of new paths for config files and binaries. More information on these at:
24
25
* "Welcome to Puppet Collections":https://puppet.com/blog/welcome-to-puppet-collections
26
* "About Puppet collections and packages":https://docs.puppet.com/puppet/latest/reference/puppet_collections.html
27 2 Dominic Cleal
28
h2. Upgrading
29
30
h3. Install new PC1 packages
31
32
# Configure the new PC1 repositories with the "Using Puppet Collections":https://docs.puppet.com/guides/puppetlabs_package_repositories.html#using-puppet-collections instructions.
33
# On EL, run @yum remove puppet-server@ to prevent later conflicts.
34
# Install the @puppetserver@ package, which should replace @facter@, @puppet@ and @puppet-server@ with @puppetserver@ and @puppet-agent@
35
36
h3. Move configs and files to new structure
37
38
This section is based on "Puppet 3.x to 4.x: Upgrade Puppet Server":https://docs.puppet.com/puppet/latest/reference/upgrade_major_server.html which goes into far more detail.
39
40
# Move or copy any environments from @/etc/puppet/environments@ to @/etc/puppetlabs/code/environments@
41
# Move or copy all SSL keys and certificates from @/var/lib/puppet/ssl@ to @/etc/puppetlabs/puppet/ssl@
42
# Remove the Puppet master VirtualHost from Apache at @/etc/httpd/conf.d/25-puppet.conf@ (EL) or @a2dissite 25-puppet@ (Debian/Ubuntu)
43
# Remove 8140 from the Apache ports in @/etc/httpd/conf/ports.conf@ or @/etc/apache2/ports.conf@
44
# Update SSL paths in @/etc/httpd/conf.d/05-foreman-ssl.conf@ or @/etc/apache2/sites-available/05-foreman-ssl.conf@, changing @/var/lib/puppet/ssl@ to @/etc/puppetlabs/puppet/ssl@
45
# Restart httpd/apache2 to free up the port
46
47
Config and ENC files:
48
49
# @mv /etc/puppet/autosign.conf /etc/puppetlabs/puppet/@
50
# @mv /etc/puppet/foreman.yaml /etc/puppetlabs/puppet/@
51
# @mv /etc/puppet/node.rb /etc/puppetlabs/puppet/@
52
# @cp /etc/puppet/puppet.conf /etc/puppetlabs/puppet/puppet.conf@ and change:
53
#* in the 'main' section:
54
#*# @vardir = /opt/puppetlabs/puppet/cache@
55
#*# @logdir = /var/log/puppetlabs/puppet@
56
#*# @rundir = /var/run/puppetlabs@
57
#*# @ssldir = /etc/puppetlabs/puppet/ssl@
58
#*# @environmentpath = /etc/puppetlabs/code@
59
#*# @basemodulepath = /etc/puppetlabs/code/environments/common:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules@
60
#* in the 'master' section:
61
#*# @autosign = /etc/puppetlabs/puppet/autosign.conf { mode = 0644 }@
62
#*# @external_nodes = /etc/puppetlabs/puppet/node.rb@
63
#*# @ssldir = /etc/puppetlabs/puppet/ssl@