Compare commits

...

5 Commits

Author SHA1 Message Date
unkin-agent 9e5c674325 Migrate git servers to puppet-on-k8s
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/bolt-validate 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
2026-11-08 21:55:44 +11:00
unkin-agent 8e2497d612 Migrate git redis nodes to puppet-on-k8s (#564)
The git redis nodes build their redisha peer list from a puppetdb_query of their own role, so all members must move to puppet-on-k8s together.

- enable profiles::puppet::migrate for roles::infra::git::redis

Reviewed-on: #564
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-08 18:59:04 +11:00
unkin-agent 7605623aa8 Migrate consul servers to puppet-on-k8s (#563)
Consul servers build their peer list from a region-scoped PuppetDB query of their own role, so all members must report to the same PuppetDB and move to puppet-on-k8s together. syd1 clients use a static server list and are unaffected.

- enable profiles::puppet::migrate for roles::infra::storage::consul

Reviewed-on: #563
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-08 18:00:40 +11:00
unkin-agent 1961a049f3 Migrate vault nodes to puppet-on-k8s (#562)
Vault nodes build their peer list from a region-scoped PuppetDB query of their own role, so all members must move to puppet-on-k8s together.

- enable profiles::puppet::migrate for roles::infra::storage::vault

Reviewed-on: #562
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-08 17:34:28 +11:00
unkin-agent faf96a1dca Run detached noop agent after k8s migration repoint (#561)
Migrated nodes have no facts or exported resources in the k8s PuppetDB until their next agent run (up to splay + runinterval), which breaks exported-resource discovery for services migrated as a group. A noop run registers both at compile time.

- add a refreshonly exec in profiles::puppet::migrate, subscribed to puppet.conf, that launches a detached noop agent run via systemd-run
- skip the exec while a previous puppet-migrate-noop unit is still active

Reviewed-on: #561
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-10-25 12:39:01 +11:00
5 changed files with 20 additions and 0 deletions
+2
View File
@@ -14,6 +14,8 @@ profiles::ssh::sign::principals:
hiera_include:
- redisha
profiles::puppet::migrate::enabled: true
redisha::manage_repo: false
redisha::redisha_members_lookup: true
redisha::redisha_members_role: roles::infra::git::redis
+2
View File
@@ -6,6 +6,8 @@ hiera_include:
- profiles::gitea::haproxy
- gitea
profiles::puppet::migrate::enabled: true
# additional altnames
profiles::pki::vault::alt_names:
- git.unkin.net
@@ -3,6 +3,8 @@ hiera_include:
- frrouting
- exporters::frr_exporter
profiles::puppet::migrate::enabled: true
profiles::consul::server::members_lookup: true
profiles::consul::server::data_dir: /data/consul
profiles::consul::server::addresses:
+2
View File
@@ -1,4 +1,6 @@
---
profiles::puppet::migrate::enabled: true
profiles::vault::server::members_role: roles::infra::storage::vault
profiles::vault::server::members_lookup: true
profiles::vault::server::data_dir: /data/vault
+12
View File
@@ -17,6 +17,8 @@
# still points at it when it applies this change). profiles::puppet::client
# rewrites puppet.conf with the new server / ca_server / report_server / ssldir
# and notifies Service['puppet'], so the very next agent run lands on k8s.
# The puppet.conf change also fires a detached noop run so facts and exported
# resources register in the k8s PuppetDB immediately.
#
# 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
@@ -83,5 +85,15 @@ class profiles::puppet::migrate (
group => 'root',
mode => '0771',
}
exec { 'puppet-migrate-noop-run':
command => join([
'/usr/bin/systemd-run --unit=puppet-migrate-noop --collect',
'/opt/puppetlabs/bin/puppet agent --onetime --no-daemonize --noop --no-splay --waitforlock 10 --maxwaitforlock 900',
], ' '),
unless => '/usr/bin/systemctl is-active --quiet puppet-migrate-noop',
refreshonly => true,
subscribe => File['/etc/puppetlabs/puppet/puppet.conf'],
}
}
}