From bc9d1dc960c321e130ef94e2521cef07bde0a829 Mon Sep 17 00:00:00 2001 From: Patrik Holmqvist Date: Wed, 19 Jun 2024 14:02:24 +0200 Subject: [PATCH 1/2] Use upstream puppet modules for ubuntu24+. This is how we do it in modern debian so it makes sense to do it on modern ubuntu as well. --- global/pre-tasks.d/030puppet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global/pre-tasks.d/030puppet b/global/pre-tasks.d/030puppet index c431f0a..e6e5364 100755 --- a/global/pre-tasks.d/030puppet +++ b/global/pre-tasks.d/030puppet @@ -13,7 +13,7 @@ if ! test -f "${stamp}" -a -f /usr/bin/puppet; then . /etc/os-release # Note: in posix shell, string comparison is done with a single = - if [ "${ID}" = "debian" ] && [ "${VERSION_ID}" -ge 12 ]; then + if [ "${ID}" = "debian" ] && [ "${VERSION_ID}" -ge 12 ] || ([ "${ID}" = "ubuntu" ] && $(dpkg --compare-versions ${VERSION_ID} ge 24.04)) ; then apt-get -y install \ cron \ puppet-module-camptocamp-augeas \ From 4231b4ac1df001df835c043eb1ec1896eabc3cdf Mon Sep 17 00:00:00 2001 From: Patrik Holmqvist Date: Wed, 19 Jun 2024 14:07:13 +0200 Subject: [PATCH 2/2] Migrate from legacy fact This did not work on modern puppet in ubuntu24: Warning: Interpolation failed with '::lsbdistcodename', but compilation continuing; New syntax inspiration from: https://www.puppet.com/docs/puppet/8/hiera_config_yaml_5#configuring_hiera --- global/overlay/etc/puppet/hiera.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global/overlay/etc/puppet/hiera.yaml b/global/overlay/etc/puppet/hiera.yaml index 3de986b..a301376 100644 --- a/global/overlay/etc/puppet/hiera.yaml +++ b/global/overlay/etc/puppet/hiera.yaml @@ -21,7 +21,7 @@ hierarchy: pkcs7_public_key: /etc/hiera/eyaml/public_certkey.pkcs7.pem - name: "Overrides per distribution" - path: "dist_%{::lsbdistcodename}_override.yaml" + path: "dist_%{facts.os.distro.codename}_override.yaml" - name: "Data common to whole environment" path: "common.yaml" \ No newline at end of file