Forum: CFEngine Help
Subject: Permissions and ownership with recursive copy_from
Author: nico
Link to topic: https://cfengine.com/forum/read.php?3,25291,25291#msg-25291

Hello,

I have the following problem that I'm trying to find a solution for. I have a 
recursive copy_from that runs on a number of servers:

 myclass::
            "/"
                copy_from => rcp("/cfengine/config/myclass"),
                depth_search => recurse("inf"),
                file_select => skipfiles,
                action => immediate;

rcp looks like this:
body copy_from rcp(file)
{
    servers => { "myserver.example.com" };
    source => "$(file)";
    preserve => "true";
    copy_backup => "false";
    compare     => "digest";
}

And then the file-tree under /cfengine/config/myclass looks something like this
etc/
     foo.conf
     bar.conf
     init.d/
         startsomething

For example, I would like to set foo.conf to mode 600 and owner foo.foo, 
bar.conf to 644 and owner bar, startsomething to mode 755. One issue is that 
the user foo does not necessarily have the same uid on all the servers so I 
need some other way then actually setting the owner of the original file to 
flag the correct owner.  I have been thinking of having file like this 
containing the necessary information foo.conf.permissions containing "600", 
foo.conf.owner containing "foo" and so on.

Can cfengine do this? Or does anyone have any other suggestions of sollutions?

 /Nico

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to