Add ola and foobazdmx role and add playbook for light.z9

This commit is contained in:
yuri 2022-11-11 14:10:43 +01:00
commit aefdd123a4
No known key found for this signature in database
GPG key ID: E646779AC54AEC64
16 changed files with 168 additions and 0 deletions

View file

@ -0,0 +1,5 @@
- name: Restart foobazdmx
ansible.builtin.systemd:
service: foobazdmx.service
state: restarted
daemon-reload: true

View file

@ -0,0 +1,8 @@
---
argument_specs:
main:
options:
foobazdmx__art_net_host:
description: IP oder hostname of the Art-Net server
type: str
required: true

View file

@ -0,0 +1,8 @@
---
dependencies:
- role: distribution_check
vars:
distribution_check__supported_distributions:
- name: Debian
versions:
- "11"

View file

@ -0,0 +1,38 @@
- name: Ensure apt dependencies are installed
ansible.builtin.apt:
name:
- acl
- git
- python3
- python3-pip
- python3-setuptools
- name: Ensure python peotry is installed
ansible.builtin.pip:
name: poetry
- name: Ensure foobazdmx user exists
ansible.builtin.user:
name: foobazdmx
- name: Install foobazdmx
notify: Restart foobazdmx
block:
- name: Clone foobazdmx repository
ansible.builtin.git:
repo: https://thinkcccentre-ansible:glpat-VegCzyjuDjB19SggAqm1@gitlab.hamburg.ccc.de/yuri/foobazdmx.git
dest: /opt/foobazdmx
version: f0cbb639e8574c48b777ffe5a30db4298daf54c7
- name: Install python dependencies
become_user: foobazdmx
ansible.builtin.command:
cmd: poetry install
chdir: /opt/foobazdmx
changed_when: false
- name: Generate foobazdmx service file
ansible.builtin.template:
src: foobazdmx.service.j2
dest: /etc/systemd/system/foobazdmx.service
mode: "0755"
- name: Enable and start foobazdmx service
ansible.builtin.systemd:
service: foobazdmx.service
state: started
enabled: true

View file

@ -0,0 +1,10 @@
[Unit]
Description=Foobaz DMX
[Service]
ExecStart=poetry run python foobaz.py -a {{ foobazdmx__art_net_host }} -r big
WorkingDirectory=/opt/foobazdmx
User=foobazdmx
[Install]
WantedBy=multi-user.target