浪人 发表于 2018-8-3 07:05:14

自动化运维之 - puppet第一个资源 -- 文件管理

  

  在服务器端建立manifest
  


[*]# vim /etc/puppet/manifests/site.ppnode default { file { "/tmp/temp.txt": content =>"Hello the world!";} }
  

  在客户端
  


[*]# puppetd --server server.example.com --test
[*]
[*]info: Caching catalog for web01.example.com
[*]
[*]info: Applying configuration version '1367383507'
[*]
[*]notice: /Stage//Node/File/ensure: defined content as '{md5}201e171ab2e5740023a4815fe7abf7f7'
[*]
[*]notice: Finished catalog run in 0.02 seconds
  

  验证:
  


[*]# cat /tmp/temp.txt
[*]
[*]Hello the world!#
  
页: [1]
查看完整版本: 自动化运维之 - puppet第一个资源 -- 文件管理