Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add purging to $config_path dir #86

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The following parameters are available in the `ipset` class:
* [`firewall_service`](#-ipset--firewall_service)
* [`package_ensure`](#-ipset--package_ensure)
* [`config_path`](#-ipset--config_path)
* [`purge_config_dir`](#-ipset--purge_config_dir)
* [`sets`](#-ipset--sets)

##### <a name="-ipset--packages"></a>`packages`
Expand Down Expand Up @@ -85,6 +86,14 @@ Data type: `Stdlib::Absolutepath`

path to the directory for the ipsets

##### <a name="-ipset--purge_config_dir"></a>`purge_config_dir`

Data type: `Boolean`

Whether to purge the config directory for the ipsets or not

Default value: `false`

##### <a name="-ipset--sets"></a>`sets`

Data type: `Hash`
Expand Down
8 changes: 7 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
# @param config_path
# path to the directory for the ipsets
#
# @param purge_config_dir
# Whether to purge the config directory for the ipsets or not
#
# @param sets
# Hash Hash of 'ipset::set' resources
#
Expand All @@ -31,6 +34,7 @@
Boolean $enable,
Enum['present', 'absent', 'latest'] $package_ensure,
Stdlib::Absolutepath $config_path,
Boolean $purge_config_dir = false,
Optional[Pattern[/\.service$/]] $firewall_service = undef,
Hash $sets = {},
) {
Expand All @@ -40,7 +44,9 @@

# create the config directory
file { $config_path:
ensure => 'directory',
ensure => 'directory',
recurse => true,
purge => $purge_config_dir,
}

# setup the helper scripts
Expand Down