Hello Thibault,
Your problem is that the following notation is not doing what you would
expect :
"zone1" or => { "172.30.64.171" };
"zone2" or => { "192.168.55.4" };
The ip adress, written like this, is not a valid class expression.
You can use the ipv4 hard classes
"zone1" or => {"ipv4_172_30_64_171"};
"zone2" or => {"ipv4_192_168_55_4");
or you should rather use the iprange function
"zone1" expression => iprange("172.30.64.171"); // you can also
use the /24 notation, or a range like 171-175
"zone2" expression => iprange("192.168.55.4");
Best regards
Nicolas CHARLES
On 15/02/2012 15:57, [email protected] wrote:
> Forum: CFEngine Help
> Subject: Create areas and the deployment of files
> Author: thibault marteil
> Link to topic: https://cfengine.com/forum/read.php?3,24838,24838#msg-24838
>
> Hello,
>
> I'm looking for a project that consisting in create different areas on my
> policyhost and distribute different files in fonction of my area.
>
> I've tried to create a file but I don't have any success with it.
>
> Here is my file :
>
> bundle agent central
>
> {
> classes:
>
> "zone1" or => { "172.30.64.171" };
> "zone2" or => { "192.168.55.4" };
>
>
> vars:
>
> "policy_server" string => "cfengine.domain.fr";
> "fichiers" string => "/var/cfengine/fichiers";
>
> zone1::
>
> "myfiles" slist => {"$(fichiers)/file1.cf"};
>
>
> zone2::
>
> "myfiles" slist => {"$(fichiers)/file2.cf"};
>
>
> files:
>
> "${myfiles}"
>
> copy_from => secure_cp("${myfiles}","$(policy_server)");
> }
>
>
>
> When I use "cf-agent -v" on my client, I have that response :
>
> !! Non-absolute path in source attribute (have no invariant meaning):
> ${myfiles}
> cf3> Promise (version 0.0.1) belongs to bundle 'central' in file
> '/var/cfengine/inputs/central.cf' near line 29
> cf3> Fatal cfengine error:
> cf3> Outcome of version 0.0.1 (agent-0): Promises observed to be kept 100%,
> Promises repaired 0%, Promises not repaired 0%
>
>
> Thanks in advance,
> Sorry for my english, I'll do my best, I'm a foreigner.
>
> _______________________________________________
> Help-cfengine mailing list
> [email protected]
> https://cfengine.org/mailman/listinfo/help-cfengine
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine