I'm using puppet 4.10.9 with facter 3.6.8. I have a question(s) regarding the use of facts in a manifest that I'll ask in a simple form, and a more complex form. First, the simple question.
On an agent I can see the following addresses:
facter --show-legacy | grep ipaddress
ipaddress => 192.168.25.75
ipaddress_enp0s3 => 10.0.2.15
ipaddress_enp0s8.25 => 192.168.25.75
ipaddress_lo => 127.0.0.1
I want to use 'ipaddress_enp0s8.25' (a vlan interface) in a manifest. Yes, I realize I could use 'ipaddress' but for reasons I'll explain later I would like to use the vlan interface specifically.
When I try to use this interface reference in a manifest I get a Syntax error:
listenip => $ipaddress_enp0s8.25
These references DO WORK, but again, I want to use the vlan interface specifically:
listenip => $ipaddress
listenip => $networking['ip']
So how can I use 'ipaddress_enp0s8.25' ?
Here's the more complex angle, and some background. This is part of a larger project that involves recycling (spin up, terminate) the same environment frequently. There's been careful attention to how nodes behave as they do initial provisioning. One of the first issues I noted was:
'Evaluation Error: Operator '[]' is not applicable to an Undef Value.'
Because at that time I was trying to use:
$networking['interfaces']['enp0s8.25']['ip']
And this doesn't exist at the initial run. I could not get past 'Loading facts'
So I settled for '$networking['ip']' which works fine. However at first run, this returns 10.0.2.15. At subsequent runs it returns the desired address 192.168.25.75. The result is, generally an operational node, but a 30 minute lapse for certain services.
What can I use here so that the desired vlan address becomes the value? I'd like to try 'ipaddress_enp0s8.25' but I cannot for reasons noted above.
A couple of misc. items to note:
- I am creating that vlan interface using razorsedge-network module.
- I was able to use 'ipaddress_enp0s8_25' without issue in puppet 3.8