成都网站建设设计

将想法与焦点和您一起共享

Puppet远程文件同步

# vi /etc/puppet/fileserver.conf
[files]
  path /var/lib/puppet/server_data
  allow *
# vi /etc/puppet/puppet.conf
server_datadir = /var/lib/puppet/server_data
file {
"/tmp/nagios.tar":
     source          => "puppet://master.puppet.net/files/nagios.tar",
     recurse         => 'true';
   }
exec {
      "nagios_unzip":
      path            => "/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin",
      command         => "tar -xvf /tmp/nagios.tar -C /tmp;chmod +x /tmp/nagios_c.sh",
      require         => File["/tmp/nagios.tar"];
     }
exec {
     "nagios_install":
      path            => "/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin",
      command         => "sh /tmp/nagios_c.sh",
      require         => Exec["nagios_unzip"];
    }

当前文章:Puppet远程文件同步
文章来源:http://chengdu.cdxwcx.cn/article/gjgphc.html