Installing Foreman on CentOS 6

by actionjack on June 6, 2012 | Leave your comment

Currently the easiest way to install foreman is by using the foreman-installer which is basically a set of pre-packaged puppet modules

yum install git mysql-server
cd /tmp
git clone --recursive git://github.com/theforeman/foreman-installer.git
echo include foreman, foreman_proxy | puppet apply --modulepath /tmp/foreman-installer
chkconfig mysqld on
service mysqld start
/usr/bin/mysql_secure_installation

Create a my.cnf for auto logon of mysql:

vi ~/.my.cnf

And enter the following content:

[mysql]
user = root
password = password

Lock down the access to the file:

chmod 0600 ~/.my.cnf

Create the foreman development and live databases:

mysql -e "create database foreman character set utf8;"
mysql -e "create user 'superforeman'@'localhost' identified by 'mysupersecretpassword';"
mysql -e "grant all privileges on foreman.* to 'superforeman'@'localhost';"
mysql -e "create database foreman_development character set utf8;"
mysql -e "grant all privileges on foreman_development.* to 'superforeman'@'localhost';"

Configure foreman to use the mysql database:

vi /etc/foreman/database.yml
development:
adapter: mysql
database: foreman_development
host: localhost
username: superforeman
password: mysupersecretpassword
encoding: utf8

test:
adapter: mysql
database: foreman_test
host: localhost
username: superforeman
password: mysupersecretpassword
encoding: utf8

production:
adapter: mysql
database: foreman
host: localhost
username: superforeman
password: mysupersecretpassword
encoding: utf8

Replace the existing yum repo with an updated one to get the latest RPM’s:

wget -O foreman.repo http://people.redhat.com/jmontleo/foreman/el6/foreman.repo

Run yum update to update foreman:

yum update

Install mysql and foreman support components:

yum install rubygem-mysql foreman-mysql foreman-console

And voila

Leave your comment

Required.

Required. Not published.

If you have one.