From 7081ef968f19d21b645363de3953d62d7d724c44 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 9 Oct 2023 09:43:23 +0200 Subject: [PATCH] Fixes #36812 - allow setting (fc)ct_location --- manifests/init.pp | 6 ++++++ spec/classes/foreman_spec.rb | 8 ++++++++ templates/settings.yaml.erb | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 98433a91..c95f3d43 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -182,6 +182,10 @@ # # $register_in_foreman:: Register host in Foreman # +# $provisioning_ct_location:: The location of the binary to call when transpiling CoreOS templates. +# +# $provisioning_fcct_location:: The location of the binary to call when transpiling Fedora CoreOS templates. +# # === Dynflow parameters: # # $dynflow_manage_services:: Whether to manage the dynflow services @@ -297,6 +301,8 @@ String[1] $keycloak_app_name = 'foreman-openidc', String[1] $keycloak_realm = 'ssl-realm', Boolean $register_in_foreman = true, + Optional[Stdlib::Absolutepath] $provisioning_ct_location = undef, + Optional[Stdlib::Absolutepath] $provisioning_fcct_location = undef, ) inherits foreman::params { assert_type(Array[Stdlib::IP::Address], $trusted_proxies) diff --git a/spec/classes/foreman_spec.rb b/spec/classes/foreman_spec.rb index e9f4925a..e3f6aa47 100644 --- a/spec/classes/foreman_spec.rb +++ b/spec/classes/foreman_spec.rb @@ -246,6 +246,8 @@ keycloak: true, keycloak_app_name: 'cloak-app', keycloak_realm: 'myrealm', + provisioning_ct_location: '/usr/bin/myct', + provisioning_fcct_location: '/usr/bin/myfcct', } end @@ -267,6 +269,12 @@ .with_content(%r{^:websockets_ssl_key: /etc/ssl/private/snakeoil-ws\.pem$}) .with_content(%r{^:websockets_ssl_cert: /etc/ssl/certs/snakeoil-ws\.pem$}) end + + it 'should configure ct and fcct commands in settings.yaml' do + is_expected.to contain_concat__fragment('foreman_settings+01-header.yaml') + .with_content(%r{^:ct_location: "/usr/bin/myct"$}) + .with_content(%r{^:fcct_location: "/usr/bin/myfcct"$}) + end end context 'with journald logging' do diff --git a/templates/settings.yaml.erb b/templates/settings.yaml.erb index e7cfdc76..ed61081f 100644 --- a/templates/settings.yaml.erb +++ b/templates/settings.yaml.erb @@ -114,3 +114,11 @@ :namespace: foreman <% end -%> <% end -%> +<% if scope.lookupvar("foreman::provisioning_ct_location") -%> + +:ct_location: "<%= scope.lookupvar("foreman::provisioning_ct_location") %>" +<% end -%> +<% if scope.lookupvar("foreman::provisioning_fcct_location") -%> + +:fcct_location: "<%= scope.lookupvar("foreman::provisioning_fcct_location") %>" +<% end -%>