summaryrefslogtreecommitdiff
path: root/manifests/network.pp
diff options
context:
space:
mode:
authorHendrik Jäger <gitcommit@henk.geekmail.org>2022-07-01 22:15:04 +0200
committerHendrik Jäger <gitcommit@henk.geekmail.org>2022-07-01 22:25:22 +0200
commite1c6349ec0d9aa6cb7d1690edf0416ddd3709d8a (patch)
treee443185df7b20f11ab83f81057f5951c5ec0e49e /manifests/network.pp
parentbfc65b39a1c85b67c44817cadb6de2a2fb2505a0 (diff)
refactor
Diffstat (limited to 'manifests/network.pp')
-rw-r--r--manifests/network.pp64
1 files changed, 64 insertions, 0 deletions
diff --git a/manifests/network.pp b/manifests/network.pp
new file mode 100644
index 0000000..1e432ac
--- /dev/null
+++ b/manifests/network.pp
@@ -0,0 +1,64 @@
+define henks_ircservices::network (
+ String $run_user = "irc-services-${name}",
+ String $network_name = $name,
+) {
+ $service_base = "/etc/s6-services/irc-services-${network_name}/"
+
+ user {
+ $run_user:
+ ensure => present,
+ password => '!',
+ managehome => true,
+ ;
+ }
+
+ file {
+ $service_base:
+ ensure => directory,
+ ;
+ "${service_base}/run":
+ ensure => present,
+ content => epp(
+ 'henks_ircservices/etc/s6-services/irc-services/run.epp',
+ {
+ 'network_name' => $network_name,
+ 'run_user' => $run_user,
+ },
+ ),
+ mode => '0755',
+ ;
+ "${service_base}/timeout-kill":
+ ensure => present,
+ content => '0',
+ ;
+ "${service_base}/log/":
+ ensure => directory,
+ ;
+ "${service_base}/log/run":
+ ensure => present,
+ content => epp(
+ 'henks_ircservices/etc/s6-services/irc-services/log/run.epp',
+ {
+ 'network_name' => $network_name,
+ },
+ ),
+ mode => '0755',
+ ;
+ "/var/log/s6/irc-services-${network_name}/":
+ ensure => directory,
+ mode => '0700',
+ ;
+ "/var/log/s6/irc-services-${network_name}/logs/":
+ ensure => directory,
+ mode => '0700',
+ ;
+ }
+
+ service {
+ "irc-services-${network_name}":
+ ensure => running,
+ enable => true,
+ provider => 's6',
+ ;
+ }
+}