Loading manifests/module/ippool.pp +7 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,13 @@ define freeradius::module::ippool ( Integer $maximum_timeout = 0, Optional[String] $key = undef, ) { if ($cache_size !~ Undef) { $real_cache_size = $cache_size } else { $real_cache_size = inline_template(@("IPADDRRANGE"/L)) <%- require 'ipaddr' -%><%=(IPAddr.new @range_stop).to_i - (IPAddr.new @range_start).to_i + 1 %> |-IPADDRRANGE } freeradius::module { "ippool_${name}": ensure => $ensure, Loading spec/defines/module/ippool_spec.rb 0 → 100644 +23 −0 Original line number Diff line number Diff line require 'spec_helper' describe 'freeradius::module::ippool' do include_context 'redhat_common_dependencies' let(:title) { 'test' } let(:params) do { range_start: '192.168.0.1', range_stop: '192.168.0.10', netmask: '255.255.255.0', } end it do is_expected.to contain_freeradius__module('ippool_test') .with_content(%r{^\s+range_start = 192.168.0.1$}) .with_content(%r{^\s+range_stop = 192.168.0.10$}) .with_content(%r{^\s+netmask = 255.255.255.0$}) .with_content(%r{^\s+cache_size = 10$}) end end templates/ippool.erb +1 −7 Original line number Diff line number Diff line <%- require 'ipaddr' -%> # Do server side ip pool management. Should be added in # post-auth and accounting sections. # Loading Loading @@ -37,11 +35,7 @@ ippool <%= @name %> { # The gdbm cache size for the db files. Should # be equal to the number of ip's available in # the ip pool <%- if @cache_size -%> cache_size = <%= @cache_size %> <%- else -%> cache_size = <%= (IPAddr.new @range_stop).to_i() - (IPAddr.new @range_start).to_i() + 1 %> <%- end -%> cache_size = <%= @real_cache_size %> # Helper db index file used in multilink <%- if @ip_index -%> Loading Loading
manifests/module/ippool.pp +7 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,13 @@ define freeradius::module::ippool ( Integer $maximum_timeout = 0, Optional[String] $key = undef, ) { if ($cache_size !~ Undef) { $real_cache_size = $cache_size } else { $real_cache_size = inline_template(@("IPADDRRANGE"/L)) <%- require 'ipaddr' -%><%=(IPAddr.new @range_stop).to_i - (IPAddr.new @range_start).to_i + 1 %> |-IPADDRRANGE } freeradius::module { "ippool_${name}": ensure => $ensure, Loading
spec/defines/module/ippool_spec.rb 0 → 100644 +23 −0 Original line number Diff line number Diff line require 'spec_helper' describe 'freeradius::module::ippool' do include_context 'redhat_common_dependencies' let(:title) { 'test' } let(:params) do { range_start: '192.168.0.1', range_stop: '192.168.0.10', netmask: '255.255.255.0', } end it do is_expected.to contain_freeradius__module('ippool_test') .with_content(%r{^\s+range_start = 192.168.0.1$}) .with_content(%r{^\s+range_stop = 192.168.0.10$}) .with_content(%r{^\s+netmask = 255.255.255.0$}) .with_content(%r{^\s+cache_size = 10$}) end end
templates/ippool.erb +1 −7 Original line number Diff line number Diff line <%- require 'ipaddr' -%> # Do server side ip pool management. Should be added in # post-auth and accounting sections. # Loading Loading @@ -37,11 +35,7 @@ ippool <%= @name %> { # The gdbm cache size for the db files. Should # be equal to the number of ip's available in # the ip pool <%- if @cache_size -%> cache_size = <%= @cache_size %> <%- else -%> cache_size = <%= (IPAddr.new @range_stop).to_i() - (IPAddr.new @range_start).to_i() + 1 %> <%- end -%> cache_size = <%= @real_cache_size %> # Helper db index file used in multilink <%- if @ip_index -%> Loading