puppet-mastodon/manifests/init.pp

88 lines
1.8 KiB
ObjectPascal
Raw Normal View History

2023-11-26 11:59:01 +01:00
# Class to install a Mastodon instance
#
# [*ensure*]
# String defining if is present or absent
#
# [*hostname*]
# String with the full qualified hostname of the instance. There must be a DNS record for it.
#
# [*smtp_server*]
# String with the SMTP server to use.
#
class mastodon (
String $ensure = 'present',
String $hostname = 'mastodon.example.org',
String $smtp_server = 'mail.example.org'
) {
case $ensure {
default: {
$package_ensure = 'installed'
$directory_ensure = 'directory'
$link_ensure = 'link'
$service_ensure = 'running'
$file_ensure = 'present'
}
/^(absent|delete|uninstall|remove|unregister)$/: {
$package_ensure = 'absent'
$directory_ensure = 'absent'
$link_ensure = 'absent'
$file_ensure = 'absent'
$service_ensure = 'stopped'
$cron_ensure = 'absent'
}
}
$packages = [
'apt-transport-https',
'autoconf',
'bison',
'build-essential',
'ca-certificates',
'certbot',
'ffmpeg',
'file',
'g++',
'gcc',
'git-core',
'gnupg',
'imagemagick',
'libffi-dev',
'libgdbm-dev',
'libicu-dev',
'libidn11-dev',
'libjemalloc-dev',
'libncurses5-dev',
'libpq-dev',
'libprotobuf-dev',
'libreadline6-dev',
'libssl-dev',
'libxml2-dev',
'libxslt1-dev',
'libyaml-dev',
'lsb-release',
'nginx',
# 'nodejs',
'pkg-config',
# 'postgresql-contrib',
# 'postgresql',
'protobuf-compiler',
'python3-certbot-nginx',
# 'redis-server',
# 'redis-tools',
'wget',
'zlib1g-dev',
]
2023-11-27 14:07:57 +01:00
$packages.each | $package | {
if (!defined(Package[$package])) {
package { $package:
ensure => $package_ensure,
}
2023-11-26 11:59:01 +01:00
}
}
class { 'nodejs':
repo_url_suffix => '16.x',
}
class { 'postgresql::server':
}
2023-11-27 09:26:30 +01:00
include redis
2023-11-26 11:59:01 +01:00
}