运维自动化之puppet-dashboard(7)

时间:2021-01-03 06:56:18

安装配置:


yum -y install rubygem-rake ruby-mysql


yum localinstall puppet-dashboard


gem install rake


mysql授权


create database dashboard character set utf8;

grant all on dashboard.* TO 'dashboard'@'%' identified by 'dbdpass';


flush privileges;



修改 dashboard 配置文件

vim /usr/share/puppet-dashboard/config/database.yml


production:

 host: 192.168.1.115

 database: dashboard

 username: dashboard

 password: dbdpass

 encoding: utf8

 adapter: mysql



为dashboard依赖的数据库导入所需要的表

cd /usr/share/puppet-dashboard

rake gems:refresh_specs

rake RAILS_ENV=production db:migrate



测试服务器是否能正常工作:

/usr/share/puppet-dashboard/script/server -e production

默认其监听3000/tcp端口,可以通过此端口访问相应的服务了。


service puppet-dashboard start



配置puppet服务器端和客户端


服务器端配置 puppet.conf


[master]

reports = store, http

reporturl = http://dashboard.example.com:3000/reports/upload


完成后重启puppetmaster



agent端 puppet.conf


[agent]

report = true

完成后重启puppet服务