July 10, 2017

Call For Testers: Puppet 5 ports on FreeBSD

Categories: FreeBSD, Sysadmin.

Lately, I have been working on bringing Pupept 5 to FreeBSD. For now, this effort is avialable through a set of ports on GitHub:
https://github.com/smortex/puppet5

The following article describes how I used this ports to update to Puppet 5. If you try to update, please tell me if you succeeded or failed, and how to improve this!

Upgrade PostgreSQL to 9.6

Since I use PuppetDB, and Puppet 5.0 requires PuppetDB 5.0, and PuppetDB 5.0 requires PostgreSQL 9.6+, the first step was to update my PostgreSQL cluster (I was running PostgreSQL 9.4).

In my case, it's worth to know that postgresql96-client and postgresql94-contrib conflict. So I had to remove postgresql94-contrib before upgrading:

sudo -u pgsql pg_dumpall -f full-db-dump.sql
/usr/local/etc/rc.d/postgresql stop
echo "DEFAULT_VERSIONS+=      pgsql=9.6" >> /etc/make.conf
pkg delete -f postgresql94-contrib
portmaster -o databases/postgresql94-client databases/postgresql96-client
portmaster -o databases/postgresql94-server databases/postgresql96-server
portmaster databases/postgresql96-contrib

Now that PostgreSQL 9.6 is installed, the databases can be restored. PostgreSQL data directory was moved from /usr/local/pgsql/data to /var/db/postgres/data96, so you may have to copy your local configuration there. Morevover, there is now a postgres user which replaces the previous pgsql user:

/usr/local/etc/rc.d/postgresql initdb
# Adjust server configuration in ~postgres/data96
/usr/local/etc/rc.d/postgresql start
sudo -u postgres psql -f full-db-dump.sql

So, we have no all requirements ready for PuppetDB.

Upgrade PuppetDB and Puppet

We will start by stopping PuppetDB, which will make the Puppet Master unhappy, so we also want to stop that Puppet Master. In my case, this service is provided through Apache 2.4 so I will stop this service too:

service puppet stop
service apache24 stop
service puppetdb stop

Basically, for each foo/bar4 port, we want to install foo/bar5:

sudo portmaster -o sysutils/puppet5 sysutils/puppet4
sudo portmaster -o databases/puppetdb5 databases/puppetdb4
sudo portmaster -o databases/puppetdb-terminus5 databases/puppetdb-terminus4

Last step constist in restarting all services:

service puppetdb start
service apache24 start
service puppet start

Switching to C++ Facter

Facter used to be a Ruby program, but was rewritten in C++. For now, the default is still to use Facter 2.x (the Ruby one), but I have submitted a bunch of pull-requests to make it possible to use Facter 3.x (the C++ one) as a drop-in replacement to Facter 2.x.

You are therefore encouraged to switch to the C++ version of facter and report joy and depression:

sudo portmaster -o sysutils/facter sysutils/rubygem-facter

Thank you for your valuable feedback!

No Comments Yet

Comments RSS feed | Leave a Reply…

top