- #for install puppet client
- #by linyd 2013/1/30
- #puppet version 2.7.3
- SERVER_HOST_NAME="" #puppet server hostname
- CLIENT_HOST_NAME="" #puppet client hostname
- SERVER_IP="" #puppet server ip
- CLIENT_IP="" #puppet client ip
- path=`pwd`
- ######## ntpdate time #########
- /sbin/ntpdate 210.72.145.44
- echo "$SERVER_HOST_NAME $SERVER_IP" > /etc/hosts
- echo "$CLIENT_HOST_NAME $CLIENT_IP" > /etc/hosts
- ### start install
- cd $path
- yum -y install ruby ruby-devel ruby-rdoc ruby-irb
- tar -zxvf facter-1.6.5.tar.gz
- /usr/bin/ruby install.rb
- cd ..
- tar -zxvf puppet-2.7.20.tar.gz
- cd puppet-2.7.20
- /usr/bin/ruby install.rb
- cp conf/auth.conf /etc/puppet
- cp conf/namespaceauth.conf /etc/puppet
- cp conf/redhat/puppet.conf /etc/puppet
- cp conf/redhat/client.init /etc/init.d/puppet
- chmod +x /etc/init.d/puppet
- sed -i "s#localconfig .*#&\n listen = true\n server = $SERVER_HOST_NAME#" /etc/puppet/puppet.conf
- #echo " listen = true" >> /etc/puppet/puppet.conf
- #echo " server = $SERVER_HOST_NAME" >> /etc/puppet/puppet.conf
- sed -i "s/allow.*/allow $SERVER_HOST_NAME/" /etc/puppet/namespaceauth.conf
- sed -i "/path \//i# to show the default policy which is deny everything else\npath \/run\nmethod save\nallow $SERVER_HOST_NAME\n" /etc/puppet/auth.conf
- /usr/sbin/puppetmasterd --mkusers
- /etc/init.d/puppet start
- echo "############################"
- echo " puppet status "
- /usr/sbin/lsof -i:8139
- /usr/sbin/lsof -i:8140
- echo "----------------------------"
专注于为中小企业提供成都做网站、成都网站设计服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业阜康免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了近千家企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。