-
Notifications
You must be signed in to change notification settings - Fork 271
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
Add unattended_url parameter #606
Conversation
manifests/params.pp
Outdated
@@ -15,6 +15,7 @@ | |||
$receive_facts = true | |||
# should foreman manage host provisioning as well | |||
$unattended = true | |||
$unattended_url = "http://${lower_fqdn}:8000" |
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 a non-default location I believe. When is it needed to override this and would it make sense to default to undef
and only place it in the settings when the user overrides it?
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 can't check right now (I haven't got a vanilla foreman available), but I'm pretty sure that's the current default location.
But sure, I was in two minds of setting it to a default location, or not at all...
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.
When would I use it?
Automated deployments of foreman puppet, my current need is to stand everything up from scratch with no user intervention
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 don't recall having to ever override this and I did do bare metal deployments. Now that might just be my memory but I think by default the unattended url is based on the regular foreman url on port 80. A plain foreman doesn't even listen on port 8000 I think.
@ekohl Changed default to undef :) |
templates/settings.yaml.erb
Outdated
@@ -4,6 +4,9 @@ | |||
<%= @header %> | |||
|
|||
:unattended: <%= scope.lookupvar("foreman::unattended") %> | |||
<% if !scope.lookupvar("foreman::unattended_url").nil? %> |
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.
Generally we use unless
instead of if !
. We also tend to test for a few values which are empty-ish even though I'm not sure if this is still needed with puppet 4. See https://github.com/theforeman/puppet-foreman_proxy/blob/9041338dee70b16c9a8e740b32f164d8643ff3b3/templates/settings.yml.erb#L62 for an example.
@ekohl Want me to squash the commits? |
We can also do that on merge so you don't have to. |
Cool |
a test would be nice. |
please rebase. |
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.
We just fixed the master branch so the build should pass if you rebase one last time.
spec/classes/foreman_config_spec.rb
Outdated
end | ||
|
||
it { should contain_concat__fragment('foreman_settings+01-header.yaml'). | ||
with_content(/^:unattended_url:\s*http:\/\/example.com$/) } |
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.
You can use with_content(%r{^:unattended_url:\s*http://example.com$})
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.
@ekohl
Thanks, I couldn't remember the regex pattern syntax and forgot to go back to it :)
Enables setting of unattended_url during install with foreman-installer
merged, thanks @matonb! |
Set
unattended_url
parameter inforeman/settings.yaml
Enables setting of unattended_url during install with foreman-installer