2011年(14)
分类: LINUX
2011-04-09 14:05:34
呵呵。。今天下班后就睡了。。。12点醒了。。没有了淫荡的睡意。。
朋友公司开一个party(免费的)准备过去看看 刚刚起来配置一哈puppet
感觉这个不错。。
debian的配置方法
master是服务端
back是客户端
master: # apt-get install libopenssl-ruby rdoc irb1.8 libopenssl-ruby1.8 libreadline-ruby1.8 libruby1.8 rdoc1.8 ruby1.8
master:#apt-get -t feisty install facter puppet puppetmaster
back:#apt-get install libopenssl-ruby rdoc irb1.8 libopenssl-ruby1.8 libreadline-ruby1.8 libruby1.8 rdoc1.8 ruby1.8
back:#apt-get -t feisty install facter puppet
所有的软件安装好后下面就是配置文件了。。
master:# vim /etc/puppet/manifests/site.pp //建立一个测试文件玩玩那
#create test file
class test_class {
file { “/tmp/test”:
ensure => present,
mode => 644,
owner =>root,
group =>root
}
}
#send back run which file
node back {
include test_class
}
}
启动你puppet服务吧
master:#/etc/init.d/puppetmaster start
客户机了
back:#vim /etc/puppet/puppetd.conf
[puppetd]
server = master.web.com \\我是修改了/etc/hosts文件后就能才做的web.com测试
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
pluginsync=true
[puppetmasterd]
templatedir=/var/lib/puppet/templatesa
保存退出
重要的时候到来了。。证书来了
在客户机上做:
back:# puppetd –-server master.web.com –w 60 –-test
err: No certificate; running with reduced functionality.
info: Creating a new certificate request for pclient.example.con
info: Requesting certificate
warning: peer certificate won’t be verified in this SSL session
notice: Did not receive certificate
在服务器上看看你的证书列表
master:#puppetca –list
back.web.com
然后签名证书吧。。
master:#puppetca –sign back.web.com
你的客户机能看到如下:
info: Requesting certificate
warning: peer certificate won’t be verified in this SSL session
notice: Ignoring –listen on onetime run
info: Caching configuration at /etc/puppet/localconfig.yaml
notice: Starting configuration run
notice: //pclient/test_class/File[/tmp/testfile]/ensure: created
info: Creating state file /var/lib/puppet/state/state.yaml
notice: Finished configuration run in 0.11 seconds
一切都是浮云。
back:#puppetd –server master.web.com -w 60 –test
去看看你的测试文件是不是被创建了。
back:#ls -l /tmp \\看看权限吧。。。
再去修改你的权限 看看是不是会变。。就是在服务端的site.pp 文件