-
Notifications
You must be signed in to change notification settings - Fork 289
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
Adding windows support. #438
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,16 +129,34 @@ | |
|
||
$check_name = regsubst(regsubst($name, ' ', '_', 'G'), '[\(\)]', '', 'G') | ||
|
||
file { "/etc/sensu/conf.d/checks/${check_name}.json": | ||
case $::osfamily { | ||
'windows': { | ||
$etc_dir = 'C:/opt/sensu' | ||
$conf_dir = "${etc_dir}/conf.d" | ||
$user = undef | ||
$group = undef | ||
$file_mode = undef | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a windows user, but no defaults for these? Does the sensu package installer create a user or does it just run as a system service? Any way to keep other random users from browsing the sensu config which may contain sensitive information such as passwords? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a bit of a tricky one. Secondly, from a puppet point of view the standard unix modal permissions don't really make sense on windows. We have the puppet-acl for those people who really care about fine-grained security permissions but that is out-of-scope of this module and would probably be managed at the profile layer. With these things set to undef the SYSTEM user and Administrators group have full permissions and standard Users have read and execute. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks - the last version of Windows I used was 2008, and not with puppet so my knowledge is old. Makes sense. |
||
} | ||
default: { | ||
$etc_dir = '/etc/sensu' | ||
$conf_dir = "${etc_dir}/conf.d" | ||
$user = 'sensu' | ||
$group = 'sensu' | ||
$file_mode = '0440' | ||
} | ||
} | ||
|
||
file { "${conf_dir}/checks/${check_name}.json": | ||
ensure => $ensure, | ||
owner => 'sensu', | ||
group => 'sensu', | ||
mode => '0440', | ||
owner => $user, | ||
group => $group, | ||
mode => $file_mode, | ||
before => Sensu_check[$check_name], | ||
} | ||
|
||
sensu_check { $check_name: | ||
ensure => $ensure, | ||
base_path => "${conf_dir}/checks", | ||
type => $type, | ||
standalone => $standalone, | ||
command => $command, | ||
|
@@ -157,7 +175,7 @@ | |
dependencies => $dependencies, | ||
custom => $custom, | ||
subdue => $subdue, | ||
require => File['/etc/sensu/conf.d/checks'], | ||
require => File["${conf_dir}/checks"], | ||
notify => $::sensu::check_notify, | ||
ttl => $ttl, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows doesn't have the various sensu services?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know and per the documentation I believe only the client is supported on windows.