Hi,
I want to use an array for some settings in my mailserver. I used the
IP address of the node in the array, but it's not working, I guess
beacause of the '.' in the IP address. I use 3.0.3 community version.
vars:
"array[XX.YY.ZZ.19][example.com][bindip]" string => "XX.YY.ZZ.113";
"array[XX.YY.ZZ.19][example.com][helohost]" string =>
"10.mta.example.com";
"mailserver_domains" slist => getindices("mail_domain[$(sys.ipv4)]");
Error:
Function getindices was promised an array in scope "array[XX" but this
was not found
- Am I correct that this is because I use dot in the array definition?
- Is there any built-in function to eliminate the dots from an IP
address? I can find any replace function. I'm not sure how I could use
the built in hard class (ipv4_XX_YY_ZZ_AA) for that.
A more general question is that what's the best practice to match a
host with a role. For example I have webservers and emailservers. Some
system is webserver only, some emailserver only, some none, some both.
Right now I set up an slist and generate classes based on the IP address.
vars:
"webserver" slist => { "XX.YY.ZZ.21" };
classes:
"is_webserver" expression => reglist("@(webserver)","$(sys.ipv4)");
files:
is_webserver::
(do whatever)
Is there any better way to do that?
Thanks,
Miklos
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine