Ubuntu 12.04安装Puppet Foreman

aptitude -y install puppet augeas-tools

aptitude -y install puppetmaster sqlite3 libsqlite3-ruby libactiverecord-ruby git rake

已经安装完了puppetmaster端

1.安装mysql-foreman

 etc/apt/sources.list file:

内容如下deb stable main
You then need to download the Foreman GPG key, add it to APT and update like so:
$ wget
$ 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.安装其他软件包

$ 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
内容如下:

production:
  database: foreman
  username: foreman
  password: password
  encoding: utf8
  adapter: mysql

5.初始化数据库

在/usr/share/foreman 执行

sudo RAILS_ENV=production rake db:migrate


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

#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

修改:puppet_server: 修改为你的puppetmaster

修改:login: false 改为true

foreman web 打开setting那个页面

重启foreman

#service foreman restart

刷新foreman的web界面,右上角有一个account,添加一个新用户

进行密码添加及可。

官方的添加用户方法

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/686efb1dbf2be39c6f9066fe1ee0faa5.html