Skip to content

Commit

Permalink
simplify https handling by dropping the profile parameter
Browse files Browse the repository at this point in the history
if you need to disable https, use hiera to disable it on the web class
directly

this allows including the web class multiple times, without having to
care that only one includer can pass args
  • Loading branch information
evgeni committed Nov 15, 2024
1 parent 49f41ba commit 909e40d
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 39 deletions.
7 changes: 2 additions & 5 deletions puppet/data/vagrant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ profiles::jenkins::controller::jenkins_job_builder_username: "admin"

profiles::jenkins::node::swap_size_mb: 0

profiles::web::https: false

profiles::repo::deb::https: false
profiles::repo::rpm::https: false

redmine::https: false

web::https: false
9 changes: 0 additions & 9 deletions puppet/modules/profiles/manifests/repo/deb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@
#
# @param stable
# Latest release that users expect
#
# @param https
# Whether to enable HTTPS. This is typically wanted but can only be enabled
# in a 2 pass setup. First Apache needs to run for Letsencrypt to function.
# Then Letsencrypt can be enabled. Also useful to turn off in test setups.
class profiles::repo::deb (
String[1] $stable,
Boolean $https = true,
) {
class { 'web':
https => $https,
}
contain web

contain web::vhost::archivedeb
Expand Down
9 changes: 0 additions & 9 deletions puppet/modules/profiles/manifests/repo/rpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@
#
# @param stable_foreman
# Latest Foreman release that users expect
#
# @param https
# Whether to enable HTTPS. This is typically wanted but can only be enabled
# in a 2 pass setup. First Apache needs to run for Letsencrypt to function.
# Then Letsencrypt can be enabled. Also useful to turn off in test setups.
class profiles::repo::rpm (
String[1] $stable_foreman,
Boolean $https = true,
) {
class { 'web':
https => $https,
}
contain web

class { 'web::vhost::rpm':
Expand Down
9 changes: 0 additions & 9 deletions puppet/modules/profiles/manifests/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@
#
# @param stable
# Latest release that users expect
#
# @param https
# Whether to enable HTTPS. This is typically wanted but can only be enabled
# in a 2 pass setup. First Apache needs to run for Letsencrypt to function.
# Then Letsencrypt can be enabled. Also useful to turn off in test setups.
class profiles::web (
String[1] $stable,
Boolean $https = true,
) {
class { 'web':
https => $https,
}
contain web

contain web::vhost::archivedeb
Expand Down
2 changes: 1 addition & 1 deletion puppet/modules/web/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# certs are present via the HTTP vhost and only then enable the SSL vhosts.
#
class web(
Boolean $https = false,
Boolean $https = true,
) {
include web::base

Expand Down
6 changes: 0 additions & 6 deletions puppet/spec/classes/profiles_web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

context 'without https' do
let(:params) { { https: false } }

it { is_expected.to compile.with_all_deps }
end
end
end
end

0 comments on commit 909e40d

Please sign in to comment.