Set up foreman and foreman-proxy in CentOS


In my lab, I use 32 bits CentOS 6.5. So I need to use foreman 1.1 which I guess is the last version that supports 32 bits.

1) Check wether the EPEL repostitory has been added by running ‘yum repolist’. If it has not been installed, it can be found at http://dl.fedoraproject.org/pub/epel/6

2) Install the foreman 1.1 repository file, then change the word ‘latest’ to ‘1.1’ in /etc/yum.repos.d/foreman.repo

yum -y install http://yum.theforeman.org/releases/1.1/el6/i386/foreman-release.rpm

3) Install foreman and foreman-sqlite (sqlite is the default database, but you can choose other database, e.g mysql)

yum -y install forman foreman-sqlite

4) Modify the /etc/foreman/database.yml and settings.yml if needed. As I use sqlite, I just leave it as it is.

5) Set up the database

cd /usr/share/foreman
RAILS_ENV=production rake db:migrate

6) Start the foreman service, the go to http://your_foreman_host:3000 to confirm it is up.

service foreman start
chkconfig foreman on

********************************************************************************************************

I am going to use foreman as the puppet ENC (external node classifier) to manager puppet host, hostgroup, class, environment… So I need to install the foreman smart proxy which enables the puppet to talk to foreman. I install foreman-proxy and puppet master on the same server.

1) Repeate the above step 1) and 2).

2) Install foreman-proxy

yum -y install foreman-proxy

3) Modify the /etc/foreman-proxy/settings.yml to meet you need.

I enabled PuppetCA and Puppet proxy in my settings.

If you need to enable the SSL settings. You have to

– Add foreman-proxy into the puppet group, so it can have access to the private key

gpasswd -a foreman-proxy puppet

– Add the following two lines into [main] section in the /etc/puppet/puppet.conf

privatekeydir = $ssldir/private_keys { group = service }
hostprivkey = $privatekeydir/$certname.pem { mode = 640 }

4) Start the foreman-proxy service

service foreman-proxy start
chkconfig foreman-proxy on

Advertisement

One thought on “Set up foreman and foreman-proxy in CentOS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s