2024-02-06 21:40:19 +01:00
|
|
|
class kandra::profile::base {
|
2020-10-20 02:49:54 +02:00
|
|
|
include zulip::profile::base
|
2024-02-06 21:40:19 +01:00
|
|
|
include kandra::ksplice_uptrack
|
|
|
|
include kandra::firewall
|
|
|
|
include kandra::teleport::node
|
|
|
|
include kandra::prometheus::node
|
2013-10-29 23:53:04 +01:00
|
|
|
|
2024-02-06 21:40:19 +01:00
|
|
|
kandra::firewall_allow { 'ssh': order => '10'}
|
2024-01-30 19:40:04 +01:00
|
|
|
$is_ec2 = zulipconf('machine', 'hosting_provider', 'ec2') == 'ec2'
|
2021-05-25 04:12:28 +02:00
|
|
|
|
2021-05-18 05:36:25 +02:00
|
|
|
$org_base_packages = [
|
|
|
|
# Standard kernel, not AWS', so ksplice works
|
|
|
|
'linux-image-virtual',
|
|
|
|
# Management for our systems
|
2018-08-13 21:29:40 +02:00
|
|
|
'openssh-server',
|
2018-08-13 21:27:41 +02:00
|
|
|
# package management
|
2018-08-13 21:29:40 +02:00
|
|
|
'aptitude',
|
2021-05-10 07:02:14 +02:00
|
|
|
# SSL certificates
|
2020-04-17 02:28:30 +02:00
|
|
|
'certbot',
|
2018-08-13 21:27:41 +02:00
|
|
|
# For managing our current Debian packages
|
2018-08-13 21:29:40 +02:00
|
|
|
'debian-goodies',
|
2018-08-13 21:27:41 +02:00
|
|
|
# Popular editors
|
2018-08-13 21:29:40 +02:00
|
|
|
'vim',
|
|
|
|
'emacs-nox',
|
2018-08-13 21:27:41 +02:00
|
|
|
# Prevent accidental reboots
|
2018-08-13 21:29:40 +02:00
|
|
|
'molly-guard',
|
2018-08-13 21:27:41 +02:00
|
|
|
# Useful tools in a production environment
|
2018-08-13 21:29:40 +02:00
|
|
|
'screen',
|
|
|
|
'strace',
|
2020-05-11 09:51:51 +02:00
|
|
|
'bind9-host',
|
2018-08-13 21:29:40 +02:00
|
|
|
'git',
|
|
|
|
'nagios-plugins-contrib',
|
2018-08-13 21:27:41 +02:00
|
|
|
]
|
2022-03-16 01:23:53 +01:00
|
|
|
zulip::safepackage { $org_base_packages: ensure => installed }
|
2013-10-29 23:53:04 +01:00
|
|
|
|
2021-05-18 05:36:25 +02:00
|
|
|
# Uninstall the AWS kernel, but only after we install the usual one
|
2022-01-12 22:57:44 +01:00
|
|
|
package { ['linux-image-aws', 'linux-headers-aws', 'linux-aws-*', 'linux-image-*-aws', 'linux-modules-*-aws']:
|
2021-05-18 05:36:25 +02:00
|
|
|
ensure => absent,
|
|
|
|
require => Package['linux-image-virtual'],
|
|
|
|
}
|
|
|
|
|
2013-11-10 15:32:54 +01:00
|
|
|
file { '/etc/apt/apt.conf.d/02periodic':
|
2018-08-13 21:20:34 +02:00
|
|
|
ensure => file,
|
|
|
|
mode => '0644',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/apt/apt.conf.d/02periodic',
|
2013-11-10 15:32:54 +01:00
|
|
|
}
|
|
|
|
|
2016-08-19 17:27:17 +02:00
|
|
|
file { '/etc/apt/apt.conf.d/50unattended-upgrades':
|
2018-08-13 21:20:34 +02:00
|
|
|
ensure => file,
|
|
|
|
mode => '0644',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/apt/apt.conf.d/50unattended-upgrades',
|
2016-08-19 17:27:17 +02:00
|
|
|
}
|
2024-03-25 20:16:16 +01:00
|
|
|
if $facts['os']['distro']['release']['major'] == '22.04' {
|
2022-07-16 03:12:05 +02:00
|
|
|
file { '/etc/needrestart/conf.d/zulip.conf':
|
|
|
|
ensure => file,
|
|
|
|
mode => '0644',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/needrestart/zulip.conf',
|
2022-07-16 03:12:05 +02:00
|
|
|
}
|
|
|
|
}
|
2016-08-19 17:27:17 +02:00
|
|
|
|
2024-01-31 05:14:59 +01:00
|
|
|
user { 'root': }
|
2024-02-06 21:40:19 +01:00
|
|
|
kandra::user_dotfiles { 'root':
|
2024-01-31 19:25:39 +01:00
|
|
|
home => '/root',
|
2024-02-01 18:31:00 +01:00
|
|
|
keys => 'internal-read-only-deploy-key',
|
2024-01-31 19:25:39 +01:00
|
|
|
authorized_keys => 'common',
|
2024-02-07 18:23:28 +01:00
|
|
|
known_hosts => ['github.com'],
|
2024-01-30 20:58:17 +01:00
|
|
|
}
|
2024-01-31 05:14:59 +01:00
|
|
|
|
2024-02-06 21:40:19 +01:00
|
|
|
kandra::user_dotfiles { 'zulip':
|
2024-02-01 18:31:00 +01:00
|
|
|
keys => 'internal-read-only-deploy-key',
|
2024-01-31 19:25:39 +01:00
|
|
|
authorized_keys => 'common',
|
2024-02-07 18:23:28 +01:00
|
|
|
known_hosts => ['github.com'],
|
2024-01-30 20:58:17 +01:00
|
|
|
}
|
2013-10-29 23:53:04 +01:00
|
|
|
|
2018-02-10 01:20:26 +01:00
|
|
|
service { 'ssh':
|
|
|
|
ensure => running,
|
|
|
|
}
|
|
|
|
|
2024-02-06 21:40:19 +01:00
|
|
|
include kandra::aws_tools
|
2024-01-29 21:34:53 +01:00
|
|
|
|
2024-01-31 03:25:40 +01:00
|
|
|
if $is_ec2 {
|
2024-01-30 19:40:04 +01:00
|
|
|
# EC2 hosts can use the in-VPC timeserver
|
2022-03-25 20:16:13 +01:00
|
|
|
file { '/etc/chrony/chrony.conf':
|
|
|
|
ensure => file,
|
|
|
|
mode => '0644',
|
2024-03-25 20:16:16 +01:00
|
|
|
source => "puppet:///modules/kandra/chrony-${facts['os']['distro']['release']['major']}.conf",
|
2022-03-25 20:16:13 +01:00
|
|
|
require => Package['chrony'],
|
|
|
|
notify => Service['chrony'],
|
|
|
|
}
|
2013-10-29 23:53:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
group { 'nagios':
|
2018-08-13 21:20:34 +02:00
|
|
|
ensure => present,
|
|
|
|
gid => '1050',
|
2013-10-29 23:53:04 +01:00
|
|
|
}
|
|
|
|
user { 'nagios':
|
|
|
|
ensure => present,
|
|
|
|
uid => '1050',
|
|
|
|
gid => '1050',
|
|
|
|
shell => '/bin/bash',
|
|
|
|
home => '/var/lib/nagios',
|
|
|
|
managehome => true,
|
|
|
|
}
|
2024-01-31 05:14:59 +01:00
|
|
|
file { '/var/lib/nagios':
|
2018-08-13 21:20:34 +02:00
|
|
|
ensure => directory,
|
|
|
|
require => User['nagios'],
|
2018-08-13 21:29:40 +02:00
|
|
|
owner => 'nagios',
|
|
|
|
group => 'nagios',
|
2023-01-26 23:26:51 +01:00
|
|
|
mode => '0700',
|
2013-10-29 23:53:04 +01:00
|
|
|
}
|
2024-02-06 21:40:19 +01:00
|
|
|
kandra::user_dotfiles { 'nagios':
|
2024-01-31 19:25:39 +01:00
|
|
|
home => '/var/lib/nagios',
|
|
|
|
authorized_keys => true,
|
|
|
|
}
|
2013-10-29 23:53:04 +01:00
|
|
|
file { '/home/nagios':
|
2018-08-13 21:20:34 +02:00
|
|
|
ensure => absent,
|
|
|
|
force => true,
|
2013-10-29 23:53:04 +01:00
|
|
|
recurse => true,
|
|
|
|
}
|
|
|
|
}
|