From e96f25cc4de15578c894921873a8315a775cbe90 Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Mon, 26 Feb 2024 23:07:36 +0100 Subject: [PATCH] Add seconf foobazdmx for workshop --- inventories/z9/host_vars/light.yaml | 2 +- playbooks/roles/foobazdmx/tasks/main.yaml | 12 ++++++++++++ .../foobazdmx/templates/foobazdmx-shop.service.j2 | 10 ++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 playbooks/roles/foobazdmx/templates/foobazdmx-shop.service.j2 diff --git a/inventories/z9/host_vars/light.yaml b/inventories/z9/host_vars/light.yaml index d47cc2a..b77b7d2 100644 --- a/inventories/z9/host_vars/light.yaml +++ b/inventories/z9/host_vars/light.yaml @@ -1,6 +1,6 @@ foobazdmx__art_net_host: localhost foobazdmx_version: main -foobazdmx_repo_url: "https://ccchh-ansible:glpat-istRKj5ivdBs_u9Tsdbp@gitlab.hamburg.ccc.de/ccchh/foobazdmx.git" +foobazdmx_repo_url: "https://git.hamburg.ccc.de/CCCHH/foobazdmx.git" ola__configs: - name: ola-artnet content: "{{ lookup('ansible.builtin.file', 'z9/configs/light/ola/ola-artnet.conf') }}" diff --git a/playbooks/roles/foobazdmx/tasks/main.yaml b/playbooks/roles/foobazdmx/tasks/main.yaml index 407bab0..f6e6097 100644 --- a/playbooks/roles/foobazdmx/tasks/main.yaml +++ b/playbooks/roles/foobazdmx/tasks/main.yaml @@ -46,3 +46,15 @@ service: foobazdmx.service state: started enabled: true + - name: Generate foobazdmx-shop service file + become: true + ansible.builtin.template: + src: foobazdmx-shop.service.j2 + dest: /etc/systemd/system/foobazdmx-shop.service + mode: "0755" + - name: Enable and start foobazdmx-shop service + become: true + ansible.builtin.systemd: + service: foobazdmx-shop.service + state: started + enabled: true diff --git a/playbooks/roles/foobazdmx/templates/foobazdmx-shop.service.j2 b/playbooks/roles/foobazdmx/templates/foobazdmx-shop.service.j2 new file mode 100644 index 0000000..2d0f095 --- /dev/null +++ b/playbooks/roles/foobazdmx/templates/foobazdmx-shop.service.j2 @@ -0,0 +1,10 @@ +[Unit] +Description=Foobaz-Shop DMX + +[Service] +ExecStart=poetry run python foobaz.py -a {{ foobazdmx__art_net_host }} -l 8081 -r shop -u 2 +WorkingDirectory=/opt/foobazdmx +User=foobazdmx + +[Install] +WantedBy=multi-user.target