首页 > 代码库 > puppet 笔记
puppet 笔记
1、创建模块目录结构
注意:在未指定modulepath搜索路径的情况下,会有默认搜索路径的,可通过以下方式查看到
[root@puppetmaster ~]# puppet master --genconfig >/etc/puppet/puppet.conf.out [root@puppetmaster ~]# cat /etc/puppet/puppet.conf.out | grep modulepath modulepath = /etc/puppet/modules:/usr/share/puppet/modules
[root@puppetmaster modules]# tree /etc/puppet/modules/test/ /etc/puppet/modules/test/ |-- files |-- manifests | └-- init.pp └--templates
2、测试test模块
[root@agent1 ~]# puppet agent --test #测试节点agent1 或者:#puppet agent --server puppetserverhost --test
3、认证
3.1 通过调试模式启动节点向Puppetmaster端发起认证
[root@agent1 ~]# puppet agent --test info: Creating a new SSL key for agent1 info: Caching certificate for ca info: Creating a new SSL certificate request for agent1 info: Certificate Request fingerprint (md5): 69:D2:86:E4:7F:00:E0:55:61:19:02:34:9E:9B:AF:F9 Exiting; no certificate found and waitforcert is disabled
3.2 服务器端确定认证
[root@puppetmaster ~]# puppet cert --list --all #查看认证情况 "agent1" (69:D2:86:E4:7F:00:E0:55:61:19:02:34:9E:9B:AF:F9) #未认证 + "puppetmaster" (C0:E3:6B:76:36:EC:92:93:4D:BF:F0:8F:77:00:91:C8) (alt names: "DNS:puppet", "DNS:puppet.kisspuppet.com", "DNS:puppetmaster.kisspuppet.com") [root@puppetmaster ~]# puppet cert --sign agent1 #注册agent1 notice: Signed certificate request for agent1 notice: Removing file Puppet::SSL::CertificateRequest agent1 at ‘/var/lib/puppet/ssl/ca/requests/agent1‘ [root@puppetmaster ~]# puppet cert --list --all #再次查看认证情况 + "agent1" (3E:46:4E:75:34:9A:5A:62:A6:3C:AE:BD:49:EE:C0:F5) #带"+"表示已认证 + "puppetmaster" (C0:E3:6B:76:36:EC:92:93:4D:BF:F0:8F:77:00:91:C8) [root@puppetmaster ~]# tree /var/lib/puppet/ssl/ #另外一种查看认证的方式 /var/lib/puppet/ssl/ ├── ca │ ├── ca_crl.pem │ ├── ca_crt.pem │ ├── ca_key.pem │ ├── ca_pub.pem │ ├── inventory.txt │ ├── private │ │ └── ca.pass │ ├── requests │ ├── serial │ └── signed │ ├── agent1.pem #已经注册成功 │ └── puppetmaster.pem ├── certificate_requests ├── certs │ ├── ca.pem │ └── puppetmaster.pem ├── crl.pem ├── private ├── private_keys │ └── puppetmaster.pem └── public_keys └── puppetmaster.pem 9 directories, 14 files
puppet 笔记
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。