Forum: CFEngine Help Subject: How can I get the interface name of a certain IP address? Author: weijianliao Link to topic: https://cfengine.com/forum/read.php?3,27650,27650#msg-27650
Here is the precondition: bundle agent test { vars: "dns_servers" slist => { "192.168.1.1","192.168.1.2" }; "nics" slist => getindices("sys.ipv4"); classes: "is_dns_server" expression => reglist("@(dns_servers)","$(sys.ipv4[$(nics)])"); } Servers that whose ip addresses match dns_servers will result in defining class is_dns_server .I want to get the exact ip address of the server that makes the class is_dns_server and use it in promises under the class is_dns_server .How can I achieve this? PS:I don't know how many interfaces are there in the target servers. _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine