문제

I am trying few features of CFENGINE 3.5 and stuck with a very basic issue. I want to copy certain files which are kept in cfengine Policy hub to various cfengine clients. These files are spread into various locations and further cfengine should copy these files to targeted machines on same location as master server has. How to do this ?

도움이 되었습니까?

해결책

If you want to copy certain files from the hub onto the same location on the clients, you can do something like this:

vars:
  "files" slist => { "/some/file", "/other/file", "/one/more/file" };

files:
  "$(files)"
    copy_from => secure_cp("$(files)", "$(sys.policy_hub)");

This will loop over the files, copying each one in turn. Make sure you include the appropriate standard library file to secure_cp(), something like this:

body common control 
{
  inputs => { "lib/3.5/files.cf" };
  bundlesequence => { ... };
}

다른 팁

https://cfengine.com/docs/3.5/examples-policy-copy-single-files.html

This might help.

Thanks & Regards,
Alok Thaker

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top