Ridding unpredictable predictable interface names
Martin Simons <[email protected]>
| Newsgroups | gmane.comp.sysutils.cfengine.general |
|---|---|
| Message-ID | <[email protected]> |
Dear CFEngineer,
Predictable interface names tend to break my policies. Therefore I decided
to fall back to old style interface names eth0 ... ethn, enforced in the
files
10-persistent-eth1.link
11-persistent-eth2.link
In the files the interface names are being paired with MAC Addresses.
The KVM (virtual) machines that I am managing with CFEngine have varying
interface configurations, depending on their roles. A nameserver has an
eth1 and an eth2, whereas an Internet facing machine has eth0, eth1 and
eth2 and a cloud management node has eth1, eth2 and eth5.
I provide the interface names through the role definition and I extract the
MAC Adresses from the output of the 'ip link' command.
In order to create the persistent link files, I need to pass the pairs of
information to a template editing bundle.
I have two lists that I want to pair, like this:
macs slist => { '52:54:00:64:0d:0c', '52:54:00:64:0d:0d ' };
Interfaces slist => { 'eth1', 'eth2' };
I want an array or container like this:
persistent[eth1] string => '52:54:00:64:0d:0c';
persistent[eth2] string => '52:54:00:64:0d:0d';
I looked over the functions again and again but I do not get it right.
How do I pair those into an array?
Regards,
Martin.
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/6f7055f2-e0d8-4d53-b698-6cee1d7c767fn%40googlegroups.com.