读书人

ubuntu12.04装配puppet foreman

发布时间: 2012-09-27 11:11:17 作者: rapoo

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

已经安装完了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.安装其他软件包

$ 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

修改:login: false 改为true

foreman web 打开setting那个页面

重启foreman

#service foreman restart

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

进行密码添加及可。

官方的添加用户方法

http://theforeman.org/projects/foreman/wiki/LDAP_Authentication


还有很多不懂,这只是简单的搭建foreman的web服务更多的内容需要广大网友的挖掘。我还有几个问题没有解决

1.怎么使用report

2.agent节点如何在foreman显示出来

3.想用这个做openstack的监控是否可行?

希望广大网友能够指点指点

读书人网 >系统运维

热点推荐