Foreman是一个puppet的全生命周期的管理工具,有点类似于puppet的dashboard前端。本文主要介绍如何在ubuntu 12.04上安装配置foreman.
1.为ubuntu12.04添加foreman的源
#在文件/etc/apt/sources.list的末尾添加如下的地址 deb http://deb.theforeman.org/ precise 1.3 #添加该源对应的key #其中-O-表示将下载的文件输出到标准终端上, wget -q http://deb.theforeman.org/foreman.asc -O- | apt-key add - #更新 apt-get update
至此,foreman的源已经准备完毕。
2.安装foreman
#采用sqllite作为foreman的存储后端 apt-get install foreman foreman-sqlite3
3.配置foreman
#数据库采用默认的/etc/foreman/database.yml #编辑/etc/foreman/settings.yaml #your default puppet server - can be overridden in the host level #if none specified, plain "puppet" will be used. #:puppet_server: 127.0.0.1 :unattended: true :puppetconfdir: /etc/puppet/puppet.conf :login: false :require_ssl: false
#下载https://raw.github.com/theforeman/puppet-foreman/master/templates/foreman-report_v2.rb.erb #重命名该文件为/usr/lib/ruby/1.8/puppet/reports/foreman.rb #编辑foreman.rb #更改foreman_url为foreman的安装地址,如 #$foreman_url='http://127.0.0.1:3000'
修改puppetmaster的配置文件puppet.conf,添加:
#在main段中添加 reports=log, foreman
修改puppetagent的配置文件puppet.conf,添加
report = true
4.初始化foreman的数据库
#进入到foreman的安装目录 cd /usr/share/foreman RAILS_ENV=production rake db:migrate
5.启动foreman
service foreman restart
浏览器访问http://127.0.0.1:3000