Add facter/openfact configuration support#978
Open
jay7x wants to merge 1 commit intotheforeman:masterfrom
Open
Add facter/openfact configuration support#978jay7x wants to merge 1 commit intotheforeman:masterfrom
jay7x wants to merge 1 commit intotheforeman:masterfrom
Conversation
ekohl
reviewed
Feb 6, 2026
| contain puppet::agent::config | ||
| contain puppet::agent::service | ||
|
|
||
| if $puppet::facter_config.length > 0 { |
Member
There was a problem hiding this comment.
Does this work?
Suggested change
| if $puppet::facter_config.length > 0 { | |
| unless empty($puppet::facter_config) { |
Author
There was a problem hiding this comment.
As $puppet::facter_config cannot be undef and is represented by Hash, so this should work (at least I'm always using it instead of emtpy() which is stdlib function).
➜ ~ puppet apply -e '$a={}; $b={foo=>"bar"}; notice $a.length; notice $b.length'
Notice: Scope(Class[main]): 0
Notice: Scope(Class[main]): 1
Author
There was a problem hiding this comment.
This example should be better:
➜ ~ puppet apply -e '{}.with |Struct[{Optional[foo]=>String}] $x| { notice $x.length }'
Notice: Scope(Class[main]): 0
➜ ~ puppet apply -e '{foo=>"bar"}.with |Struct[{Optional[foo]=>String}] $x| { notice $x.length }'
Notice: Scope(Class[main]): 1
Author
There was a problem hiding this comment.
I can change if empty() is preferred from a style perspective though :)
46dddba to
757527d
Compare
bastelfreak
reviewed
Feb 9, 2026
bastelfreak
reviewed
Feb 9, 2026
bastelfreak
reviewed
Feb 9, 2026
bastelfreak
reviewed
Feb 9, 2026
bastelfreak
reviewed
Feb 9, 2026
bastelfreak
reviewed
Feb 9, 2026
Author
|
JFYI, I tested this on my WIP puppetserver with |
|
thank you for taking this forward, I was struggling to get rid of the need for hocon_setting and hitting a wall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is mostly based on idea of @vchepkov and implementation of @ikonia drafted in #950.
Closes #947