2024-02-06 21:40:19 +01:00
|
|
|
class kandra::profile::zmirror_personals inherits kandra::profile::base {
|
2024-02-02 15:08:49 +01:00
|
|
|
|
2013-11-01 20:28:03 +01:00
|
|
|
include zulip::supervisor
|
2013-08-23 23:38:39 +02:00
|
|
|
|
2024-02-06 21:40:19 +01:00
|
|
|
Kandra::User_Dotfiles['zulip'] {
|
2024-02-02 19:39:26 +01:00
|
|
|
authorized_keys => [
|
|
|
|
'common',
|
|
|
|
'production-write-ccache',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
$zmirror_packages = [ # Packages needed to run the mirror
|
2018-08-13 21:29:40 +02:00
|
|
|
'libzephyr4-krb5',
|
|
|
|
'zephyr-clients',
|
|
|
|
'krb5-config',
|
|
|
|
'krb5-user',
|
2022-09-14 00:56:55 +02:00
|
|
|
# Packages needed to for ctypes access to Zephyr
|
2018-08-13 21:29:40 +02:00
|
|
|
'python3-dev',
|
2022-09-14 00:56:55 +02:00
|
|
|
'python3-typing-extensions',
|
2024-02-02 19:39:26 +01:00
|
|
|
'restricted-ssh-commands',
|
2018-08-13 21:27:41 +02:00
|
|
|
]
|
2018-12-06 02:56:46 +01:00
|
|
|
package { $zmirror_packages:
|
2024-04-05 05:37:10 +02:00
|
|
|
ensure => installed,
|
2013-08-23 23:38:39 +02:00
|
|
|
}
|
2018-12-06 02:56:46 +01:00
|
|
|
|
2024-02-02 19:39:26 +01:00
|
|
|
# The production-write-ccache key uses
|
|
|
|
# `command="/usr/lib/restricted-ssh-commands"` which allows us to
|
|
|
|
# limit the commands it can run.
|
|
|
|
file { '/etc/restricted-ssh-commands':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0755',
|
|
|
|
}
|
|
|
|
file { '/etc/restricted-ssh-commands/zulip':
|
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
content => join([
|
|
|
|
'^/home/zulip/python-zulip-api/zulip/integrations/zephyr/process_ccache ',
|
|
|
|
'[a-z0-9_.-]+ ',
|
|
|
|
'[A-Za-z0-9]{32} ',
|
|
|
|
'[-A-Za-z0-9+/]*={0,3}$',
|
|
|
|
"\n",
|
|
|
|
], ''),
|
|
|
|
}
|
|
|
|
|
2022-01-13 02:27:30 +01:00
|
|
|
file { '/etc/krb5.conf':
|
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/krb5.conf',
|
2022-01-13 02:27:30 +01:00
|
|
|
}
|
|
|
|
|
2023-04-05 23:26:40 +02:00
|
|
|
concat::fragment { '01-supervisor-zmirror':
|
|
|
|
order => '10',
|
|
|
|
target => $zulip::common::supervisor_conf_file,
|
|
|
|
content => " ${zulip::common::supervisor_system_conf_dir}/zmirror/*.conf",
|
|
|
|
}
|
|
|
|
|
2013-10-04 19:19:57 +02:00
|
|
|
file { ['/home/zulip/api-keys', '/home/zulip/zephyr_sessions', '/home/zulip/ccache',
|
2023-04-05 23:26:40 +02:00
|
|
|
'/home/zulip/mirror_status', "${zulip::common::supervisor_system_conf_dir}/zmirror"]:
|
2018-08-13 21:20:34 +02:00
|
|
|
ensure => directory,
|
2023-01-26 23:26:51 +01:00
|
|
|
mode => '0755',
|
2018-08-13 21:29:40 +02:00
|
|
|
owner => 'zulip',
|
|
|
|
group => 'zulip',
|
2013-08-23 23:38:39 +02:00
|
|
|
}
|
|
|
|
|
2018-08-13 21:29:40 +02:00
|
|
|
file { '/etc/cron.d/test_zephyr_personal_mirrors':
|
2013-08-26 21:43:29 +02:00
|
|
|
ensure => file,
|
2018-08-13 21:29:40 +02:00
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
2018-08-13 21:20:34 +02:00
|
|
|
mode => '0644',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/cron.d/test_zephyr_personal_mirrors',
|
2013-08-26 21:43:29 +02:00
|
|
|
}
|
|
|
|
|
2018-08-13 21:29:40 +02:00
|
|
|
file { '/usr/lib/nagios/plugins/zulip_zephyr_mirror':
|
2020-06-29 23:15:37 +02:00
|
|
|
require => Package[$zulip::common::nagios_plugins],
|
2016-04-04 04:23:57 +02:00
|
|
|
recurse => true,
|
2018-08-13 21:20:34 +02:00
|
|
|
purge => true,
|
2018-08-13 21:29:40 +02:00
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
2018-08-13 21:20:34 +02:00
|
|
|
mode => '0755',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/nagios_plugins/zulip_zephyr_mirror',
|
2016-04-04 04:23:57 +02:00
|
|
|
}
|
|
|
|
|
2021-05-25 04:12:28 +02:00
|
|
|
# Allow the relevant UDP ports
|
2021-08-24 20:43:23 +02:00
|
|
|
concat::fragment { 'iptables-zmirror.v4':
|
2021-05-25 04:12:28 +02:00
|
|
|
target => '/etc/iptables/rules.v4',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/iptables/zmirror.v4',
|
2021-05-25 04:12:28 +02:00
|
|
|
order => '20',
|
|
|
|
}
|
2021-08-24 23:11:36 +02:00
|
|
|
concat::fragment { 'iptables-zmirror.v6':
|
|
|
|
target => '/etc/iptables/rules.v6',
|
2024-02-06 21:40:19 +01:00
|
|
|
source => 'puppet:///modules/kandra/iptables/zmirror.v6',
|
2021-08-24 23:11:36 +02:00
|
|
|
order => '20',
|
|
|
|
}
|
2013-08-23 23:38:39 +02:00
|
|
|
}
|