From cde2c78a0eccfcaddec0f43dabece929db704671 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Thu, 14 Nov 2024 15:56:22 +0100 Subject: [PATCH] feat(thelounge): add quadlet deployment Related to #51 Signed-off-by: Matej Focko --- roles/thelounge/tasks/main.yml | 17 +++++++++++++++++ roles/thelounge/templates/thelounge.container | 16 ++++++++++++++++ roles/thelounge/templates/thelounge.volume | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 roles/thelounge/tasks/main.yml create mode 100644 roles/thelounge/templates/thelounge.container create mode 100644 roles/thelounge/templates/thelounge.volume diff --git a/roles/thelounge/tasks/main.yml b/roles/thelounge/tasks/main.yml new file mode 100644 index 0000000..f012f02 --- /dev/null +++ b/roles/thelounge/tasks/main.yml @@ -0,0 +1,17 @@ +- name: Install the TheLounge quadlets + ansible.builtin.template: + src: "templates/{{ item }}" + dest: "/etc/containers/systemd/{{ item }}" + mode: 0644 + owner: root + group: root + loop: + - thelounge.container + - thelounge.volume + +- name: Enable the TheLounge quadlet + ansible.builtin.systemd_service: + daemon_reload: true + enabled: true + name: thelounge.service + state: "started" diff --git a/roles/thelounge/templates/thelounge.container b/roles/thelounge/templates/thelounge.container new file mode 100644 index 0000000..9effd08 --- /dev/null +++ b/roles/thelounge/templates/thelounge.container @@ -0,0 +1,16 @@ +[Unit] +Description=The Lounge + +[Container] +ContainerName=thelounge +Image=ghcr.io/thelounge/thelounge:latest + +PublishPort=9000:9000 + +Volume=thelounge-data:/var/opt/thelounge + +[Service] +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/roles/thelounge/templates/thelounge.volume b/roles/thelounge/templates/thelounge.volume new file mode 100644 index 0000000..ac04b1e --- /dev/null +++ b/roles/thelounge/templates/thelounge.volume @@ -0,0 +1,2 @@ +[Volume] +VolumeName=thelounge-data