Skip to content

Commit

Permalink
Rework 7a12da9
Browse files Browse the repository at this point in the history
Switching from Stdlib::Ip_address to Stdlib::IP::Address seems to not
satisfy Travis-CI completely.  Simplify the code to cope with address
expressed as hostname and not IP addresses since this is also supported.
  • Loading branch information
smortex committed Sep 6, 2019
1 parent 36ad940 commit 7127fad
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 46 deletions.
28 changes: 0 additions & 28 deletions lib/puppet/parser/functions/address_family.rb

This file was deleted.

2 changes: 1 addition & 1 deletion manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Optional[String] $default_pool_inc,
Optional[String] $default_pool_diff,
Integer $port = 9102,
Stdlib::Ip::Address $listen_address = $facts['ipaddress'],
String $listen_address = $facts['ipaddress'],
String $password = 'secret',
Integer $max_concurrent_jobs = 2,
String $director_name = $bacula::director_name,
Expand Down
2 changes: 1 addition & 1 deletion manifests/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
String $group = $bacula::bacula_group,
String $homedir = $bacula::homedir,
Optional[String] $job_tag = $bacula::job_tag,
Stdlib::Ip::Address $listen_address = $facts['ipaddress'],
String $listen_address = $facts['ipaddress'],
Integer $max_concurrent_jobs = 20,
Boolean $manage_defaults = true,
String $password = 'secret',
Expand Down
2 changes: 1 addition & 1 deletion manifests/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
String $director_name = $bacula::director_name,
String $group = $bacula::bacula_group,
String $homedir = $bacula::homedir,
Stdlib::Ip::Address $listen_address = $facts['ipaddress'],
String $listen_address = $facts['ipaddress'],
Integer $maxconcurjobs = 5,
String $media_type = 'File',
String $password = 'secret',
Expand Down
7 changes: 0 additions & 7 deletions spec/functions/address_family_spec.rb

This file was deleted.

14 changes: 6 additions & 8 deletions templates/_listen.epp
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<%
|
Stdlib::Ip::Address $listen_address,
String $listen_address,
Optional[Integer] $port,
|
-%>
<% $family = address_family($listen_address)
if $family == 'INET' { -%>
ipv4 = {
<%= $listen_address ? {
Stdlib::IP::Address::V4::Nosubnet => 'ipv4',
Stdlib::IP::Address::V6::Nosubnet => 'ipv6',
default => 'ip',
} %> = {
addr = <%= $listen_address %>;
<% } elsif $family == 'INET6' { -%>
ipv6 = {
addr = <%= $listen_address %>;
<% } -%>
<% if $port { -%>
port = <%= $port %>;
<% } -%>
Expand Down

0 comments on commit 7127fad

Please sign in to comment.