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 support for FreeBSD #45

Open
wants to merge 6 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
12 changes: 8 additions & 4 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Name of the syslog-ng service.

##### <a name="-syslog_ng--module_prefix"></a>`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.

Expand All @@ -97,6 +97,8 @@ Data type: `String[1]`

The value of the `ensure` parameter of package resources.

Default value: `'installed'`

##### <a name="-syslog_ng--manage_repo"></a>`manage_repo`

Data type: `Boolean`
Expand Down Expand Up @@ -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'`

##### <a name="-syslog_ng--user"></a>`user`

Data type: `String[1]`
Expand All @@ -163,16 +163,20 @@ Default value: `true`

##### <a name="-syslog_ng--init_config_file"></a>`init_config_file`

Data type: `Stdlib::Absolutepath`
Data type: `Optional[Stdlib::Absolutepath]`

Path to the init script configuration file.

Default value: `undef`

##### <a name="-syslog_ng--init_config_hash"></a>`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

### <a name="syslog_ng--config"></a>`syslog_ng::config`
Expand Down
2 changes: 1 addition & 1 deletion data/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions data/osfamily/FreeBSD.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
"11"
]
},
{
"operatingsystem": "FreeBSD",
"operatingsystemrelease": [
"13",
"14"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
Expand Down
8 changes: 4 additions & 4 deletions spec/defines/module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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
Loading