-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to voxpupuli-test 5 #841
Conversation
440d743
to
74d1cdb
Compare
74d1cdb
to
08a35a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexjfisher @bastelfreak would you mind taking a look at these comments?
|
||
# lint:ignore:puppet_url_without_modules | ||
$pluginsource = 'puppet:///plugins' | ||
$pluginfactsource = 'puppet:///pluginfacts' | ||
# lint:endignore | ||
$classfile = '$statedir/classes.txt' | ||
$syslogfacility = undef | ||
$environment = $::environment | ||
$environment = $server_facts['environment'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While https://www.puppet.com/docs/puppet/7/lang_facts_builtin_variables.html#lang_facts_builtin_variables-server-facts doesn't mention it, $server_facts['environment']
is present when using puppet apply
.
} else { | ||
$puppetmaster = undef | ||
} | ||
$client_certname = $trusted['certname'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also present when using puppet apply
manifests/params.pp
Outdated
$puppetmaster = undef | ||
} | ||
$client_certname = $trusted['certname'] | ||
$puppetmaster = $server_facts['servername'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one I wonder about. puppetmaster
is a global variable we set in Foreman's ENC, which allows you to change the puppetserver easily. Also, setting this outside of Foreman's ENC. For example, when using DNS lookups. Should we keep the old defined
code/update it to getvar()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up changing it to getvar('puppetmaster')
, to remain compatible.
f2ada39
to
e2d56df
Compare
c.trusted_node_data = true | ||
c.trusted_server_facts = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprisingly https://github.com/puppetlabs/rspec-puppet#trusted_node_data and https://github.com/puppetlabs/rspec-puppet#trusted_server_facts are off by default.
e2d56df
to
f1e5abb
Compare
@@ -503,6 +496,7 @@ | |||
end | |||
|
|||
it 'should not sync the crl' do | |||
pending("rspec-puppet always sets $server_facts['servername']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Global variables are unspecified and unreliable in where they come from. Instead, built in variables like $facts, $trusted and $server_facts are better sources.
f1e5abb
to
d1e6b34
Compare
No content change compared to the previous version, just extracted part of it to #841 and rebased it on top. Also added a link to the rspec-puppet GH issue in the code itself. |
I'm still a bit unsure about the fact handling. https://puppet.com/docs/puppet/7/lang_facts_builtin_variables.html is a very useful resource, but I'm not entirely sure what the intended values should be and how to deal with it in various environments. See the TODOs inline.