diff --git a/REFERENCE.md b/REFERENCE.md
index 6531399..e368a09 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -81,7 +81,7 @@ Name of the syslog-ng service.
##### `module_prefix`
-Data type: `String[1]`
+Data type: `String[0]`
A string to prepend to syslog-ng module names to obtain the corresponding package names.
@@ -97,6 +97,8 @@ Data type: `String[1]`
The value of the `ensure` parameter of package resources.
+Default value: `'installed'`
+
##### `manage_repo`
Data type: `Boolean`
@@ -135,8 +137,6 @@ Data type: `Stdlib::Absolutepath`
Configures the path, where `syslog-ng` and `syslog-ng-ctl` binaries can be found.
-Default value: `'/usr/sbin'`
-
##### `user`
Data type: `String[1]`
@@ -163,16 +163,20 @@ Default value: `true`
##### `init_config_file`
-Data type: `Stdlib::Absolutepath`
+Data type: `Optional[Stdlib::Absolutepath]`
Path to the init script configuration file.
+Default value: `undef`
+
##### `init_config_hash`
Data type: `Hash`
Hash of init configuration options to put into `init_config_file`. This has OS specific defaults which will be merged to user specified value.
+Default value: `{}`
+
## Defined types
### `syslog_ng::config`
diff --git a/data/default.yaml b/data/default.yaml
index e0f1857..c02c995 100644
--- a/data/default.yaml
+++ b/data/default.yaml
@@ -18,4 +18,4 @@ syslog_ng::options:
syslog_ng::service_name: syslog-ng
syslog_ng::config_file: /etc/syslog-ng/syslog-ng.conf
syslog_ng::config_file_header: "# This file was generated by Puppet's ccin2p3-syslog_ng module"
-syslog_ng::package_ensure: present
+syslog_ng::sbin_path: /usr/sbin
diff --git a/data/osfamily/FreeBSD.yaml b/data/osfamily/FreeBSD.yaml
new file mode 100644
index 0000000..8f45077
--- /dev/null
+++ b/data/osfamily/FreeBSD.yaml
@@ -0,0 +1,6 @@
+---
+syslog_ng::config_file: /usr/local/etc/syslog-ng.conf
+syslog_ng::group: wheel
+syslog_ng::package_name: syslog-ng
+syslog_ng::module_prefix: ''
+syslog_ng::sbin_path: /usr/local/sbin
diff --git a/manifests/init.pp b/manifests/init.pp
index 0d55fd1..7466145 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -40,16 +40,16 @@
Stdlib::Absolutepath $config_file,
String[1] $package_name,
String[1] $service_name,
- String[1] $module_prefix,
- Stdlib::Absolutepath $init_config_file,
- Hash $init_config_hash,
+ String[0] $module_prefix,
String[1] $config_file_header,
- String[1] $package_ensure,
+ Stdlib::Absolutepath $sbin_path,
+ String[1] $package_ensure = 'installed',
+ Optional[Stdlib::Absolutepath] $init_config_file = undef,
+ Hash $init_config_hash = {},
Boolean $manage_init_defaults = false,
Boolean $manage_repo = false,
Boolean $manage_package = true,
Array[String[1]] $modules = [],
- Stdlib::Absolutepath $sbin_path = '/usr/sbin',
String[1] $user = 'root',
String[1] $group = 'root',
Boolean $syntax_check_before_reloads = true,
diff --git a/metadata.json b/metadata.json
index a4cb2a8..3512e68 100644
--- a/metadata.json
+++ b/metadata.json
@@ -38,6 +38,13 @@
"11"
]
},
+ {
+ "operatingsystem": "FreeBSD",
+ "operatingsystemrelease": [
+ "13",
+ "14"
+ ]
+ },
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
diff --git a/spec/defines/module_spec.rb b/spec/defines/module_spec.rb
index 2af805b..1b1a5b9 100644
--- a/spec/defines/module_spec.rb
+++ b/spec/defines/module_spec.rb
@@ -23,7 +23,7 @@
end
it { is_expected.to compile }
- it { is_expected.to contain_package('MODPREFIX_foo').with_ensure('present') }
+ it { is_expected.to contain_package('MODPREFIX_foo').with_ensure('installed') }
end
context 'When osfamily is RedHat' do
@@ -37,7 +37,7 @@
end
it { is_expected.to compile }
- it { is_expected.to contain_package('syslog-ng-foo').with_ensure('present') }
+ it { is_expected.to contain_package('syslog-ng-foo').with_ensure('installed') }
end
context 'When osfamily is Debian' do
@@ -47,7 +47,7 @@
end
it { is_expected.to compile }
- it { is_expected.to contain_package('syslog-ng-mod-foo').with_ensure('present') }
+ it { is_expected.to contain_package('syslog-ng-mod-foo').with_ensure('installed') }
end
end
@@ -62,6 +62,6 @@
end
it { is_expected.to compile }
- it { is_expected.to contain_package('syslog-ng-foo').with_ensure('present') }
+ it { is_expected.to contain_package('syslog-ng-foo').with_ensure('installed') }
end
end