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

default puppetmaster is highly unusual #750

Open
anarcat opened this issue Jun 30, 2020 · 10 comments
Open

default puppetmaster is highly unusual #750

anarcat opened this issue Jun 30, 2020 · 10 comments

Comments

@anarcat
Copy link
Contributor

anarcat commented Jun 30, 2020

I was surprised to find that this module configures nodes to connect to themselves by default. For example, this configuration:

include puppet

will (correctly) configure a puppet agent to run on the given node, but will (incorrectly, IMHO) tell it to connect to $fqdn. In my case, this yields the error:

Error: Could not request certificate: Failed to open TCP connection to curie.anarc.at:8140 (Connection refused - connect(2) for "curie.anarc.at" port 8140)

curie.anarc.at is my workstation here. it should instead try to connect to puppet or puppet.$DOMAIN which is puppet.anarc.at in my case.

this change from standard breaks over a decade of convention in the puppet discovery process. i find it quite surprising and can't think of a reason for it.

i believe it should be changed to just nothing: no server line should be added to puppet.conf unless provided by the user, in which case the upstream puppet agent defaults will apply (as they should).

(mistakenly filed against theforeman/puppet-foreman#864 originally)

@anarcat
Copy link
Contributor Author

anarcat commented Jun 30, 2020

i believe this is the code in question:

puppet::config::main {
'server': value => pick($puppetmaster, $facts['networking']['fqdn']);
}

@ekohl
Copy link
Member

ekohl commented Jun 30, 2020

this change from standard breaks over a decade of convention in the puppet discovery process. i find it quite surprising and can't think of a reason for it.

I think the reason is simply historical. 8dfda8a is the first that did it this way and it looks like we didn't change this (other can coding style) since 2012.

I'm open to changing this, but need some time to think about how to best deal with this in our installer. In the short term, I think the best workaround is passing an empty string to the puppetmaster parameter.

@anarcat
Copy link
Contributor Author

anarcat commented Jun 30, 2020

I think the reason is simply historical. 8dfda8a is the first that did it this way and it looks like we didn't change this (other can coding style) since 2012.

This begs the question of why you had to talk to fqdn in the first place...?

I'm open to changing this, but need some time to think about how to best deal with this in our installer. In the short term, I think the best workaround is passing an empty string to the puppetmaster parameter.

For now i passed 'puppet', but i guess that would work as well?

@ekohl
Copy link
Member

ekohl commented Jul 1, 2020

This module was typically used in an ENC where the puppetmaster was provided. That meant that the fqdn fallback was only used on the master itself. That was used on fresh installs and made a sane default in the bootstrap process.

@anarcat
Copy link
Contributor Author

anarcat commented Jul 1, 2020

well that's the thing - if you do this on the master, the default puppet would also probably work, unless DNS is misconfigured (in which case fqdn might fail too anyways)... so i think it could be safely flipped back...

@ekohl
Copy link
Member

ekohl commented Jul 1, 2020

That's not true for most environments we deploy in. The unqualified puppet has never resolved in environments where I worked while FQDN pretty much always works.

@anarcat
Copy link
Contributor Author

anarcat commented Jul 1, 2020

That's not true for most environments we deploy in. The unqualified puppet has never resolved in environments where I worked while FQDN pretty much always works.

how do nodes find their master then?

@ekohl
Copy link
Member

ekohl commented Jul 1, 2020

We always provisioned and made sure the correct puppet.conf was set up during kickstart/preseed. Foreman has the correct value.

@nod0n
Copy link

nod0n commented Dec 29, 2020

I fell in the trap to and did set it to 'puppet' and this works for me as I would expect it.

@sshipway
Copy link

I'm late to this discussion, but we avoided this by just enabling SRV records for our domain and setting puppet::use_srv_records:true.
I agree that a more sensible default than $::fqdn would be "puppet"

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

No branches or pull requests

4 participants