Skip to content
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

Merged
merged 1 commit into from
Nov 24, 2017
Merged

Add unattended_url parameter #606

merged 1 commit into from
Nov 24, 2017

Conversation

matonb
Copy link
Contributor

@matonb matonb commented Oct 26, 2017

Set unattended_url parameter in foreman/settings.yaml

Enables setting of unattended_url during install with foreman-installer

@@ -15,6 +15,7 @@
$receive_facts = true
# should foreman manage host provisioning as well
$unattended = true
$unattended_url = "http://${lower_fqdn}:8000"
Copy link
Member

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?

Copy link
Contributor Author

@matonb matonb Oct 26, 2017

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...

Copy link
Contributor Author

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

Copy link
Member

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.

@matonb
Copy link
Contributor Author

matonb commented Oct 26, 2017

@ekohl Changed default to undef :)

@@ -4,6 +4,9 @@
<%= @header %>

:unattended: <%= scope.lookupvar("foreman::unattended") %>
<% if !scope.lookupvar("foreman::unattended_url").nil? %>
Copy link
Member

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.

@matonb
Copy link
Contributor Author

matonb commented Oct 30, 2017

@ekohl Want me to squash the commits?

@ekohl
Copy link
Member

ekohl commented Oct 30, 2017

We can also do that on merge so you don't have to.

@matonb
Copy link
Contributor Author

matonb commented Oct 30, 2017

Cool

@ekohl ekohl requested a review from mmoll November 21, 2017 12:47
@mmoll
Copy link
Contributor

mmoll commented Nov 21, 2017

a test would be nice.

@mmoll
Copy link
Contributor

mmoll commented Nov 22, 2017

please rebase.

Copy link
Member

@ekohl ekohl left a 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.

end

it { should contain_concat__fragment('foreman_settings+01-header.yaml').
with_content(/^:unattended_url:\s*http:\/\/example.com$/) }
Copy link
Member

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$})

Copy link
Contributor Author

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
@mmoll mmoll merged commit 157567d into theforeman:master Nov 24, 2017
@mmoll
Copy link
Contributor

mmoll commented Nov 24, 2017

merged, thanks @matonb!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants