diff --git a/manifests/init.pp b/manifests/init.pp index bb57bb7..b5c7f0e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -31,8 +31,9 @@ include ipset::base if $ensure == 'absent' { - exec { "/usr/sbin/ipset destroy ${title}": - onlyif => "/usr/sbin/ipset list ${title} &>/dev/null", + exec { "ipset destroy ${title}": + onlyif => "ipset list ${title} &>/dev/null", + path => [ '/sbin', '/usr/sbin', '/bin', '/usr/bin' ], require => Package['ipset'], } } else { @@ -47,7 +48,8 @@ $command = "/usr/local/sbin/ipset_from_file -n ${title} -f ${from_file} -t \"${ipset_type}\" -c \"${ipset_create_options}\" -a \"${ipset_add_options}\"" exec { "ipset-create-${name}": command => $command, - unless => "/usr/sbin/ipset list ${title}", + unless => "ipset list ${title} >/dev/null", + logoutput => false, require => Package['ipset'], path => [ '/sbin', '/usr/sbin', '/bin', '/usr/bin' ], } @@ -55,6 +57,7 @@ command => $command, subscribe => File[$from_file], refreshonly => true, + logoutput => false, require => Package['ipset'], path => [ '/sbin', '/usr/sbin', '/bin', '/usr/bin' ], } diff --git a/manifests/iptables.pp b/manifests/iptables.pp index 85deb5d..32c905d 100644 --- a/manifests/iptables.pp +++ b/manifests/iptables.pp @@ -58,9 +58,9 @@ $target_name = regsubst($target,'^([^ ]+).*$','\1') # Strict vs. looser matching if $strictmatch { - $iptables_match = "iptables-save | egrep \"^-A ${chain} .+ -m set --match-set ${ipset} ${flags} .*${options}.*-j ${target_name}\"" + $iptables_match = "iptables-save | egrep \"^-A ${chain} -m set --match-set ${ipset} ${flags} .*${options}.*-j ${target_name}\"" } else { - $iptables_match = "iptables-save | egrep \"^-A ${chain} .+ -m set --match-set ${ipset} ${flags} .*-j ${target_name}\"" + $iptables_match = "iptables-save | egrep \"^-A ${chain} -m set --match-set ${ipset} ${flags} .*-j ${target_name}\"" } # Insert the rule if it's not already there diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..618c727 --- /dev/null +++ b/metadata.json @@ -0,0 +1,10 @@ +{ + "name": "thias-ipset", + "version": "0.1.0", + "author": "Matthias Saou", + "summary": "ipset module", + "license": "Apache-2.0", + "source": "git://github.com/thias/puppet-ipset", + "description": "Manage IP sets in the Linux kernel", + "project_page": "https://github.com/thias/puppet-ipset" +}