From 7a4715e363321eeaaa7952c304a0fc61e3911d54 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 3 Sep 2024 12:34:37 +0200 Subject: [PATCH] pass $stable to freight::user directly relying on the variable from the profile is a bad idea --- puppet/modules/freight/manifests/user.pp | 3 ++- puppet/modules/profiles/manifests/web.pp | 3 +++ puppet/modules/web/manifests/vhost/deb.pp | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/puppet/modules/freight/manifests/user.pp b/puppet/modules/freight/manifests/user.pp index 2da929197..b6de0c523 100644 --- a/puppet/modules/freight/manifests/user.pp +++ b/puppet/modules/freight/manifests/user.pp @@ -5,6 +5,7 @@ Stdlib::Absolutepath $stagedir, String $vhost, Variant[String, Array[String]] $cron_matches, + Optional[String[1]] $stable = undef, ) { require freight @@ -73,7 +74,7 @@ owner => 'root', group => 'root', mode => '0644', - content => epp("${module_name}/${vhost}-HEADER.html.epp", { 'stable' => $profiles::web::stable }), + content => epp("${module_name}/${vhost}-HEADER.html.epp", { 'stable' => $stable }), } file { "${webdir}/foreman.asc": ensure => link, diff --git a/puppet/modules/profiles/manifests/web.pp b/puppet/modules/profiles/manifests/web.pp index 68f5dfd4a..f80604065 100644 --- a/puppet/modules/profiles/manifests/web.pp +++ b/puppet/modules/profiles/manifests/web.pp @@ -24,6 +24,9 @@ contain web::vhost::archivedeb + class { 'web::vhost::deb': + stable => $stable, + } contain web::vhost::deb class { 'web::vhost::debugs': diff --git a/puppet/modules/web/manifests/vhost/deb.pp b/puppet/modules/web/manifests/vhost/deb.pp index b11c32364..62f8f5b40 100644 --- a/puppet/modules/web/manifests/vhost/deb.pp +++ b/puppet/modules/web/manifests/vhost/deb.pp @@ -1,6 +1,7 @@ # @summary Set up the deb vhost # @api private class web::vhost::deb ( + String[1] $stable, String $user = 'freight', Stdlib::Absolutepath $home = "/home/${user}", ) { @@ -12,6 +13,7 @@ stagedir => '/var/www/freight', vhost => 'deb', cron_matches => ['nightly', 'scratch'], + stable => $stable, } # Can't use a standard rsync define here as we need to extend the