文章目录

foreman 和 dashboard 一样。可以直观地查看puppet client 同步状态等。详细情况看官方的截图:
http://theforeman.org/projects/foreman/wiki/Screenshots

简单说下安装的顺序:
1. 安装puppet
2. 升级ruby 至 1.8.6
3. 安装相关的依赖 gem rake rails i18n
4. 创建库和用户并授权
5. 安装foreman
6. 修改database.yml
7. 创建foreman表
8. 配置 foreman.rb 文件,并放至puppet reports目录
9. 配置 puppet server client 配置文件
10. 启动

注意版本的要求。特别是ruby 只能是1.8 升级ruby 参考: http://bubbyroom.com/2011/01/centos-yum-update-ruby/

Ruby 1.9 is not supported yet. You have to use Ruby 1.8.x as stated above.
RubyGems 1.3.1 or higher is required
Rake 0.8.3 or higher is required
Rack 1.0.1 is required. If you don't have this exact version, database migration would fail.
I18n 0.4.2 is required for Redmine &gt;= 1.0.5 `</pre>
<pre>`rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm `</pre>
<pre>`yum install -y mysql mysql-devel mysql-server ruby ruby-devel ruby-irb ruby-mysql ruby-rdoc ruby-ri `</pre>
如果MYSQL 是源码包安装则:
<pre>`yum install -y ruby ruby-devel ruby-irb ruby-mysql ruby-rdoc ruby-ri `</pre>
安装rubygem 1.3.5
<pre>`http://production.cf.rubygems.org/rubygems/rubygems-1.3.5.tgz
tar xfz rubygems-1.3.5.tgz
cd rubygems-1.3.5
ruby setup.rb `</pre>
安装rails 和rack
<pre>`gem install rails -v=2.3.5 `</pre>
<pre>`gem install rack -v=1.0.1 `</pre>
<pre>`gem install -v=0.4.2 i18n `</pre>
下载foreman
地址:http://www.redmine.org/projects/redmine/wiki/Download

我喜欢用GIT下载:
有人问过我git 怎么安装:
<pre>`yum -y install git `</pre>
<pre>`git clone git://github.com/edavis10/redmine.git `</pre>
源码包地址:
<pre>`wget http://rubyforge.org/frs/download.php/73900/redmine-1.1.0.tar.gz `</pre>
下载 后解压。可以放在/usr/local/redmine 目录

Mysql 配置: 创建库和用户
<pre>`create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost'; `</pre>
mysql 5 以上
<pre>`grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password'; `</pre>
进去foreman配置 database.yml
config/database.yml
<pre>`production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: my_password `</pre>
建表:
<pre>`RAILS_ENV=production rake db:migrate `</pre>
启动:
<pre>`ruby script/server webrick -e production `</pre>
库备份:
<pre>`/usr/bin/mysqldump-u  -p
  |gzip &gt; /path/to/backup/db/redmine_`date +%y_%m_%d`.gz `</pre>
puppet master配置
<pre>`reports=log, foreman `</pre>
puppet client 配置
<pre>`report = true `</pre>

配置puppet 提交至foreman
# cp extras/puppet/foreman/files/foreman-report.rb /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb
# chmod 644 /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb
# vim /usr/lib/ruby/site_ruby/1.8/puppet/reports/foreman.rb
<pre>`# URL of your Foreman installation
$foreman_url="http://" + `hostname`.strip + ":8000"`</pre>

cron 清数据:
<pre>`rake reports:expire days=7 RAILS_ENV="production" `</pre>

###########################################################

foreman 可以采用yum 安装

配置源:
<pre>`cat > /etc/yum.repos.d/foreman.repo << EOF
[foreman]
name=Foreman Repo
baseurl=http://theforeman.org/repo
gpgcheck=0
enabled=1
EOF

yum install foreman
使用yum 安装后会产生/etc/init.d/foreman 配置文件也在/etc/foreman 目录 。其它的配置一样。

我在安装时遇到过一些错误,但主要是ruby 版本 和mysql 依赖 建议都用yum 来安装

参考: 还是国外的文档给力。
http://www.how2centos.com/installing-puppet-master-with-foreman-frontend-on-centos-5-5/
http://miao5.blogspot.com/2010/01/setup-puppetmaster-foreman.html
http://www.redmine.org/projects/redmine/wiki/RedmineInstall

文章目录