Installing foreman with puppet

Hi,

I'm an old hand at puppet, but new to foreman. I like what I see so far.

The kafo puppet-based installer is a brilliant approach. From my point of
view, it means you can use the same base modules to do interactive,
automated and puppetised installs. Sounds great.

Running the installer from the command line works like a charm.
Supplying answer files works well.
What I've yet to repeatably succeed with is installing and configuring via
puppet.

A one-time install is great, but it seems odd to have to manage the thing
that manages my configurations by hand.

I'm testing on CentOs6.5 boxes.
I'm configuring puppetlabs, epel and scl repos in advance.

I'm trying to do something like:
node 'foreman.local{
include profile::base
include profile::puppetmaster
include profile::foreman
}

class profile::puppet {
include ::puppet
}

class profile::puppetmaster{
include ::puppet
include ::r10k
}

class profile::foreman{
include ::foreman
include ::foreman_proxy
include ::puppet

Class['::foreman'] -> Class['::foreman_proxy'] ->Class['::puppet']
}

The few values I wish to tweak are in hiera:
puppet::server: true
foreman::db_type: mysql
etc…

The ordering in the profile::puppet class is taken from the ordering in
the /usr/share/foreman-installer/config/foreman-installer.yaml file. When
the puppet::server::passenger class is applied before the ruby193 passenger
package installed in foreman::install, the foreman's passenger config
breaks. Trying to preserve this order is hard, though, especially, as I
have calls to ::puppet in base classes that all clients get to manage their
puppet configuration.

I'm at the point of working around this by running foreman-installer in an
exec in a pre-main stage, only trying to manage the puppet configuration
and adding an apache::purge_configs: false to hiera for my puppet server,
to prevent it breaking foreman. I could live with this, but I've now got
problems with the foreman-proxy (something in my config has broken its
gemset).

Has anyone else taken a similar approach and have any tips to share, or is
this an unusual approach to take?

Ben Priestman

Also important thing to install, is foreman::puppetmaster.
Take look close at this file if you want uses "reports = foreman".
Sorry for the poor english.

··· Em terça-feira, 21 de outubro de 2014 08h52min32s UTC-3, Benjamin Priestman escreveu: > > Hi, > > I'm an old hand at puppet, but new to foreman. I like what I see so far. > > The kafo puppet-based installer is a brilliant approach. From my point of > view, it means you can use the same base modules to do interactive, > automated and puppetised installs. Sounds great. > > Running the installer from the command line works like a charm. > Supplying answer files works well. > What I've yet to repeatably succeed with is installing and configuring > via puppet. > > A one-time install is great, but it seems odd to have to manage the thing > that manages my configurations by hand. > > I'm testing on CentOs6.5 boxes. > I'm configuring puppetlabs, epel and scl repos in advance. > > I'm trying to do something like: > node 'foreman.local{ > include profile::base > include profile::puppetmaster > include profile::foreman > } > > class profile::puppet { > include ::puppet > } > > class profile::puppetmaster{ > include ::puppet > include ::r10k > } > > class profile::foreman{ > include ::foreman > include ::foreman_proxy > include ::puppet > > Class['::foreman'] -> Class['::foreman_proxy'] ->Class['::puppet'] > } > > > The few values I wish to tweak are in hiera: > puppet::server: true > foreman::db_type: mysql > etc... > > The ordering in the profile::puppet class is taken from the ordering in > the /usr/share/foreman-installer/config/foreman-installer.yaml file. When > the puppet::server::passenger class is applied before the ruby193 passenger > package installed in foreman::install, the foreman's passenger config > breaks. Trying to preserve this order is hard, though, especially, as I > have calls to ::puppet in base classes that all clients get to manage their > puppet configuration. > > I'm at the point of working around this by running foreman-installer in an > exec in a pre-main stage, only trying to manage the puppet configuration > and adding an apache::purge_configs: false to hiera for my puppet server, > to prevent it breaking foreman. I could live with this, but I've now got > problems with the foreman-proxy (something in my config has broken its > gemset). > > Has anyone else taken a similar approach and have any tips to share, or is > this an unusual approach to take? > > Ben Priestman > > > > > >

You probably won't be surprised but I realise that it was my config breaking foreman, not a problem with the foreman modules themselves. I thought I'd stripped out everything nonessential from my puppet manifests but I must have been wrong. Doing a puppet apply on just the foreman, foreman-proxy and puppet modules from the puppet forge (with all their dependencies present) worked fine. Building up from there, I've now got a working configuration. Still not sure what was wrong, but I think I was causing the puppet class to precede the foreman class and thus breaking passenger.

For the record, allowing the foreman modules to manage their own repos on centos 6.5 doesn't work. I got good key failures on, among other thongs, the foreman-proxy package. Defining my own repos to match what gets set up when you pull down the foreman-release package works fine.

You may not be looking for something like this, but I'll mention it anyway for the few that may be interested.

I wrote a module awhile back called puppet_stack, which installs the Foreman from source using git (it can also install and configure smart-proxy and a Puppet master). It expects you'll use an RVM Ruby installation, but I find this is better as you can apply Ruby patches more readily than with an OS supplied version.

https://github.com/Ginja/puppet_stack

-Riley

··· ----- Original Message ----- > From: "Benjamin Priestman" > To: foreman-users@googlegroups.com > Sent: Thursday, 23 October, 2014 12:46:26 > Subject: [foreman-users] Installing foreman with puppet > > You probably won't be surprised but I realise that it was my config breaking > foreman, not a problem with the foreman modules themselves. I thought I'd > stripped out everything nonessential from my puppet manifests but I must > have been wrong. Doing a puppet apply on just the foreman, foreman-proxy and > puppet modules from the puppet forge (with all their dependencies present) > worked fine. Building up from there, I've now got a working configuration. > Still not sure what was wrong, but I think I was causing the puppet class to > precede the foreman class and thus breaking passenger. > > For the record, allowing the foreman modules to manage their own repos on > centos 6.5 doesn't work. I got good key failures on, among other thongs, > the foreman-proxy package. Defining my own repos to match what gets set up > when you pull down the foreman-release package works fine. > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout. >