Forum: CFEngine Help
Subject: multidimensional array usage
Author: victor
Link to topic: https://cfengine.com/forum/read.php?3,23753,23753#msg-23753

Hello,

Our setup is not on a single network segment, but on the internet with
different addresses and different providers. While configuring cf-serverd
the regexps aren't useful, so i need a complete IP list. I also need to have
various parameters for each server.

I thought the best way to achieve that is using a file with the following 
format:

hostname:ip:stuff:morestuff:etc

I read the file with readstringarray() and now i have an associative array that 
i
can easily query with servers[$(sys.host)][1].  The problem is:

How can i get a slist of all IPs for cf-serverd?

               "server_list"           slist => getindices("servers");

Gives me the host names.

               "server_values"            slist => getvalues("servers");

Gives me much more than needed. I can't use something
like getvalues("servers[.*][1]") or getvalues("servers[$(server_list)][1]")
because it fails.

Any ideas on how to get an slist out of it?

Thanks a lot.
Regards.

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

Reply via email to