Skip to content

Instantly share code, notes, and snippets.

@electrofelix
Last active May 7, 2019 17:31
Show Gist options
  • Save electrofelix/1a7a70da3f864c0561666cd3d4d7eed7 to your computer and use it in GitHub Desktop.
Save electrofelix/1a7a70da3f864c0561666cd3d4d7eed7 to your computer and use it in GitHub Desktop.
class mysensu::setup() {
# have a number of other settings applied to this resource
class { '::sensu':
use_embedded_ruby => true,
sensu_plugin_provider => 'sensu_gem',
}
# because the package installs it's on CA certs and we have an internal
# bundle, need to replace the package one anytime it is installed/updated
file { '/opt/sensu/embedded/ssl/cert.pem':
source => 'file:/etc/ssl/certs/ca-certificates.crt',
# backup => true causes backup to occur under source directory instead of
# attempting to use a common filebucket which doesn't exist.
backup => true,
show_diff => false,
subscribe => [
Exec['ca_cert_update'],
Package['sensu'],
]
}
# correct way to ensure the resource collector finds the resources
Package <| provider == 'sensu_gem' |> {
require +> File['/opt/sensu/embedded/ssl/cert.pem']
}
package { 'sensu-plugins-puppet':
ensure => '1.2.0',
provider => 'sensu_gem',
source => $::sensu::gem_install_options[0]['--source'],
install_options => $package_gem_install_options,
require => Class['ca_cert'],
}
}
class mysensu::setup() {
# have a number of other settings applied to this resource
class { '::sensu':
use_embedded_ruby => true,
sensu_plugin_provider => 'sensu_gem',
}
# because the package installs it's on CA certs and we have an internal
# bundle, need to replace the package one anytime it is installed/updated
file { '/opt/sensu/embedded/ssl/cert.pem':
source => 'file:/etc/ssl/certs/ca-certificates.crt',
# backup => true causes backup to occur under source directory instead of
# attempting to use a common filebucket which doesn't exist.
backup => true,
show_diff => false,
subscribe => [
Exec['ca_cert_update'],
Package['sensu'],
]
} -> Package <| provider == 'sensu_gem' |> # <-- beginning to suspect this is not the right way to do this
package { 'sensu-plugins-puppet':
ensure => '1.2.0',
provider => 'sensu_gem',
source => $::sensu::gem_install_options[0]['--source'],
install_options => $package_gem_install_options,
require => Class['ca_cert'], # <-- is this overwriting the resource collector ordering above?
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment