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

fix(bootstrap): force lowercase FQDN writing puppet configuration #255

Merged
merged 2 commits into from
Aug 10, 2018

Conversation

faust64
Copy link
Contributor

@faust64 faust64 commented Aug 2, 2018

Registering production hosts to Katello, I noticed that when an
hostname has uppercase characters, then, puppet generates its
certificate translating my FQDN to lowercases. While puppet.conf
would still mention uppercases.
Eventually, puppet agent can't fetch its catalog (403 back from
puppetserver). Updating the certname value to match our certificate
fixes.

One could say that hostnames shouldn't include uppercase characters
to begin with.
On the other hand, I can't ask my customer to rename production hosts,
without being completely certain I'm not disturbing whatever application
their servers are running.

We could try setting --fqdn. Although having a fool-proof puppet
configuration might still be relevant (?)
Arguably, we could also patch FQDN default value (row 1012) to
socket.getfqdn().lower(), although I can't guarantee this won't
break something else. AFAIU, fixing puppet.conf is just what I need for
the bootstrap to execute properly on my customers servers.

Registering production hosts to Katello, I noticed that when an
hostname has uppercase characters, then, puppet generates its
certificate translating my FQDN to lowercases. While puppet.conf
would still mention uppercases.
Eventually, puppet agent can't fetch its catalog (403 back from
puppetserver). Updating the certname value to match our certificate
fixes.

One could say that hostnames shouldn't include uppercase characters
to begin with.
On the other hand, I can't ask my customer to rename production hosts,
without being completely certain I'm not disturbing whatever application
their servers are running.

We could try setting `--fqdn`. Although having a fool-proof puppet
configuration might still be relevant (?)
Arguably, we could also patch FQDN default value (row 1012) to
`socket.getfqdn().lower()`, although I can't guarantee this won't
break something else. AFAIU, fixing puppet.conf is just what I need for
the bootstrap to execute properly on my customers servers.
@evgeni
Copy link
Member

evgeni commented Aug 7, 2018

I agree, fixing the puppet conf only is the cleanest way to do it.

I'd ack the change if we can add a comment pointing at Puppet docs (or worst case, source) where they do/expect the .lower.

A quick glance says https://puppet.com/docs/puppet/5.5/configuration.html#certname is what we want:

For best compatibility, you should limit the value of certname to only use lowercase letters, numbers, periods, underscores, and dashes. (That is, it should match /A[a-z0-9._-]+Z/.)

@evgeni
Copy link
Member

evgeni commented Aug 9, 2018

LGTM

@sideangleside what do you think?

@sideangleside
Copy link
Member

👍

@evgeni evgeni merged commit 801bbd3 into Katello:master Aug 10, 2018
evgeni added a commit to evgeni/katello-client-bootstrap that referenced this pull request Jan 24, 2019
changelog:
* Python 3 support
* Capability to preserve proxy settings when reconfiguring/migrating the client (Katello#283)
* EL5 subscription manager compatibility fixes (Katello#284)
* Only yum clean metadata and dbcache, not RPMs (Katello#280)
* Allow defining where to get ssh keys and where to store them (Katello#281)
* Make the FIPS check more robust (Katello#279)
* Support yum and dnf Python bindings (Katello#271)
* Option to ignore registration failures (Katello#261)
* Force lowercase FQDN writing puppet configuration (Katello#255)
* Improve the error message when a search fails (Katello#257)
@evgeni evgeni mentioned this pull request Jan 24, 2019
evgeni added a commit that referenced this pull request Jan 25, 2019
changelog:
* Python 3 support
* Capability to preserve proxy settings when reconfiguring/migrating the client (#283)
* EL5 subscription manager compatibility fixes (#284)
* Only yum clean metadata and dbcache, not RPMs (#280)
* Allow defining where to get ssh keys and where to store them (#281)
* Make the FIPS check more robust (#279)
* Support yum and dnf Python bindings (#271)
* Option to ignore registration failures (#261)
* Force lowercase FQDN writing puppet configuration (#255)
* Improve the error message when a search fails (#257)
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

Successfully merging this pull request may close these issues.

3 participants