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

 

在服务器端建立manifest

 

  
  
  
  
  1. [root@server puppet-2.7.21]# vim /etc/puppet/manifests/site.pp node default { file { "/tmp/temp.txt": content =>"Hello the world!";} }

在客户端

 

 

  
  
  
  
  1. [root@web01 ~]# puppetd --server server.example.com --test 
  2.  
  3. info: Caching catalog for web01.example.com 
  4.  
  5. info: Applying configuration version '1367383507' 
  6.  
  7. notice: /Stage[main]//Node[default]/File[/tmp/temp.txt]/ensure: defined content as '{md5}201e171ab2e5740023a4815fe7abf7f7' 
  8.  
  9. notice: Finished catalog run in 0.02 seconds 

验证:

 

  
  
  
  
  1. [root@web01 ~]# cat /tmp/temp.txt  
  2.  
  3. Hello the world![root@web01 ~]#  

 

 

 

 

你可能感兴趣的:(资源,自动化,文件管理,puppet)