Compare commits
4 commits
ffc5170fc0
...
b0ded4d0ef
Author | SHA1 | Date | |
---|---|---|---|
Micke Nordin | b0ded4d0ef | ||
Micke Nordin | 98a02615cc | ||
Magnus Andersson | d0260d7c05 | ||
Magnus Andersson | dd022213a6 |
|
@ -5,6 +5,7 @@ define sunetdrive::app_type (
|
||||||
$override_config = undef,
|
$override_config = undef,
|
||||||
$override_compose = undef
|
$override_compose = undef
|
||||||
) {
|
) {
|
||||||
|
include sunet::packages::netcat_openbsd
|
||||||
# Config from group.yaml and customer specific conf
|
# Config from group.yaml and customer specific conf
|
||||||
$environment = sunetdrive::get_environment()
|
$environment = sunetdrive::get_environment()
|
||||||
$customer = sunetdrive::get_customer()
|
$customer = sunetdrive::get_customer()
|
||||||
|
|
48
manifests/common.pp
Normal file
48
manifests/common.pp
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
|
||||||
|
# Common class
|
||||||
|
class sunetdrive::common {
|
||||||
|
include sunet::tools
|
||||||
|
include sunet::motd
|
||||||
|
include sunet::ntp
|
||||||
|
include apt
|
||||||
|
include apparmor
|
||||||
|
include sunet::packages::jq
|
||||||
|
if $::facts['sunet_nftables_enabled'] != 'yes' {
|
||||||
|
warning('Enabling UFW')
|
||||||
|
include ufw
|
||||||
|
} else {
|
||||||
|
if $facts['networking']['hostname'] =~ /^kube[wc]/ {
|
||||||
|
warning('Setting nftables to installed but disabled')
|
||||||
|
ensure_resource ('class','sunet::nftables::init', { enabled => false })
|
||||||
|
} else {
|
||||||
|
warning('Enabling nftables')
|
||||||
|
ensure_resource ('class','sunet::nftables::init', { })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
package {'sysstat': ensure => 'latest'}
|
||||||
|
package {'needrestart': ensure => installed}
|
||||||
|
service {'sysstat': provider => 'systemd'}
|
||||||
|
file_line { 'enable_sa':
|
||||||
|
ensure => 'present',
|
||||||
|
line => 'ENABLED="true"',
|
||||||
|
path => '/etc/default/sysstat',
|
||||||
|
match => 'ENABLED="false"',
|
||||||
|
require => Package['sysstat'],
|
||||||
|
}
|
||||||
|
file_line { 'sa_cron_comment':
|
||||||
|
ensure => 'present',
|
||||||
|
line => '# Activity reports every 2 minutes everyday',
|
||||||
|
path => '/etc/cron.d/sysstat',
|
||||||
|
match => '^#\ Activity\ reports\ every\ 10\ minutes\ everyday',
|
||||||
|
require => Package['sysstat'],
|
||||||
|
notify => Service['sysstat'],
|
||||||
|
}
|
||||||
|
file_line { 'sa_cron':
|
||||||
|
ensure => 'present',
|
||||||
|
line => '*/2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1',
|
||||||
|
path => '/etc/cron.d/sysstat',
|
||||||
|
match => '^5-55/10',
|
||||||
|
require => Package['sysstat'],
|
||||||
|
notify => Service['sysstat'],
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
# This is a asyncronous replica of the Maria DB Cluster for SUNET Drive
|
# This is a asyncronous replica of the Maria DB Cluster for SUNET Drive
|
||||||
class sunetdrive::mariadb_backup($tag_mariadb=undef, $location=undef) {
|
class sunetdrive::mariadb_backup($tag_mariadb=undef, $location=undef) {
|
||||||
|
include sunet::packages::netcat_openbsd
|
||||||
$dirs = [ 'datadir', 'init', 'conf', 'backups' ]
|
$dirs = [ 'datadir', 'init', 'conf', 'backups' ]
|
||||||
$dirs.each | $dir | {
|
$dirs.each | $dir | {
|
||||||
ensure_resource('file',"/opt/mariadb_backup/${dir}", { ensure => directory, recurse => true } )
|
ensure_resource('file',"/opt/mariadb_backup/${dir}", { ensure => directory, recurse => true } )
|
||||||
|
|
Loading…
Reference in a new issue