Skip to content

Commit

Permalink
Fixes #36812 - allow setting (fc)ct_location
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni authored and ekohl committed Oct 10, 2023
1 parent 1f9ddf9 commit 5b2ed22
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions spec/classes/foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions templates/settings.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%>

0 comments on commit 5b2ed22

Please sign in to comment.