ubuntu12.04安装puppet foreman
前提:
aptitude -y install puppet augeas-tools
aptitude -y install puppetmaster sqlite3 libsqlite3-ruby
libactiverecord-ruby git rakegem install puppetlabs_spec_helper
www.zhishiwu.com
已经安装完了puppetmaster端
1.安装mysql-foreman
etc/apt/sources.list file:
内容如下deb http://deb.theforeman.org/ stable main
You then need to download the Foreman GPG key, add it to APT and update like so:
$ wget http://deb.theforeman.org/foreman.asc
$ sudo apt-key add foreman.asc
$ sudo apt-get update
2. apt-get install foreman-mysql (注意有可能安装不成功,把/etc/resolve.conf文件 添加nameserver 8.8.8.8)
2.安装其他软件包
www.zhishiwu.com
$ sudo apt-get install -y libmysql-ruby libmysqlclient-dev mysql-server
3.创建数据库
sudo mysql -uroot -p
mysql> CREATE DATABASE foreman CHARACTER SET utf8;
mysql > CREATE USER 'foreman'@'localhost'IDENTIFIED BY 'password';
mysql > GRANT ALL PRIVILEGES ON foreman.* TO 'foreman'@'localhost';
mysql> flush privileges;
4.编辑/usr/share/foreman/config/database.yml
内容如下:
www.zhishiwu.com
production:
database: foreman
username: foreman
password: password
encoding: utf8
adapter: mysql
5.初始化数据库
在/usr/share/foreman 执行
sudo RAILS_ENV=production rake db:migrate
www.zhishiwu.com
6
复制https://raw.github.com/theforeman/puppet-foreman/master/templates/foreman-report.rb.erb 到 /usr/lib/ruby/1.8/puppet/reports/foreman.rb
修改
$foreman_url='http://127.0.0.1:3000'
7.修改/etc/default/foreman
修改内容 START=yes
修改/usr/share/foreman/config/setting.yaml
把:puppet_server: 写入你master端的主机名称。
8.启动foreman
www.zhishiwu.com
#service foreman start
此时打开foremanweb会出现
Unable to find internal system admin account - Recreating . . .
解决办法
在/usr/share/foreman执行
# RAILS_ENV=production rake permissions:reset
添加第一个用户
/usr/share/foreman/config/setting.yaml
修改:login: false 改为true
foreman web 打开setting那个页面
重启foreman
#service foreman restart
刷新foreman的web界面,右上角有一个account,添加一个新用户
www.zhishiwu.com
进行密码添加及可。
官方的添加用户方法
http://theforeman.org/projects/foreman/wiki/LDAP_Authentication