2024年11月CentOS 5.5如何安装和设置Puppet(2)

发布时间:

  ⑴c.建立puppet目录

  ⑵mkdir -p /var/lib/puppet/rrd

  ⑶chown puppet.puppet /var/lib/puppet/rrd

  ⑷/etc/init.d/puppet restart

  ⑸e.向server端发送请求命令

  ⑹puppetd --test --server server.tech.

  ⑺到这一步时,总是提示err: Could not retrieve catalog from remote server: certificate verify failed,后来在谷歌上找到解决方法。删除客户端/var/lib/puppet/ssl目录下的文件,再次执行正常

  ⑻f.server端用如下命令接受请求

  ⑼puppetca -s -a

  ⑽g.slave端再次发认证请求

  ⑾puppetd -test -server server.tech.

  ⑿四.puppet的简单应用

  ⒀在服务器端的/etc/puppet/manifests下建立site.pp文件,在文件/tmp/andrew.txt内容及权限推送过去

  ⒁node default {

  ⒂file {“/tmp/andrew.txt”:

  ⒃content =》 “hello,My Name is Jone!

  ⒄ensure =》 present,

  ⒅mode =》 ,

  ⒆owner =》 root,

  ⒇group =》 root,

  ⒈present,意思是会检查该文件是否存在,如果不存在,就新建该文件

  ⒉puppetd --test --server server.tech.

  ⒊info: Caching catalog for tech

  ⒋info: Applying configuration version ‘’

  ⒌--- /tmp/andrew.txt -- ::. +

  ⒍+++ /tmp/puppet-file.. -- ::. +

  ⒎ - +,

  ⒏-hello,My Name is Jone!

  ⒐No newline at end of file

  ⒑+hello,My Name is Jone!

  ⒒No newline at end of file

  ⒓info: FileBucket adding /tmp/andrew.txt as {md}dcafdffcde

  ⒔info: /Stage[main]//Node[default]/File[/tmp/andrew.txt]: Filebucketed /tmp/andrew.txt to puppet with sum dcafdffcde

  ⒕notice: /Stage[main]//Node[default]/File[/tmp/andrew.txt]/content: content changed ‘{md}dcafdffcde’ to ‘{md}dcfbafaaec’

  ⒖notice: Finished catalog run in . seconds

  ⒗这是已存在的,在原有基础上发生了改动。

  ⒘修改完site.pp文件,要执行/etc/init.d/puppetmaster重启服务。

  ⒙上面就是CentOS .安装配置Puppet的方法介绍了,本文详细介绍了Puppet的配置,Puppet在安装完后记得进行相关配置,避免不需要的麻烦。