2009/12/9 <[email protected]>
>
> ...
> It looks neater. Suppose I want to add a file that has a different user,
> group or mode? In a perfect world we'd be able to define data structures
> in CF as we would in Perl and loop through them.
> ...
Which puts me on to an idea I definitely will use - keep all file
promises defined in a Perl file and just generate the required file
promises from this file.
- Erlend
$ nl /tmp/doit.pl
1 use strict;
2 my %fdb=(
3 "/etc/auto_home"=>["root","sys","644"],
4 "/etc/.rhosts"=>["root","sys","600"],
5 );
6 for my $f(keys %fdb){
7 print "file=$f owner=$fdb{$f}[0], mode=$fdb{$f}[2]\n";
8 }
$ perl /tmp/doit.pl
file=/etc/auto_home owner=root, mode=644
file=/etc/.rhosts owner=root, mode=600
$ #here only one line per file, but you can of course print anything,
including cf3 file policies
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine