Skip to content

Commit

Permalink
Remove is_ip_address function removed from stdlib in 9.x
Browse files Browse the repository at this point in the history
Bump the lower bound on stdlib to 5.0.0
  • Loading branch information
coreone authored and djjudas21 committed May 15, 2024
1 parent 4ddee71 commit 75d354d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
31 changes: 11 additions & 20 deletions manifests/listen.pp
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
# == Define freeradius::listen
#
define freeradius::listen (
Freeradius::Ensure $ensure = 'present',
Enum['auth','acct','proxy','detail','status','coa'] $type = 'auth',
Optional[String] $ip = undef,
Optional[String] $ip6 = undef,
Integer $port = 0,
Optional[String] $interface = undef,
Optional[String] $virtual_server = undef,
Array[String] $clients = [],
Integer $max_connections = 16,
Integer $lifetime = 0,
Integer $idle_timeout = 30,
Freeradius::Ensure $ensure = 'present',
Enum['auth','acct','proxy','detail','status','coa'] $type = 'auth',
Optional[Variant[Stdlib::IP::Address::V4, Enum['*']]] $ip = undef,
Optional[Variant[Stdlib::IP::Address::V6, Enum['*']]] $ip6 = undef,
Integer $port = 0,
Optional[String] $interface = undef,
Optional[String] $virtual_server = undef,
Array[String] $clients = [],
Integer $max_connections = 16,
Integer $lifetime = 0,
Integer $idle_timeout = 30,
) {
$fr_basepath = $::freeradius::params::fr_basepath
$fr_group = $::freeradius::params::fr_group

# Parameter validation
if $ip and $ip != '*' and !is_ip_address($ip) {
fail('ip must be a valid IP address or \'*\'')
}

if $ip6 and $ip6 != '::' and !is_ip_address($ip6) {
fail('ip6 must be a valid IP address or \'::\'')
}

if $ip and $ip6 {
fail('Only one of ip or ip6 can be used')
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">=4.25.0 <10.0.0"
"version_requirement": ">=5.0.0 <10.0.0"
},
{
"name": "puppetlabs/firewall",
Expand Down

0 comments on commit 75d354d

Please sign in to comment.