diff --git a/manifests/acl.pp b/manifests/acl.pp index 1453de9..dbd71f2 100644 --- a/manifests/acl.pp +++ b/manifests/acl.pp @@ -6,10 +6,12 @@ String $comment = "acl fragment for ${aclname}", ) { + $type_cleaned = regsubst($type,':','','G') + concat::fragment{"squid_acl_${aclname}": target => $::squid::config, content => template('squid/squid.conf.acl.erb'), - order => "10-${order}-${type}", + order => "10-${order}-${type_cleaned}", } } diff --git a/spec/defines/acl_spec.rb b/spec/defines/acl_spec.rb index af99bd2..e2ae5bf 100644 --- a/spec/defines/acl_spec.rb +++ b/spec/defines/acl_spec.rb @@ -30,6 +30,18 @@ it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_content(%r{^acl\s+myacl\s+urlregex\shttp://example.com/$}) } it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_content(%r{^# Example company website$}) } end + context 'when type contains special characters, a :' do + let(:params) do + { + type: 'ssl::servername', + order: '07', + entries: ['.foo.bar'], + comment: 'Example company website' + } + end + + it { is_expected.to contain_concat_fragment('squid_acl_myacl').with_order('10-07-sslservername') } + end end end end