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 #282

Merged
merged 2 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion manifests/forwarder.pp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
# This is a module that supports multiple platforms. For some platforms
# there is non-generic configuration that needs to be declared in addition
# to the agnostic resources declared here.
if $facts['kernel'] in ['Linux', 'SunOS'] {
if $facts['kernel'] in ['Linux', 'SunOS', 'FreeBSD'] {
contain 'splunk::forwarder::service::nix'
Class['splunk::forwarder::config']
-> Class['splunk::forwarder::service::nix']
Expand Down
27 changes: 27 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,27 @@
$supports_systemd = false
}
}
'FreeBSD': {
$path_delimiter = '/'
$forwarder_src_subdir = 'freebsd'
$forwarder_seed_config_file = "${forwarder_homedir}/etc/system/local/user-seed.conf"
$enterprise_seed_config_file = "${enterprise_homedir}/etc/system/local/user-seed.conf"
$forwarder_password_config_file = "${forwarder_homedir}/etc/passwd"
$enterprise_password_config_file = "${enterprise_homedir}/etc/passwd"
$forwarder_secret_file = "${forwarder_homedir}/etc/splunk.secret"
$enterprise_secret_file = "${enterprise_homedir}/etc/splunk.secret"
$forwarder_confdir = "${forwarder_homedir}/etc"
$enterprise_src_subdir = 'freebsd'
$enterprise_confdir = "${enterprise_homedir}/etc"
$forwarder_install_options = ['-f'] # ignore the wrong os major version specified in the package
$enterprise_install_options = []
$enterprise_service = 'splunk'
$forwarder_service = 'splunk'
$enterprise_service_file = '/etc/rc.d/splunk'
$forwarder_service_file = '/etc/rc.d/splunk'
$boot_start_args = ''
$supports_systemd = false
}
'windows': {
$path_delimiter = '\\'
$forwarder_src_subdir = 'windows'
Expand Down Expand Up @@ -261,6 +282,7 @@
'Debian': { $package_provider = 'dpkg' }
'Solaris': { $package_provider = 'sun' }
'Suse': { $package_provider = 'rpm' }
'FreeBSD': { $package_provider = 'pkgng' }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is setting this required? in 99% of the cases undef is fine and puppet will figure it out automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added it for completeness, but it looks like there is code depending on it in

if $splunk::forwarder::package_provider and !($splunk::forwarder::package_provider in ['apt','chocolatey','yum']) {

To be honest, I did not test it without setting is specifically.

'windows': { $package_provider = 'windows' }
default: { $package_provider = undef } # Don't define a $package_provider
}
Expand Down Expand Up @@ -317,6 +339,11 @@
$forwarder_package_name = 'splunkforwarder'
$enterprise_package_name = 'splunk'
}
'FreeBSD amd64': {
$package_suffix = "${version}-${build}-freebsd-11.1-amd64.txz"
$forwarder_package_name = 'splunkforwarder'
$enterprise_package_name = 'splunk'
}
default: { fail("unsupported osfamily/arch ${facts['os']['family']}/${facts['os']['architecture']}") }
}

Expand Down
6 changes: 6 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"12"
]
},
{
"operatingsystem": "FreeBSD",
"operatingsystemrelease": [
"12"
]
},
{
"operatingsystem": "Windows",
"operatingsystemrelease": [
Expand Down