Skip to content

Commit

Permalink
Use name instead of shortname for client definition
Browse files Browse the repository at this point in the history
* Fix after djjudas21#191 which reverted changes from djjudas21#198
  • Loading branch information
cruelsmith committed Sep 27, 2024
1 parent 43a29e7 commit 9150d46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
$fr_basepath = $::freeradius::params::fr_basepath
$fr_group = $::freeradius::params::fr_group

file { "freeradius clients.d/${shortname}.conf":
file { "freeradius clients.d/${name}.conf":
ensure => $ensure,
path => "${fr_basepath}/clients.d/${shortname}.conf",
path => "${fr_basepath}/clients.d/${name}.conf",
mode => '0640',
owner => 'root',
group => $fr_group,
Expand Down
6 changes: 3 additions & 3 deletions spec/defines/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
end

it do
is_expected.to contain_file('freeradius clients.d/test_short.conf')
.with_path('/etc/raddb/clients.d/test_short.conf')
is_expected.to contain_file('freeradius clients.d/test.conf')
.with_path('/etc/raddb/clients.d/test.conf')
.with_content(%r{^client test_short {\n\s+ipaddr = 1.2.3.4\n\s+proto = \*\n\s+shortname = test_short\n\s+secret = "secret_value"\n\s+require_message_authenticator = no\n}\n})
.with_ensure('present')
.with_group('radiusd')
Expand Down Expand Up @@ -58,7 +58,7 @@
end

it do
is_expected.to contain_file('freeradius clients.d/test_short.conf')
is_expected.to contain_file('freeradius clients.d/test.conf')
.with_content(%r{^\s+password = "foo bar"$})
end
end
Expand Down

0 comments on commit 9150d46

Please sign in to comment.