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

Port to FreeBSD #172

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ This module has been developed and tested against:
* Debian 9/10
* CentOS / RHEL 6 / 7 / 8
* Windows 2008, 2008 R2, 2012, 2012 R2
* FreeBSD 11 / 12 / 13

Support for other distributions / operating systems is planned. Feel free to assist with development in this regard!

Expand Down
4 changes: 2 additions & 2 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@
}
}
}
'windows': {
/windows|FreeBSD/: {
# repo is not applicable to windows
}
default: {
fail('Only RedHat, CentOS, OracleLinux, Debian, Ubuntu, Darwin and Windows repositories and Suse archives are supported at this time')
fail('Only RedHat, CentOS, OracleLinux, Debian, Ubuntu, Darwin, FreeBSD and Windows repositories and Suse archives are supported at this time')
}
}

Expand Down
24 changes: 24 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
$repo_location = 'https://repos.influxdata.com/'
$service_enable = true
$service_ensure = running
$service_flags = undef
$service_hasstatus = true
$service_restart = 'pkill -HUP telegraf'
}
Expand All @@ -41,6 +42,7 @@
$repo_location = undef
$service_enable = true
$service_ensure = running
$service_flags = undef
$service_hasstatus = false
$service_restart = undef
}
Expand All @@ -61,6 +63,27 @@
$repo_location = 'https://repos.influxdata.com/'
$service_enable = true
$service_ensure = running
$service_flags = undef
$service_hasstatus = true
$service_restart = 'pkill -HUP telegraf'
}
'FreeBSD' : {
Copy link
Member

Choose a reason for hiding this comment

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

The metadata should include FreeBSD support at specific versions.

Copy link
Member

Choose a reason for hiding this comment

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

Also README should be updated to list FreeBSD.

Copy link
Author

Choose a reason for hiding this comment

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

Metadata and README fixed in 0391569

Joris

$config_file = '/usr/local/etc/telegraf.conf'
$config_file_owner = 'telegraf'
$config_file_group = 'telegraf'
$config_folder = '/usr/local/etc/telegraf'
$config_folder_mode = '0770'
$logfile = ''
$manage_repo = false
$manage_archive = true
$manage_user = true
$archive_install_dir = undef
$archive_location = undef
$archive_version = undef
$repo_location = undef
$service_enable = true
$service_ensure = running
$service_flags = "-quiet -config-directory=${config_folder}"
$service_hasstatus = true
$service_restart = 'pkill -HUP telegraf'
}
Expand All @@ -81,6 +104,7 @@
$repo_location = 'https://repos.influxdata.com/'
$service_enable = true
$service_ensure = running
$service_flags = undef
$service_hasstatus = true
$service_restart = 'pkill -HUP telegraf'
}
Expand Down
1 change: 1 addition & 0 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
if $telegraf::manage_service and $telegraf::ensure != 'absent' {
service { 'telegraf':
ensure => $telegraf::service_ensure,
flags => $telegraf::service_flags,
hasstatus => $telegraf::service_hasstatus,
enable => $telegraf::service_enable,
restart => $telegraf::service_restart,
Expand Down
8 changes: 8 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@
"operatingsystemrelease": [
"18"
]
},
{
"operatingsystem": "FreeBSD",
"operatingsystemrelease": [
"11",
"12",
"13"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"11",
"12",
"13"
"11",
"12",
"13"

Copy link
Author

Choose a reason for hiding this comment

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

Ok fixed
Thanks

]
}
],
"dependencies": [
Expand Down