On 03/16/2012 04:27 AM, no-re...@cfengine.com wrote:
> 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.

What if you didnt use preserve => "true" in your copy_from body and
instead used files type promises to ensure permissions are as you want
at the target?

files:
    myclass::
        "/etc/foo.conf"
            perms => mog("600", "foo", "foo");

You could even class that on the existence of foo.conf ...

classes:
    "etc_foo_conf_exists" expression => fileexists("/etc/foo.conf");

files:
    myclass.etc_foo_conf_exists::
        "/etc/foo.conf"
            perms => mog("600", "foo", "foo");
-- 
Nick Anderson <n...@cmdln.org>
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to