Closed sboyd-m closed 2 years ago
We use this fact internally as hiera like so:
nat_gateway::public_interface: "%{::network_primary_interface}"
I confirmed by viewing puppet logs that this fact stopped working exactly when this commit happened, and I also verified the hashes of the file before and after based on the puppet logs:
content changed '{md5}9164ece59c43998af1efb392c0023ff6' to '{md5}6d9bca1d4813ea164f4a46b654fa0f66'
Curiously, I patched our hiera to use the networking.primary
fact, and now the module fact shows up, albeit under a different name:
root@box:~$ facter -j -p ':network_primary_interface'
{
":network_primary_interface": "eth0"
}
root@box:~$ facter -j -p 'network_primary_interface'
{
"network_primary_interface": ""
}
I do not know what the root cause issue is.
Ahh, I didn't notice at first, but that commit added colons to the beginnings of all the facts that used to exist...
Why? Why break things?
EDIT: Were you trying to use ruby symbols instead of strings?
Right, facts are being generated with names with leading colons:
EDIT: Were you trying to use ruby symbols instead of strings?
This seems very likely.
Affected Puppet, Ruby, OS and module versions/distributions
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]
How to reproduce (e.g Puppet code you use)
Simply try and read the fact
network_primary_interface
What are you seeing
Fact returns the empty string.
What behaviour did you expect instead
Not the empty string.