1、puppei使用ruby语言,需要安装ruby包
yum install ruby ruby-libs ruby-rdoc
2、主节点和客户端对时
ntpdate cn.ntp.org.cn
3、设置主节点和客户端/etc/hosts文件
192.168.2.108 CentOS-6.5-2-108
192.168.2.109 CentOS-6.5-2-109
4、主节点安装
rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-el-6.noarch.rpm
yum install puppetserver
5、客户端安装
rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-el-6.noarch.rpm
yum install puppet-agent
6、主节点启动服务
/etc/init.d/puppetserver start
7、客户端启动服务
/etc/init.d/puppet start
8、客户端向服务端注册
puppet agent --no-daemonize --onetime --verbose --debug --server=CentOS-6.5-2-108
9、主节点同意客户端的注册请求
#查看所有的请求
puppet cert list --all
"centos-6.5-2-109" (SHA256) 8A:16:1A:64:32:F7:FF:29:4F:B0:8E:C3:F5:4E:BD:6C:8C:AC:F6:38:84:E8:2A:3F:16:8D:AA:E2:E2:1C:51:E9
#同意注册
puppet cert --sign centos-6.5-2-109
10、测试是发送是否正常
老版本
vi /etc/puppet/manifests/site.pp
node default {
file {
"/tmp/helloworld.txt": content => "hello, world";
}
}
新版本
vi /etc/puppetlabs/code/environments/production/manifests/site.pp
node default {
file {
"/tmp/helloworld.txt": content => "hello, world\n";
}
}
11、客户端测试在/tmp下会有一个helloworld.txt文件
puppet agent --test --server=CentOS-6.5-2-108
yum install ruby ruby-libs ruby-rdoc
2、主节点和客户端对时
ntpdate cn.ntp.org.cn
3、设置主节点和客户端/etc/hosts文件
192.168.2.108 CentOS-6.5-2-108
192.168.2.109 CentOS-6.5-2-109
4、主节点安装
rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-el-6.noarch.rpm
yum install puppetserver
5、客户端安装
rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-el-6.noarch.rpm
yum install puppet-agent
6、主节点启动服务
/etc/init.d/puppetserver start
7、客户端启动服务
/etc/init.d/puppet start
8、客户端向服务端注册
puppet agent --no-daemonize --onetime --verbose --debug --server=CentOS-6.5-2-108
9、主节点同意客户端的注册请求
#查看所有的请求
puppet cert list --all
"centos-6.5-2-109" (SHA256) 8A:16:1A:64:32:F7:FF:29:4F:B0:8E:C3:F5:4E:BD:6C:8C:AC:F6:38:84:E8:2A:3F:16:8D:AA:E2:E2:1C:51:E9
#同意注册
puppet cert --sign centos-6.5-2-109
10、测试是发送是否正常
老版本
vi /etc/puppet/manifests/site.pp
node default {
file {
"/tmp/helloworld.txt": content => "hello, world";
}
}
新版本
vi /etc/puppetlabs/code/environments/production/manifests/site.pp
node default {
file {
"/tmp/helloworld.txt": content => "hello, world\n";
}
}
11、客户端测试在/tmp下会有一个helloworld.txt文件
puppet agent --test --server=CentOS-6.5-2-108