-
Notifications
You must be signed in to change notification settings - Fork 51
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
Rebuild Foreman infrastructure #1777
Conversation
🎆 |
0258b51
to
aca306d
Compare
2e916a2
to
b4d4040
Compare
What works:
I also copied the SSH keys from the existing Puppetserver because it allowed me to verify deployment. What remains to be done:
Actual migration plan:
if [[ -f /etc/redhat-release ]] ; then
yum -y remove puppet6-release
yum -y install https://yum.puppet.com/puppet7-release-el-7.noarch.rpm
yum -y update puppet-agent
elif [[ -f /etc/debian_release ]] ; then
apt -y remove puppet6-release
wget https://apt.puppet.com/puppet7-release-bullseye.deb
apt -y install ./puppet7-release-bullseye.deb
apt update
apt -y upgrade
fi
rm -rf /etc/puppetlabs/puppet/ssl
puppet config server puppet.theforeman.org
puppet ssl bootstrap
puppet agent -t
Now the old server can be considered old and should only remain as a fallback. It shouldn't be used by anything anymore. It's best to shut it down, but keep the old server for a while (2 - 4 weeks). Also keep the 1.24 database dump since we may want to use it for automated upgrade testing. Foreman is running on 3.1. #1676 is a separate issue, but can be done after this is done. |
# To allow the foreman node a SAN | ||
sed -i '/allow-subject-alt-names/ s/false/true/' /etc/puppetlabs/puppetserver/conf.d/ca.conf |
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.
Can you elaborate a bit on this? You want to build a foreman01.$hoster.theforeman.org
with a SAN of foreman.theforeman.org
and need this setting to allow it?
Please be aware that someone (cough) found that this can open up a rather big can of worms (nothing checks the SAN when signing) and is thus not recommended by Puppet: "Be aware that enabling the setting could allow agent nodes to impersonate other nodes (including the nodes that already have signed certificates). Consequently, you must carefully inspect any CSRs with SANs attached."
Especially, Foreman doesn't show any SANs at all in the signing UI.
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 guess we can enable that, sign the cert for foreman.tfm.o
and disable it again?)
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're right about that. The alternative I thought about was using Let's Encrypt for a proper URL. Tricky part there is access to it. Right now I have set up a firewall to only allow port 443 from the Puppetserver and my home network. I guess we could set up rules so that it does IP checks in Apache for everything except /.well-known
or use DNS validation, but that's a lot trickier.
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 think I'd go with the easiest option, which to me seems to be "enable, sign, disable, (forget it 5 years)"?
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'll opt to keep this in bootstrap for now, then when Puppet actually runs it should be disabled again.
If we ensure only key login is possible (which is true today, well, it also allows gssapi which we could disable, but no passwords), I don't think the "special" port adds any real security.
I guess that's fine, yeah. |
I left a few comments, but overall the plan sounds good to me! |
At this point we should also remove all Puppet classes from hostgroups so we don't get duplicate definitions. |
Is that required? I thought both HGs and the site.pp you have here end up being |
IIRC |
13a35e3
to
56f4785
Compare
I changed the post a bit to have easier copy-paste steps and checkboxes so it's easier to mark progress. Remaining open discussion points:
I'll be out until Tuesday so hopefully we can perform the migration next week. |
FTR, I added a new host ( |
IMHO |
For postgresql, I'd use |
7a913b7
to
6ef65e9
Compare
It is a major version due to dropping Puppet 5 but we're on 6 anyway.
This allows deployment without the Foreman ENC. It does not manage users nor include utility. Those accept parameters with data that we do not want in Hiera due to privacy (user email addresses) and password hashes. Those should still be set via Foreman's ENC.
Also switches to the non-deprecated foreman::foreman method.
On Debian there's the sudo group which by default can use password access. For Red Hat the wheel group does the same. This saves individual sudo entries. The only exception is the jenkins user on slave which can use passwordless sudo. For that a specific entry is made.
Still need to migrate secrets and shut down the machine, but I mostly consider this done. Full notes from during the migration in https://community.theforeman.org/t/puppetserver-migration/31903/2. Short follow up action items: |
So it looks like backups are also sent to the old puppetmaster. For now I've created #1805. |
This is to address the Big Update where Foreman is updated from version 1.24 to 3.1. 3.1 is chosen because it's the last version that can update the DB from pre-2.0 databases and also runs on EL8.
It also moves to a Hiera-based structure to assign classes rather than the Foreman ENC. This makes it easier to bootstrap a new environment.