Refactored driver-msi-keyboard-color

This commit is contained in:
Kevin Veen-Birkenbach 2024-01-10 11:47:48 +01:00
parent 992745ebf6
commit 71b76f2b35
4 changed files with 26 additions and 49 deletions

View File

@ -5,5 +5,29 @@
name: name:
- msi-perkeyrgb - msi-perkeyrgb
- include_tasks: setup_script.yml - name: Copy keyboard_color.sh script
- include_tasks: setup_timers.yml copy:
src: keyboard_color.py
dest: /opt/keyboard_color.py
mode: 0755
- name: Copy keyboard-color.cymais.service file
template:
src: keyboard-color.service.j2
dest: /etc/systemd/system/keyboard-color.cymais.service
mode: 0644
- name: Reload systemd daemon
systemd:
daemon_reload: yes
- name: set service_name to the name of the current role
set_fact:
service_name: "{{ role_name }}"
- name: "include role for systemd-timer for {{service_name}}"
include_role:
name: systemd-timer
vars:
on_calendar: "{{on_calendar_msi_keyboard_color}}"
persistent: "true"

View File

@ -1,8 +0,0 @@
---
- name: Copy keyboard_color.sh script
copy:
src: keyboard_color.py
dest: /opt/keyboard_color.py
mode: 0755
tags:
- keyboard-color

View File

@ -1,30 +0,0 @@
---
- name: Copy keyboard-color.cymais.timer file
template:
src: keyboard-color.timer.j2
dest: /etc/systemd/system/keyboard-color.cymais.timer
mode: 0644
tags:
- keyboard-color
- name: Copy keyboard-color.cymais.service file
template:
src: keyboard-color.service.j2
dest: /etc/systemd/system/keyboard-color.cymais.service
mode: 0644
tags:
- keyboard-color
- name: Reload systemd daemon
systemd:
daemon_reload: yes
tags:
- keyboard-color
- name: Enable and start keyboard-color.cymais.timer
systemd:
name: keyboard-color.cymais.timer
state: restarted
enabled: yes
tags:
- keyboard-color

View File

@ -1,9 +0,0 @@
[Unit]
Description=Keyboard Color Timer
[Timer]
OnCalendar={{on_calendar_msi_keyboard_color}}
Persistent=true
[Install]
WantedBy=timers.target