Fix ansible-lint violations: FQCN, formatting, bugs, role renames
- Auto-fix FQCN, YAML formatting, jinja spacing, and free-form module syntax via ansible-lint --fix - Fix comments misplaced inside module args by the auto-fixer (bluetooth-monitor, pi_standard_setup, pi_musicmouse) - Fix notify: references left stale (lowercase) after handler names were re-cased, which would have silently broken reboot/restart handlers (pi_disable_onboard_bluetooth, pi_hifiberry_amp, pi_squeezelite, pi_standard_setup) - Fix a task in pis/debmatic-install.yml missing its module name (apt_repository), which caused a real syntax-check failure - Add missing play names, fix comment spacing, literal-compare idiom, and no-changed-when annotations - Delete unused/broken roles/better-shell-env (unreferenced, invalid YAML) - Rename all hyphenated role directories to underscore form to satisfy ansible-lint's role-name rule, updating every playbook/meta reference Remaining lint findings (var-naming, package-latest, risky-file-permissions, no-handler) intentionally left for follow-up per user decision.
This commit is contained in:
4
roles/pi_musicmouse/README.md
Normal file
4
roles/pi_musicmouse/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# pi_musicmouse
|
||||
|
||||
Deploys the "Musicmouse" application: checks out its git repo, creates a
|
||||
Python virtualenv, sets up a media directory, and installs its config file.
|
||||
40
roles/pi_musicmouse/files/config.yml
Normal file
40
roles/pi_musicmouse/files/config.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
general:
|
||||
alsa_device: softvol_effects
|
||||
mqtt:
|
||||
user: musicmouse
|
||||
password: KNLEFLZF94yA6Zhj141
|
||||
server: homeassistant
|
||||
hass_url: https://ha.bauer.tech
|
||||
hass_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4N2ExMzM2ZmQ4ZWQ0ZDgzOWZhMjU3NmZjYTg1NWQ1ZiIsImlhdCI6MTcwNDAyOTUyOSwiZXhwIjoyMDE5Mzg5NTI5fQ.vx9L5bTSey98uc8TwodShaEXSMr-hjXugPsNviR_fEw" # noqa: yaml[line-length]
|
||||
button_leds_brightness: 0.5
|
||||
volume_increment: 5
|
||||
min_volume: 23
|
||||
max_volume: 70
|
||||
serial_port: "/dev/ttyUSB0"
|
||||
|
||||
figures:
|
||||
elefant:
|
||||
id: "88041174e9"
|
||||
colors: ["#ffff00", "#00c8ff", "#094b46", "#c20099"]
|
||||
fuchs:
|
||||
id: "8804ce7230"
|
||||
colors: ["#F4D35E", "#F95738", "#F95738", "#083d77"]
|
||||
eule:
|
||||
id: "88040d71f0"
|
||||
colors: ["#e5a200", "#f8e300", "w33", "w99"]
|
||||
omnom:
|
||||
id: "88043c6ede"
|
||||
colors: ["#005102", "#fec800", "#005102", "#3bc405"]
|
||||
eichhoernchen:
|
||||
id: "88040b78ff"
|
||||
colors: ["#ff0ada", "#4BC6B9", "#69045a", "#4BC6B9"]
|
||||
hund:
|
||||
id: "8804bc7444"
|
||||
colors: ["#ffff00", "#00c8ff", "#094b46", "#c20099"]
|
||||
hase:
|
||||
id: "88044670ba"
|
||||
colors: ["#ffff00", "#00c8ff", "#094b46", "#c20099"]
|
||||
schneemann:
|
||||
id: "88043f71c2"
|
||||
colors: ["#ff0ada", "#4BC6B9", "#69045a", "#4BC6B9"]
|
||||
11
roles/pi_musicmouse/files/musicmouse.service
Normal file
11
roles/pi_musicmouse/files/musicmouse.service
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=MusicMouse Player
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/opt/musicmouse_venv/bin/python /opt/musicmouse/espmusicmouse/host_driver/main.py /media/musicmouse/
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
15
roles/pi_musicmouse/files/smb.conf
Normal file
15
roles/pi_musicmouse/files/smb.conf
Normal file
@@ -0,0 +1,15 @@
|
||||
[global]
|
||||
workgroup = WORKGROUP
|
||||
logging = syslog@1
|
||||
server role = standalone server
|
||||
obey pam restrictions = no
|
||||
unix password sync = no
|
||||
|
||||
|
||||
[MusicMouse]
|
||||
browseable = yes
|
||||
path = /media/musicmouse
|
||||
guest ok = no
|
||||
writeable = yes
|
||||
create mask = 666
|
||||
force create mode = 666
|
||||
51
roles/pi_musicmouse/tasks/main.yml
Normal file
51
roles/pi_musicmouse/tasks/main.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: Packages
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- python3
|
||||
- python3-pip
|
||||
- python3-vlc # also in venv - but this installs vlc + deps
|
||||
- samba
|
||||
- name: Checkout Musicmouse repo
|
||||
ansible.builtin.git:
|
||||
repo: "ssh://git@git.bauer.tech:2222/martin/musicmouse.git"
|
||||
dest: "/opt/musicmouse"
|
||||
version: "release/1.1"
|
||||
accept_hostkey: true
|
||||
- name: Create and update virtual env
|
||||
ansible.builtin.pip:
|
||||
requirements: /opt/musicmouse/espmusicmouse/host_driver/requirements.txt
|
||||
virtualenv: /opt/musicmouse_venv
|
||||
virtualenv_command: "/usr/bin/python3 -m venv"
|
||||
- name: Create media directory
|
||||
ansible.builtin.file:
|
||||
path: /media/musicmouse
|
||||
state: directory
|
||||
- name: Install config file
|
||||
ansible.builtin.copy:
|
||||
src: config.yml
|
||||
dest: /media/musicmouse/config.yml
|
||||
- name: Install systemd service file
|
||||
ansible.builtin.copy:
|
||||
src: musicmouse.service
|
||||
dest: /etc/systemd/system/
|
||||
- name: Add script to autostart and start now
|
||||
ansible.builtin.systemd:
|
||||
name: musicmouse
|
||||
state: restarted
|
||||
enabled: "yes"
|
||||
daemon_reload: "yes"
|
||||
- name: Samba setup
|
||||
ansible.builtin.copy:
|
||||
src: smb.conf
|
||||
dest: /etc/samba/
|
||||
- name: Restart samba
|
||||
ansible.builtin.systemd:
|
||||
name: smbd
|
||||
state: restarted
|
||||
enabled: "yes"
|
||||
# manual steps:
|
||||
# - set samba passwords with smbpasswd
|
||||
# - copy music into /media/musicmouse (or via samba share)
|
||||
# - upload host driver?
|
||||
# - manual patching of hassclient necessary :( loop has to be passed in, to not use running_event_loop
|
||||
Reference in New Issue
Block a user