Puppet Class: simp_grafana
- Inherits:
- ::simp_grafana::params
- Defined in:
- manifests/init.pp
Overview
Class: simp_grafana
This module acts as a SIMP wrapper (“profile”) for the Puppet, Inc. Approved Grafana module written and maintained by Bill Fraser. It sets a baseline of secure defaults and integrates Grafana with other SIMP components.
Welcome to SIMP!
This module is a component of the System Integrity Management Platform (SIMP), a managed security compliance framework built on Puppet.
This module is optimally designed for use within a larger SIMP ecosystem, but it can be used independently:
-
As a SIMP wrapper module, the defaults use the larger SIMP ecosystem to manage security compliance settings from the Puppet server.
-
If used independently, all SIMP-managed security subsystems may be disabled via the ‘firewall` and `pki` settings.
Parameters
Examples
If SIMP integration is not required, direct use of the component Grafana module is advised.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'manifests/init.pp', line 123
class simp_grafana (
Simplib::Netlist $trusted_nets = $::simp_grafana::params::trusted_nets,
Boolean $firewall = $::simp_grafana::params::firewall,
Variant[Boolean,Enum['simp']] $pki = simplib::lookup('simp_options::pki', { 'default_value' => false }),
Stdlib::Absolutepath $app_pki_external_source = simplib::lookup('simp_options::pki::source', { 'default_value' => '/etc/pki/simp/x509' }),
Hash $cfg = {},
Hash $ldap_cfg = {},
String $install_method = 'repo',
Boolean $use_internet_repo = false,
String $version = simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' }),
String $rpm_iteration = '1',
Boolean $simp_dashboards = false
) inherits ::simp_grafana::params {
$merged_cfg = deep_merge($::simp_grafana::params::cfg, $cfg)
$merged_ldap_cfg = deep_merge($::simp_grafana::params::ldap_cfg, $ldap_cfg)
if $merged_cfg['auth.ldap']['enabled'] { include '::simp_openldap::client' }
if $merged_cfg['server']['http_port'] <= 1024 {
exec { 'grant_grafana_cap_net_bind_service':
command => 'setcap cap_net_bind_service=+ep /usr/sbin/grafana-server',
unless => 'getcap /usr/sbin/grafana-server | fgrep cap_net_bind_service+ep',
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
require => Class['::grafana::config'],
notify => Class['::grafana::service'],
}
} else {
exec { 'revoke_grafana_caps':
command => 'setcap -r /usr/sbin/grafana-server',
onlyif => 'getcap /usr/sbin/grafana-server | fgrep cap_net_bind_service+ep',
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
require => Class['::grafana::config'],
notify => Class['::grafana::service'],
}
}
if $firewall {
include '::simp_grafana::config::firewall'
}
if $pki {
include '::simp_grafana::config::pki'
Class['grafana'] -> Class['simp_grafana::config::pki']
}
class { '::grafana':
cfg => $merged_cfg,
ldap_cfg => $merged_ldap_cfg,
install_method => $install_method,
manage_package_repo => $use_internet_repo,
version => $version,
rpm_iteration => $rpm_iteration
}
if $simp_dashboards {
package { 'simp-grafana-dashboards':
ensure => 'latest',
}
}
}
|