From 4dda1a622e54e0e70173d48873809a3d67e5759c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix-Antoine=20Fortin?= Date: Thu, 7 May 2026 12:49:24 -0400 Subject: [PATCH 1/2] Switch environment and postrun for image instance --- common/configuration/puppet.yaml.tftpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/configuration/puppet.yaml.tftpl b/common/configuration/puppet.yaml.tftpl index 9a5a20b7..441df22e 100644 --- a/common/configuration/puppet.yaml.tftpl +++ b/common/configuration/puppet.yaml.tftpl @@ -111,6 +111,7 @@ runcmd: - rm -rf /etc/puppetlabs/code/environments/production - git clone ${puppetenv_git} /etc/puppetlabs/code/environments/main - ln -s /etc/puppetlabs/code/environments/main /etc/puppetlabs/code/environments/production + - ln -s /etc/puppetlabs/code/environments/main /etc/puppetlabs/code/environments/image - | ( cd /etc/puppetlabs/code/environments/production @@ -137,6 +138,10 @@ runcmd: %{ for conf in puppet_conf ~} - ${jsonencode(["/opt/puppetlabs/bin/puppet", "config", "set", conf.key, conf.value, "--section", conf.section])} %{ endfor ~} +%{ if contains(tags, "image") } + - /opt/puppetlabs/bin/puppet config set environment image + - /opt/puppetlabs/bin/puppet config set postrun_command /usr/sbin/prepare4image.sh +%{ endif } - systemctl enable puppet # Remove all ifcfg configuration files that have no corresponding network interface in ip link show. - for i in /etc/sysconfig/network-scripts/ifcfg-*; do if ! ip link show | grep -q "$${i##*-}:"; then rm -f $i; fi; done From 1de22b7477bf36ed5e360476fd63b48ed093a89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix-Antoine=20Fortin?= Date: Fri, 8 May 2026 11:47:40 -0400 Subject: [PATCH 2/2] Config section for environment setting in image --- common/configuration/puppet.yaml.tftpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/configuration/puppet.yaml.tftpl b/common/configuration/puppet.yaml.tftpl index 441df22e..6dfb6afc 100644 --- a/common/configuration/puppet.yaml.tftpl +++ b/common/configuration/puppet.yaml.tftpl @@ -139,7 +139,7 @@ runcmd: - ${jsonencode(["/opt/puppetlabs/bin/puppet", "config", "set", conf.key, conf.value, "--section", conf.section])} %{ endfor ~} %{ if contains(tags, "image") } - - /opt/puppetlabs/bin/puppet config set environment image + - /opt/puppetlabs/bin/puppet config --section agent set environment image - /opt/puppetlabs/bin/puppet config set postrun_command /usr/sbin/prepare4image.sh %{ endif } - systemctl enable puppet