1、server端安裝html
1、安裝puppet yum源app
yum -y install http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm ide
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/puppetlabs.repo 測試
yum --enablerepo=puppetlabs-products,puppetlabs-deps -y install puppet-server spa
2、修改配置日誌
vim /etc/sysconfig/puppetmaster server
PUPPETMASTER_MANIFEST=/etc/puppet/manifests/site.pp #打開註釋xml
PUPPETMASTER_LOG=syslog #記錄日誌htm
touch /etc/puppet/manifests/site.pp #建立文件get
3、啓動服務、開機啓動
/etc/rc.d/init.d/puppetmaster start
chkconfig puppetmaster on
2、client安裝
1、安裝puppet yum 源
yum -y install http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/puppetlabs.repo
yum --enablerepo=puppetlabs-products,puppetlabs-deps -y install puppet
2、修改配置
vi /etc/sysconfig/puppet
PUPPET_SERVER=server.puppet.com #指定server端
PUPPET_LOG=/var/log/puppet/puppet.log #記錄日誌
3、啓動服務、開機啓動
/etc/rc.d/init.d/puppet start
chkconfig puppet on
3、註冊
Server 端:
puppet cert list # 查看註冊信息
puppet cert sign client1.puppet.com # 贊成註冊
4、測試
server端:
vim/etc/puppet/manifests/site.pp #編輯主機配置文件
group { 'testgroup':
ensure => present,
gid => 2000,
}
puppet apply /etc/puppet/manifests/site.pp #運行主配置文件
client端:
/etc/init.d/puppet reload #從新載入配置文件
grep testgroup /etc/group #查看是否有testgroup組