Forum: CFEngine Help
Subject: Re: Replace underscores in interface names (creating routes)
Author: CFEngine
Link to topic: https://cfengine.com/forum/read.php?3,26010,26022#msg-26022

The indices in the sys.ipv4 array should be the original interface names, and 
not their canonified versions. You may want to report this as a bug at 
http://cfengine.com/bugtracker

In the meantime you could generate a map between @(nics) and @(interfaces) with 
something like this:

vars:
  "canon_nic[$(interfaces)]" string => canonify("$(interfaces)");
  "interface_name[$(canon_nic[$(interfaces)])]"   string => "$(interfaces)";
reports:
  cfengine::
  "Interface name for $(nics): $(interface_name[$(nics)])";

As shown in reports:, you can then loop over $(nics), and get the original 
interface name from $(interface_name[$(nics)]), which should allow you to 
generate the correct filename.

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

Reply via email to