Centos yum快速安裝puppet,yum源安裝puppet-server

一,配置yum源
cd /etc/yum.repos.d/

vim puppet.repo

[puppetlabs]name=Puppet Labs Packagesbaseurl=http://yum.puppetlabs.com/base/enabled=0gpgcheck=0

vim epel.repo

[epel]
name=Extra Packages for Enterprise Linux 5 -$basearch
#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=0

[epel-puppet]
name=epel puppet
baseurl=http://tmz.fedorapeople.org/repo/puppet/epel/5/$basearch/
enabled=0
gpgcheck=0

編碼 問題會有一個亂碼:mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch

vim ruby.repo

name=rubybaseurl=http://repo.premiumhelp.eu/ruby/gpgcheck=0enabled=0

puppet 2.6 需要 ruby 1.8.6 去運行 puppet-dashboard
升級ruby

# yum --enablerepo="ruby" update ruby如果你沒有安裝ruby 請使用:#yum -y install ruby

安裝 Puppet Server
Server端:On your puppetmaster server:

# yum --enablerepo=epel,epel-puppet install puppet-server

Client 端:On your puppet client

# yum --enablerepo="epel,epel-puppet" install puppet 

Server端配置site.pp
vim /etc/puppet/site.pp
node default {
file { “/tmp/temp1.txt”: content => “hello,first puppet manifest”; }
}

Client端配置hostsname
echo ‘client.example.com’ > /etc/hostname
hostname -F /etc/hostname
Client端運行:

puppetd --server master.example.com --test

上面的命令讓puppetd 從 master.example.com 去讀取puppet配置文件. 第一次連接,雙方會進行ssl證書的驗證,這是一個新的客戶端,在服務器端那裏還沒有被認證,因此需要在服務器端進行證書認證.
在服務器端的機器上執行下面的命令來認證客戶端的證書

Server端:

 puppetca -s client.example.com

然後再重新在客戶端執行

puppetd --server master.example.com --test 

配置完成。
參考:http://www.craigdunn.org/2010/08/part-1-installing-puppet-2-6-1-on-centos-with-yumrpm/


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章