Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
PE 2019.8.4
-
-
Night's Watch
-
3
-
NW - 2021-02-03, NW - 2021-02-17
-
Needs Assessment
-
42719
-
1
-
Bug Fix
-
-
Needs Assessment
Description
Using cli, overriding external facts from the cli works with facter but not in puppet.
Reproducing steps:
when the external fact things don't exist:
[root@goat01 facts.d]# pwd |
/etc/puppetlabs/facter/facts.d
|
[root@goat01 facts.d]# ll things.txt |
ls: cannot access things.txt: No such file or directory
|
[root@goat01 facts.d]# facter -p things |
[root@goat01 facts.d]# FACTER_things=stuff facter -p things |
stuff
|
[root@goat01 facts.d]# FACTER_things=stuff puppet facts|grep things |
"things": "stuff", |
[root@goat01 facts.d]# FACTER_things=stuff puppet apply -e 'notify{"things=>${facts.get(things)}<":}' |
Notice: Compiled catalog for goat01.unix.gsm1900.org in environment production in 0.02 seconds |
Notice: things=>stuff<
|
Notice: /Stage[main]/Main/Notify[things=>stuff<]/message: defined 'message' as 'things=>stuff<' |
Notice: Applied catalog in 0.06 seconds |
however, when external facts exist. create external fact things with value 'NOT_STUFF':
[root@goat01 facts.d]# echo things=NOT_STUFF > things.txt[root@goat01 facts.d]# facter -p things |
NOT_STUFF[root@goat01 facts.d]# FACTER_things=stuff facter -p things #<-- works |
stuff[root@goat01 facts.d]# FACTER_things=stuff puppet facts|grep things #<-- doesnt |
"things": "NOT_STUFF",[root@goat01 facts.d]# FACTER_things=stuff puppet apply -e 'notify{"things=>${facts.get(things)}<":}' |
Notice: Compiled catalog for goat01.unix.gsm1900.org in environment production in 0.02 seconds |
Notice: things=>NOT_STUFF<
|
Notice: /Stage[main]/Main/Notify[things=>NOT_STUFF<]/message: defined 'message' as 'things=>NOT_STUFF<' |
Notice: Applied catalog in 0.06 seconds |
Conclusion: using cli, when external facts exist, environment facts FACTER_<fact> will not overwrite the external facts in Puppet run. facter -p can display the overwritten value but puppet facts and puppet run can't.