summaryrefslogtreecommitdiff
path: root/roles/monitoring/sachet/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-07-21 02:32:05 +0200
committerChristian Pointner <equinox@spreadspace.org>2022-07-21 02:32:05 +0200
commit42bf77ee5763090d2c02f5d2d7a7a686ce09a5e8 (patch)
tree3b92e824064a5d4be16b73d1e98dcd53672e429c /roles/monitoring/sachet/templates
parentele-* playbook refactoring and ele-calypso base install (diff)
add role for sachet
Diffstat (limited to 'roles/monitoring/sachet/templates')
-rw-r--r--roles/monitoring/sachet/templates/sachet.service.j235
-rw-r--r--roles/monitoring/sachet/templates/sachet.yml.j27
2 files changed, 42 insertions, 0 deletions
diff --git a/roles/monitoring/sachet/templates/sachet.service.j2 b/roles/monitoring/sachet/templates/sachet.service.j2
new file mode 100644
index 00000000..9f87c39d
--- /dev/null
+++ b/roles/monitoring/sachet/templates/sachet.service.j2
@@ -0,0 +1,35 @@
+[Unit]
+Description=Sachet SMS Daemon for Prometheus Alertmanager
+
+[Service]
+Restart=always
+User=sachet
+ExecStart=/usr/bin/sachet -config /etc/sachet.yml -listen-address {{ sachet_listen }}
+
+# systemd hardening-options
+AmbientCapabilities=
+CapabilityBoundingSet=
+DeviceAllow=/dev/null rw
+DevicePolicy=strict
+LimitMEMLOCK=0
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+PrivateDevices=true
+PrivateTmp=true
+PrivateUsers=true
+ProtectControlGroups=true
+ProtectHome=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectSystem=full
+{% if 'smstools' in sachet_providers %}
+ReadWritePaths={{ sachet_providers.smstools.outgoing_dir }}
+{% endif %}
+RemoveIPC=true
+RestrictNamespaces=true
+RestrictRealtime=true
+SystemCallArchitectures=native
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/monitoring/sachet/templates/sachet.yml.j2 b/roles/monitoring/sachet/templates/sachet.yml.j2
new file mode 100644
index 00000000..b9e25785
--- /dev/null
+++ b/roles/monitoring/sachet/templates/sachet.yml.j2
@@ -0,0 +1,7 @@
+# {{ ansible_managed }}
+
+providers:
+ {{ sachet_providers | to_nice_yaml(indent=2) | indent(2) }}
+
+receivers:
+ {{ sachet_receivers | to_nice_yaml(indent=2) | indent(2) }}