|
1 puppet介绍:
- puppet基于ruby语言开发
- 支持已C/S模式或独立模式运行
- 支持所有的UNIX和LINUX系统配置
- 适用业务系统的整个生命周期
- 支持节点方式管理若干服务器群组
- 支持对windows操作系统管理(功能有限)
2 puppet工作架构
3 更新server和client的配置文件
- 192.168.10.180 master.notry.com #个人虚拟机环境
- 192.168.10.122 client1.notry.com
- 192.168.10.157 clinet2.notry.com
4 puppet server的安装:
安装EPEL
- sudo rpm –Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
安装puppet服务端
- sudo yum –y install puppet-server
启动puppet服务
- sudo /etc/init.d/puppetmaster start
5 Puppet client的安装
安装EPEL
- sudo rpm –Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
安装puppet客户端
- sudo yum -y install puppet
提交证书申请
- sudo puppet --server master.notry.com --test
6 Puppet证书管理
服务器端可用的puppetca 管理证书
- puppetca –list #查看到申请证书的客户端主机名
- puppetca –s #主机名,为特定的主机颁发证书
- puppetca –s and –a #为所有的主机颁发证书
- puppetca –l and –a #列出所有主机,+号代表已经领证的机器
7 认证client1
- [notry@master opt]$puppetca --list
- client1.notry.com
- [notry@master opt]$puppetca --list -a
Puppet Server端目录结构
- [notry@master puppet]$ pwd
- /etc/puppet
- auth.conf client访问puppet server的ACL配置文件
- fileserver.conf puppet server作为文件服务器的ACL配 置文件
- manifests Puppet脚本主文件目录,至少需要包含
- site.pp入口脚本文件
- modules Puppet模块目录,存放Puppet脚本的功 能模块
- namespaceauth.conf 命名空间ACL配置文件
- puppet.conf Puppet服务器端配置文件
8 简单的测试
server端操作:
- vim /etc/puppet/manifests/site.pp
- class text {
- file {"/opt/a.txt":
- ensure=>"present",
- content=>"Hello Puppet!\n",
- owner=>"root",
- group=>"root",
- mode=>644
- }
- }
- node client1 {
- include text
client1端操作:
- puppetd --server master.notry.com --test
观察是否在client1的/opt/下生成内容为Hello Puppet!的a.txt文件。
|
|
|