puppet::migrate: drive k8s cutover from a single enabled boolean
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
Wire profiles::puppet::migrate into profiles::base (shipping enabled=>false) so every node evaluates it. client.pp now includes migrate and folds new_server/new_ca_server/new_ssldir into the effective server/ca_server/ report_server/ssldir it renders, so flipping the one profiles::puppet::migrate::enabled key at any hiera layer (node/role/common) repoints a target -- no per-node client param overrides. Explicit client::ssldir/::report_server still override the migrate-derived value; unmigrated nodes render a byte-identical puppet.conf.
This commit is contained in:
@@ -21,48 +21,45 @@
|
||||
# NOTE: this is deliberately hiera-driven per node/role so waves can be rolled
|
||||
# out and rolled back one target at a time. The class only manages the fresh
|
||||
# ssldir; the actual puppet.conf changes ride on profiles::puppet::client's
|
||||
# existing template via its $server / $ca_server / $report_server / $ssldir
|
||||
# params (see the hiera block below). Do NOT add a second File resource for
|
||||
# puppet.conf here -- client.pp already owns it.
|
||||
# existing template. client.pp `include`s this class and, when enabled, folds
|
||||
# new_server / new_ca_server / new_ssldir into the effective server /
|
||||
# ca_server / report_server / ssldir it renders. Do NOT add a second File
|
||||
# resource for puppet.conf here -- client.pp already owns it.
|
||||
#
|
||||
# == Wiring (hiera_include convention)
|
||||
# == Wiring (single boolean)
|
||||
#
|
||||
# This class is opt-in via hiera_include; it is not pulled in by
|
||||
# profiles::base. To migrate a target add the class to hiera_include AND flip
|
||||
# the client params so puppet.conf carries the new endpoints + fresh ssldir.
|
||||
# This class ships wired into profiles::base with enabled => false, so every
|
||||
# node evaluates it but nothing changes until the boolean is flipped. Because
|
||||
# client.pp includes it and reads its params, setting the ONE key below at any
|
||||
# hiera layer repoints a target -- no client.pp param overrides needed.
|
||||
#
|
||||
# The endpoints (new_server / new_ca_server / new_ssldir) are param defaults
|
||||
# on this class; override them in hiera too if the k8s names ever change.
|
||||
#
|
||||
# --- Canary: one node -> hieradata/nodes/<certname>.yaml -------------------
|
||||
# hiera_include:
|
||||
# - profiles::puppet::migrate
|
||||
#
|
||||
# profiles::puppet::migrate::enabled: true
|
||||
#
|
||||
# # repoint the agent (client.pp owns puppet.conf; migrate.pp owns ssldir)
|
||||
# profiles::puppet::client::server: 'puppet.k8s.syd1.au.unkin.net'
|
||||
# profiles::puppet::client::ca_server: 'puppetca.k8s.syd1.au.unkin.net'
|
||||
# profiles::puppet::client::report_server: 'puppet.k8s.syd1.au.unkin.net'
|
||||
# profiles::puppet::client::ssldir: '/etc/puppetlabs/puppet/ssl-k8s'
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# --- Wave: a whole role -> hieradata/roles/<t1>/<t2>[/<t3>].yaml -----------
|
||||
# (same keys as the canary block above)
|
||||
# profiles::puppet::migrate::enabled: true
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# --- Final flip: hieradata/common.yaml (retires the legacy masters) --------
|
||||
# profiles::puppet::client::server: 'puppet.k8s.syd1.au.unkin.net'
|
||||
# profiles::puppet::client::ca_server: 'puppetca.k8s.syd1.au.unkin.net'
|
||||
# profiles::puppet::client::report_server: 'puppet.k8s.syd1.au.unkin.net'
|
||||
# profiles::puppet::client::ssldir: '/etc/puppetlabs/puppet/ssl-k8s'
|
||||
# # profiles::puppet::migrate no longer needs to be in hiera_include once the
|
||||
# # fleet default points at k8s and the fresh ssldir exists everywhere.
|
||||
# --- Estate flip -> hieradata/common.yaml (retires the legacy masters) -----
|
||||
# profiles::puppet::migrate::enabled: true
|
||||
# ---------------------------------------------------------------------------
|
||||
#
|
||||
# Manual override: profiles::puppet::client::ssldir and ::report_server are
|
||||
# Optional and, when set explicitly in hiera, win over the migrate-derived
|
||||
# value. server / ca_server have no undef sentinel, so while enabled => true
|
||||
# the migrate endpoints win; to point a target at a bespoke server leave
|
||||
# enabled => false for it and set profiles::puppet::client::server directly.
|
||||
#
|
||||
# == Rollback (per target)
|
||||
#
|
||||
# Delete the migration block from the node/role hiera (or set the client keys
|
||||
# back to the legacy values and drop the ssldir override). The next run
|
||||
# rewrites puppet.conf back to the legacy ssldir, which still contains the
|
||||
# original CA-signed cert, and the node is back on the VM masters.
|
||||
# Remove the profiles::puppet::migrate::enabled key (or set it back to false)
|
||||
# at the node/role/common layer. The next run rewrites puppet.conf back to the
|
||||
# legacy server + legacy ssldir, which still contains the original CA-signed
|
||||
# cert, and the node is back on the VM masters.
|
||||
#
|
||||
# site/profiles/manifests/puppet/migrate.pp
|
||||
class profiles::puppet::migrate (
|
||||
|
||||
Reference in New Issue
Block a user