How to secure copy using Puppet?

随声附和 提交于 2019-12-12 01:34:42

问题


I have been trying to copy a directory from my master to different hosts. I have a script that checks out a code and puts it in certain directory. My script looks like below.

#!/bin/bash
export CVSROOT=:pserver:anonymous@server101:2401/cvs/PXI/
cvs checkout -r 2_a Jcode
mv  Jcode /etc/example/puppettest/

Now I want to copy this Jcode to my hosts.


回答1:


Assuming you are trying to copy /etc/example/puppettest to your nodes you would have to create a mount point in ${configdir}/fileserver.conf then you can use the recurse parameter of the file resource.

This following has not been tested:

${configdir}/fileserver.conf

[jcode]
  path /etc/example/puppettest/
  allow *

file declaration

file { '/path/to/directory/on/node':
  ensure  => directory,
  recurse => true,
  source  => 'puppet:///jcode/Jcode'
}


来源:https://stackoverflow.com/questions/36069655/how-to-secure-copy-using-puppet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!