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:
0
.ansible/.lock
Normal file
0
.ansible/.lock
Normal file
@@ -32,7 +32,7 @@ Secrets are pulled from KeePassXC at run time via the `keepass` lookup
|
||||
plugin — see the header of `lookup_plugins/keepass.py` for how to enable
|
||||
Browser Integration in KeePassXC. Freshly-flashed Raspberry Pis are reached
|
||||
first with the OS-default `pi`/`raspberry` credentials (see
|
||||
`roles/pi-standard-setup`), which the role then rotates to a KeePassXC-managed
|
||||
`roles/pi_standard_setup`), which the role then rotates to a KeePassXC-managed
|
||||
password.
|
||||
|
||||
## Running a playbook
|
||||
|
||||
88
full.yml
88
full.yml
@@ -1,61 +1,63 @@
|
||||
---
|
||||
|
||||
|
||||
# - hosts: esszimmerradio
|
||||
# roles:
|
||||
# - pi-standard-setup
|
||||
# - pi-squeezelite-custom
|
||||
# - pi-shairport
|
||||
# - pi-lirc
|
||||
# - pi-sispmctl
|
||||
# - pi_standard_setup
|
||||
# - pi_squeezelite_custom
|
||||
# - pi_shairport
|
||||
# - pi_lirc
|
||||
# - pi_sispmctl
|
||||
#
|
||||
|
||||
- hosts: musikserverwohnzimmeroben
|
||||
- name: Musikserver Wohnzimmer oben
|
||||
hosts: musikserverwohnzimmeroben
|
||||
roles:
|
||||
- pi-standard-setup
|
||||
- pi-hifiberry-amp
|
||||
- pi-squeezelite-custom
|
||||
- pi-shairport
|
||||
- pi-irserver
|
||||
#- pi-dhtsensor
|
||||
- pi-squeezeserver
|
||||
- pi_standard_setup
|
||||
- pi_hifiberry_amp
|
||||
- pi_squeezelite_custom
|
||||
- pi_shairport
|
||||
- pi_irserver
|
||||
# - pi_dhtsensor
|
||||
- pi_squeezeserver
|
||||
|
||||
- hosts: kitchenpi
|
||||
- name: Kitchen pi
|
||||
hosts: kitchenpi
|
||||
roles:
|
||||
- pi-standard-setup
|
||||
- pi-hifiberry-amp
|
||||
- pi-squeezelite-custom
|
||||
- pi-shairport
|
||||
- pi-lirc
|
||||
- pi-dhtsensor
|
||||
- pi-disable-onboard-bluetooth
|
||||
- bluetooth-monitor
|
||||
- pi_standard_setup
|
||||
- pi_hifiberry_amp
|
||||
- pi_squeezelite_custom
|
||||
- pi_shairport
|
||||
- pi_lirc
|
||||
- pi_dhtsensor
|
||||
- pi_disable_onboard_bluetooth
|
||||
- bluetooth_monitor
|
||||
|
||||
- hosts: bedroompi
|
||||
- name: Bedroom pi
|
||||
hosts: bedroompi
|
||||
roles:
|
||||
- pi-standard-setup
|
||||
- pi-squeezelite-custom
|
||||
- pi-shairport
|
||||
- pi-lirc
|
||||
- pi-dhtsensor
|
||||
- pi-disable-onboard-bluetooth
|
||||
- bluetooth-monitor
|
||||
- pi_standard_setup
|
||||
- pi_squeezelite_custom
|
||||
- pi_shairport
|
||||
- pi_lirc
|
||||
- pi_dhtsensor
|
||||
- pi_disable_onboard_bluetooth
|
||||
- bluetooth_monitor
|
||||
|
||||
- hosts: musicmouse
|
||||
- name: Musicmouse
|
||||
hosts: musicmouse
|
||||
roles:
|
||||
- pi-standard-setup
|
||||
- pi-hifiberry-amp
|
||||
- pi-musicmouse
|
||||
- pi-squeezelite-custom
|
||||
- pi-shairport
|
||||
- pi-lirc
|
||||
- bluetooth-monitor
|
||||
- pi_standard_setup
|
||||
- pi_hifiberry_amp
|
||||
- pi_musicmouse
|
||||
- pi_squeezelite_custom
|
||||
- pi_shairport
|
||||
- pi_lirc
|
||||
- bluetooth_monitor
|
||||
|
||||
# - hosts: octopi
|
||||
# roles:
|
||||
# - pi-dhtsensor
|
||||
# - pi_dhtsensor
|
||||
|
||||
# - hosts: newrpi
|
||||
# roles:
|
||||
# - pi-standard-setup
|
||||
# - pi-lirc
|
||||
# - pi_standard_setup
|
||||
# - pi_lirc
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
all:
|
||||
hosts:
|
||||
server:
|
||||
ansible_host: home.bauer.tech
|
||||
ansible_port: 22187
|
||||
server2:
|
||||
|
||||
children:
|
||||
iot:
|
||||
hosts:
|
||||
@@ -76,7 +76,8 @@ all:
|
||||
squeezeserver: 192.168.178.80
|
||||
router_ip: 192.168.178.1
|
||||
home_assistant_url: https://ha.bauer.tech
|
||||
home_assistant_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkM2QxYjAwYjkxZjY0MWVhYjA4YmZhMDYwYTg3YjRhNyIsImlhdCI6MTcwNDI3MDU5MSwiZXhwIjoyMDE5NjMwNTkxfQ.dzvejgEQd9hf-Yftzd7NkR5pv76GaLFczeOy-a2pa1o
|
||||
home_assistant_token:
|
||||
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkM2QxYjAwYjkxZjY0MWVhYjA4YmZhMDYwYTg3YjRhNyIsImlhdCI6MTcwNDI3MDU5MSwiZXhwIjoyMDE5NjMwNTkxfQ.dzvejgEQd9hf-Yftzd7NkR5pv76GaLFczeOy-a2pa1o
|
||||
configure_wifi: false
|
||||
wifi_ssid: BauerWLAN
|
||||
my_btmonitor_mqtt_username: my_btmonitor
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
---
|
||||
- hosts: musicmouse
|
||||
- name: Musicmouse
|
||||
hosts: musicmouse
|
||||
roles:
|
||||
- pi-standard-setup
|
||||
- pi-hifiberry-amp
|
||||
- pi-squeezelite
|
||||
- pi-shairport
|
||||
- pi-lirc
|
||||
- pi_standard_setup
|
||||
- pi_hifiberry_amp
|
||||
- pi_squeezelite
|
||||
- pi_shairport
|
||||
- pi_lirc
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
- hosts: octopi
|
||||
---
|
||||
- name: Octopi
|
||||
hosts: octopi
|
||||
roles:
|
||||
- pi-dhtsensor
|
||||
- pi_dhtsensor
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
---
|
||||
|
||||
- hosts: kitchenpi
|
||||
- name: Install Debmatic
|
||||
hosts: kitchenpi
|
||||
tasks:
|
||||
- name: Add Key for Debmatic Repository
|
||||
apt_key:
|
||||
ansible.builtin.apt_key:
|
||||
url: https://www.debmatic.de/debmatic/public.key
|
||||
state: present
|
||||
- name: Add Debmatic Repository
|
||||
ansible.builtin.apt_repository:
|
||||
repo: deb https://www.debmatic.de/debmatic stable main
|
||||
state: present
|
||||
filename: debmatic
|
||||
- name: Install Pre-requesites
|
||||
apt:
|
||||
update_cache: yes
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
name:
|
||||
- build-essential
|
||||
- bison
|
||||
@@ -21,8 +22,8 @@
|
||||
- raspberrypi-kernel-headers
|
||||
- pivccu-modules-dkms
|
||||
- name: Reboot
|
||||
reboot:
|
||||
ansible.builtin.reboot:
|
||||
- name: Install Debmatic package
|
||||
apt:
|
||||
update_cache: no
|
||||
ansible.builtin.apt:
|
||||
update_cache: false
|
||||
name: debmatic
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# better-shell-env
|
||||
|
||||
Installs preferred CLI tooling (fish, ripgrep, fd-find, neovim, tmux, lsd,
|
||||
broot, fzf, glances, bat, duf, zoxide) and sets up `oh-my-fish` with the
|
||||
`bobthefish` theme for `main_user`.
|
||||
|
||||
**Key vars:** `main_user`
|
||||
@@ -1,3 +0,0 @@
|
||||
function dot -w git -d "Manages dotfiles"
|
||||
git --git-dir=$HOME/.dot --work-tree=$HOME $argv
|
||||
end
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
#
|
||||
- name: Install packages
|
||||
apt:
|
||||
name:
|
||||
- bat
|
||||
- broot
|
||||
- duf
|
||||
- fd-find
|
||||
- fish
|
||||
- fzf
|
||||
- git
|
||||
- glances
|
||||
- lsd
|
||||
- neovim
|
||||
- ripgrep
|
||||
- tmux
|
||||
- zoxide
|
||||
|
||||
# TODO: Dust, btm
|
||||
|
||||
block:
|
||||
become: true
|
||||
become_user: {{main_user}}
|
||||
- name: Create bin folder
|
||||
ansible.builtin.file:
|
||||
path: ~/bin
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
# Oh-my-fish
|
||||
- name: get oh-my-fish repo
|
||||
git:
|
||||
repo: 'https://github.com/oh-my-fish/oh-my-fish.git'
|
||||
dest: ~/.local/share/git/oh-my-fish
|
||||
- name: install oh-my-fish
|
||||
shell:
|
||||
cmd: "bin/install --offline --noninteractive"
|
||||
executable: /usr/bin/fish
|
||||
chdir: ~/.local/share/git/oh-my-fish
|
||||
creates:
|
||||
- ~/.local/share/omf
|
||||
- ~/.config/omf
|
||||
- copy:
|
||||
content: "bobthefish"
|
||||
dst: "~/.config/omf/theme"
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
- name: Apt install bluez, firmware and Python requirements
|
||||
apt:
|
||||
name:
|
||||
- bluez
|
||||
- bluez-firmware
|
||||
- firmware-realtek
|
||||
- firmware-realtek-rtl8723cs-bt
|
||||
- python3-pycryptodome
|
||||
- python3-bleak
|
||||
- python3-asyncio-mqtt
|
||||
- python3-numpy
|
||||
- name: Copy monitor script
|
||||
template: src=my_btmonitor.py dest=/usr/bin/my_btmonitor owner=root mode=u+rwx
|
||||
- name: Install systemd service file
|
||||
copy: src=my_btmonitor.service dest=/etc/systemd/system/
|
||||
- name: Add script to autostart and start now
|
||||
systemd: name=my_btmonitor state=restarted enabled=yes daemon_reload=yes
|
||||
#- name: Add to sysdweb
|
||||
# include_role:
|
||||
# name: pi-sysdweb
|
||||
# vars:
|
||||
# sysdweb_name: my_btmonitor
|
||||
@@ -1,4 +1,4 @@
|
||||
# bluetooth-monitor
|
||||
# bluetooth_monitor
|
||||
|
||||
Installs `my_btmonitor.py` (BLE scanning via `bleak`) as a systemd service
|
||||
that watches for nearby devices, publishes state over MQTT, and can restart
|
||||
|
Can't render this file because it is too large.
|
|
Can't render this file because it is too large.
|
33
roles/bluetooth_monitor/tasks/main.yml
Normal file
33
roles/bluetooth_monitor/tasks/main.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: Apt install bluez, firmware and Python requirements
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- bluez
|
||||
- bluez-firmware
|
||||
- firmware-realtek
|
||||
- firmware-realtek-rtl8723cs-bt
|
||||
- python3-pycryptodome
|
||||
- python3-bleak
|
||||
- python3-asyncio-mqtt
|
||||
- python3-numpy
|
||||
- name: Copy monitor script
|
||||
ansible.builtin.template:
|
||||
src: my_btmonitor.py
|
||||
dest: /usr/bin/my_btmonitor
|
||||
owner: root
|
||||
mode: u+rwx
|
||||
- name: Install systemd service file
|
||||
ansible.builtin.copy:
|
||||
src: my_btmonitor.service
|
||||
dest: /etc/systemd/system/
|
||||
- name: Add script to autostart and start now
|
||||
ansible.builtin.systemd:
|
||||
name: my_btmonitor
|
||||
state: restarted
|
||||
enabled: "yes"
|
||||
daemon_reload: "yes"
|
||||
# - name: Add to sysdweb
|
||||
# include_role:
|
||||
# name: pi_sysdweb
|
||||
# vars:
|
||||
# sysdweb_name: my_btmonitor
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
- name: Sync alsa config
|
||||
template: src=asound.conf dest=/etc/asound.conf
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
- name: apt install libgpiod2
|
||||
apt: name=libgpiod2 cache_valid_time=7200 state=present
|
||||
- name: pip install adafruit-circuitpython-dht
|
||||
pip:
|
||||
name: adafruit-circuitpython-dht
|
||||
executable: pip3
|
||||
- name: Install script config
|
||||
template: src=dht22_sensing.json dest=/etc/dht22_sensing.json
|
||||
- name: Install script
|
||||
copy: src=dht22_sensing.py dest=/usr/bin/dht22_sensing owner=root mode=u+rwx
|
||||
- name: Install systemd service file
|
||||
copy: src=dht22_sensing.service dest=/lib/systemd/system/
|
||||
- name: Add script to autostart and start now
|
||||
systemd: name=dht22_sensing state=started enabled=yes daemon_reload=yes
|
||||
- name: Add to sysdweb
|
||||
include_role:
|
||||
name: pi-sysdweb
|
||||
vars:
|
||||
sysdweb_name: dht22_sensing
|
||||
@@ -1,31 +0,0 @@
|
||||
---
|
||||
# Use the deprecated version here instead, not the new circuitpython adafruit-circuitpython-dht version
|
||||
# the new version needs a lot of CPU time and doesn't work correctly on old raspi 1
|
||||
# a copy of the deprecated repo is downloaded as zip (if it goes away)
|
||||
|
||||
- name: Uninstall libgpiod2 (circuitpython) if present
|
||||
apt: name=libgpiod2 cache_valid_time=7200 state=absent
|
||||
- name: pip uninstall adafruit-circuitpython-dht
|
||||
pip:
|
||||
name: adafruit-circuitpython-dht
|
||||
executable: pip3
|
||||
state: absent
|
||||
extra_args: "--break-system-packages"
|
||||
- name: pip install adafruit-dht
|
||||
pip:
|
||||
name: adafruit-dht
|
||||
executable: pip3
|
||||
extra_args: "--break-system-packages"
|
||||
- name: Install script config
|
||||
template: src=dht22_sensing.json dest=/etc/dht22_sensing.json
|
||||
- name: Install script
|
||||
copy: src=dht22_sensing.py dest=/usr/bin/dht22_sensing owner=root mode=u+rwx
|
||||
- name: Install systemd service file
|
||||
copy: src=dht22_sensing.service dest=/etc/systemd/system/
|
||||
- name: Add script to autostart and start now
|
||||
systemd: name=dht22_sensing state=restarted enabled=yes daemon_reload=yes
|
||||
- name: Add to sysdweb
|
||||
include_role:
|
||||
name: pi-sysdweb
|
||||
vars:
|
||||
sysdweb_name: dht22_sensing
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
- name: reboot
|
||||
reboot:
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
---
|
||||
- name: reboot
|
||||
reboot:
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: pi-alsasetup
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
- name: Copy irserver
|
||||
copy: src=irserver dest=/usr/bin/irserver mode=u+rx
|
||||
- name: Make config dir for remotes
|
||||
file: path=/usr/bin/remotes state=directory
|
||||
- name: Copy hauppauge remote
|
||||
copy: src=hauppauge.rem dest=/usr/bin/remotes/
|
||||
- name: Copy irserver systemd file
|
||||
copy: src=irserver.service dest=/lib/systemd/system/
|
||||
- name: Enable irserver autostart
|
||||
systemd: name=irserver state=restarted enabled=yes daemon_reload=yes
|
||||
- name: Add irserver to sysdweb
|
||||
include_role:
|
||||
name: pi-sysdweb
|
||||
vars:
|
||||
sysdweb_name: irserver
|
||||
@@ -1,26 +0,0 @@
|
||||
---
|
||||
- name: Install lirc
|
||||
apt:
|
||||
name: lirc
|
||||
- name: Install config file lirc_options.conf
|
||||
copy: src=lirc_options.conf dest=/etc/lirc/lirc_options.conf
|
||||
- name: Install config file lircd.conf
|
||||
copy: src=lircd.conf dest=/etc/lirc/lircd.conf
|
||||
- name: Install remote file
|
||||
copy: src=hauppauge.conf dest=/etc/lirc/hauppauge.conf
|
||||
- name: Activate overlay in boot config
|
||||
lineinfile:
|
||||
path: /boot/firmware/config.txt
|
||||
regexp: "^#?dtoverlay=gpio-ir"
|
||||
line: "dtoverlay=gpio-ir,gpio_pin=17"
|
||||
register: boot_overlay
|
||||
- name: Restart lircd
|
||||
systemd: name=lircd state=started enabled=yes daemon_reload=yes
|
||||
- name: Reboot if boot overlay changed
|
||||
reboot:
|
||||
when: boot_overlay.changed
|
||||
- name: Add to sysdweb
|
||||
include_role:
|
||||
name: pi-sysdweb
|
||||
vars:
|
||||
sysdweb_name: lircd
|
||||
@@ -1,40 +0,0 @@
|
||||
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"
|
||||
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"]
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
shairport_sync_version: "3.3.5"
|
||||
shairport_name: Unnamed Raspberry with shairport
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: pi-alsasetup
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
- name: Check if sispmctl already exists
|
||||
stat: path=/usr/bin/sispmctl
|
||||
register: sispmctl_file
|
||||
- name: Install dependencies
|
||||
apt: name="libusb-dev" cache_valid_time=7200 state=present
|
||||
- name: Copy sispmctl sources
|
||||
unarchive: src=sispmctl-4.7.tar.gz dest=/tmp
|
||||
when: sispmctl_file.stat.exists == false
|
||||
- name: Build and install
|
||||
shell: cd /tmp/sispmctl*/ && ./configure --prefix=/usr && make install
|
||||
when: sispmctl_file.stat.exists == false
|
||||
- name: Install systemd service file
|
||||
copy: src=sispmctl.service dest=/lib/systemd/system/
|
||||
- name: Add script to autostart and start now
|
||||
systemd: name=sispmctl state=started enabled=yes daemon_reload=yes
|
||||
- name: Add to sysdweb
|
||||
include_role:
|
||||
name: pi-sysdweb
|
||||
vars:
|
||||
sysdweb_name: sispmctl
|
||||
@@ -1,31 +0,0 @@
|
||||
---
|
||||
- name: Uninstall system package of squeezelite
|
||||
apt: name=squeezelite state=absent
|
||||
- name: Install dependencies
|
||||
apt:
|
||||
name:
|
||||
- libmad0
|
||||
- libmpg123-0
|
||||
- libflac12
|
||||
- libvorbisfile3
|
||||
- libfaad2
|
||||
# for building libssl-dev, libasound2-dev, libflac-dev, libvorbis-dev, libsoxr-dev, libfaad-dev, libmad0-dev, libmpg123-dev
|
||||
state: present
|
||||
cache_valid_time: 7200
|
||||
- name: Remove old config file if present
|
||||
file: path=/etc/default/squeezelite state=absent
|
||||
- name: Copy over custom compile version of squeezelite
|
||||
copy: src=squeezelite dest=/opt/squeezelite mode=700
|
||||
- name: Install systemd service file
|
||||
template: src=squeezelite.service dest=/lib/systemd/system/
|
||||
- name: Enable sysdweb autostart
|
||||
systemd: name=squeezelite state=restarted enabled=yes daemon_reload=yes
|
||||
- name: Add to sysdweb
|
||||
include_role:
|
||||
name: pi-sysdweb
|
||||
vars:
|
||||
sysdweb_name: squeezelite
|
||||
|
||||
|
||||
# build with adapted Makefile.rpi:
|
||||
#OPTS = -DRESAMPLE -DDSD -DUSE_SSL -DLINKALL -I./include -I./include/opus -I./include/alac -I/usr/local/include -s -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
squeezeserver: 192.168.178.80
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
- name: restart-squeezelite
|
||||
systemd: name=squeezelite state=restarted enabled=yes daemon_reload=yes
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: pi-alsasetup
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
- name: Apt install squeezelite package
|
||||
apt: name=squeezelite cache_valid_time=7200 state=present
|
||||
notify: restart-squeezelite
|
||||
- name: Install config file
|
||||
template: src=squeezelite.cfg dest=/etc/default/squeezelite
|
||||
notify: restart-squeezelite
|
||||
- name: Add to sysdweb
|
||||
include_role:
|
||||
name: pi-sysdweb
|
||||
vars:
|
||||
sysdweb_name: squeezelite
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
wifi_ssid: "" # put SSID here to configure wifi
|
||||
ansible_user: "root" # "User to connect with, put in 'pi' here if you connect the first time, else leave empty"
|
||||
new_hostname: "" # set this to change the hostname
|
||||
|
||||
|
||||
timezone: "Europe/Berlin"
|
||||
wifi_country: "DE"
|
||||
wifi_pass_url: "bauer_wifi" # has to be in keepass with url "wifi_pass_url"
|
||||
ansible_ssh_pass: "raspberry"
|
||||
ansible_become_password: "raspberry"
|
||||
ansible_become: yes
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
- name: restart sshd
|
||||
service:
|
||||
name: sshd
|
||||
state: restarted
|
||||
- name: reboot
|
||||
reboot:
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
---
|
||||
- name: Do apt update/upgrade
|
||||
apt: upgrade=yes update_cache=yes cache_valid_time=7200
|
||||
- name: Detect Raspi Model
|
||||
slurp: src=/sys/firmware/devicetree/base/model
|
||||
register: raspberry_model
|
||||
- name: Show Raspi Model
|
||||
debug: msg={{ raspberry_model.content | b64decode }}
|
||||
- name: Add authorized SSH key to root account
|
||||
authorized_key:
|
||||
user: root
|
||||
key: "{{ lookup('file', 'sshkey.pub') }}"
|
||||
state: present
|
||||
- name: Activate root login with key
|
||||
lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: "^#?PermitRootLogin"
|
||||
line: "PermitRootLogin prohibit-password"
|
||||
notify: restart sshd
|
||||
- name: Deactive SSH accepting locale vars (leads to warnings)
|
||||
lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: "^#?AcceptEnv LANG LC_*"
|
||||
line: "#AcceptEnv LANG LC_*"
|
||||
notify: restart sshd
|
||||
- name: Get hostname
|
||||
command: "raspi-config nonint get_hostname"
|
||||
register: pi_hostname
|
||||
changed_when: False
|
||||
- name: Change hostname {{ new_hostname }}
|
||||
command: "raspi-config nonint do_hostname {{ new_hostname }}"
|
||||
when: new_hostname | bool and pi_hostname.stdout != new_hostname
|
||||
register: set_hostname
|
||||
notify: reboot
|
||||
- name: Get hostname
|
||||
command: "raspi-config nonint get_hostname"
|
||||
register: pi_hostname
|
||||
changed_when: False
|
||||
- name: set boot mode to CLI
|
||||
command: "raspi-config nonint do_boot_behaviour B1"
|
||||
#I2 Change Timezone
|
||||
- name: Change timezone
|
||||
command: "raspi-config nonint do_change_timezone {{ timezone }}"
|
||||
- name: Change locale
|
||||
command: "raspi-config nonint do_change_locale en_US.UTF-8"
|
||||
- name: Change password of default pi account
|
||||
user:
|
||||
name: pi
|
||||
update_password: always
|
||||
password: "{{ lookup('keepass', 'ansible://default_rpi_password') | password_hash('sha512') }}"
|
||||
- name: Install Packages (vim, git, basic python stuff)
|
||||
apt:
|
||||
name:
|
||||
- vim
|
||||
- git
|
||||
- python3
|
||||
- python3-pip
|
||||
- python3-wheel
|
||||
- telnet
|
||||
cache_valid_time: 7200
|
||||
state: present
|
||||
- name: Copy vim config
|
||||
copy: src=vimrc dest=/root/.vimrc
|
||||
- name: Copy git config
|
||||
copy: src=gitconfig dest=/root/.gitconfig
|
||||
# Wifi
|
||||
- name: Get WiFi country
|
||||
command: "raspi-config nonint get_wifi_country"
|
||||
register: wifi_country
|
||||
changed_when: False
|
||||
ignore_errors: yes #to avoid error when WiFi is not present
|
||||
- name: Change WiFi country
|
||||
command: "raspi-config nonint do_wifi_country {{ wifi_country }}"
|
||||
when: configure_wifi
|
||||
- name: Set WiFi credentials
|
||||
command: "raspi-config nonint do_wifi_ssid_passphrase {{ wifi_ssid }} {{ lookup('keepass', 'bauer_wifi') }}"
|
||||
when: configure_wifi
|
||||
- name: Install watchdog
|
||||
apt: name=watchdog cache_valid_time=7200 state=present
|
||||
when: not wifi_ssid is defined
|
||||
- name: Configure watchdog
|
||||
blockinfile:
|
||||
path: /etc/watchdog.conf
|
||||
block: |
|
||||
interface = wlan0
|
||||
retry-timeout = 90
|
||||
ping = {{router_ip}}
|
||||
interval = 15
|
||||
when: configure_wifi
|
||||
- name: Start watchdog
|
||||
systemd: name=watchdog state=started enabled=yes daemon_reload=yes # state=restarted not working, also not manually
|
||||
when: configure_wifi
|
||||
# Message of the day
|
||||
- name: Set Message of the day
|
||||
copy: src=motd/{{ pi_hostname.stdout }} dest=/etc/motd
|
||||
# LED off script
|
||||
- name: Copy led off script
|
||||
copy: src=raspi-leds-off.sh dest=/usr/sbin/raspi-leds-off.sh mode="u+rwx"
|
||||
- name: Copy led off service
|
||||
copy: src=raspi-leds-off.service dest=/lib/systemd/system/
|
||||
- name: Activate led off servic
|
||||
systemd: name=raspi-leds-off state=restarted enabled=yes daemon_reload=yes
|
||||
@@ -1,3 +1,3 @@
|
||||
# pi-alsasetup
|
||||
# pi_alsasetup
|
||||
|
||||
Syncs the ALSA configuration file to the host.
|
||||
5
roles/pi_alsasetup/tasks/main.yml
Normal file
5
roles/pi_alsasetup/tasks/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: Sync alsa config
|
||||
ansible.builtin.template:
|
||||
src: asound.conf
|
||||
dest: /etc/asound.conf
|
||||
@@ -1,7 +1,7 @@
|
||||
# pi-dhtsensor
|
||||
# pi_dhtsensor
|
||||
|
||||
Installs the DHT22 temperature/humidity sensor polling script based on the
|
||||
legacy `Adafruit_DHT` library (removing the circuitpython variant/
|
||||
`libgpiod2` if present — mutually exclusive with `pi-dhtsensor-circuitpython`).
|
||||
`libgpiod2` if present — mutually exclusive with `pi_dhtsensor_circuitpython`).
|
||||
|
||||
**Key vars:** `dht_pin`, `dht_polling_sleep_time_seconds`
|
||||
46
roles/pi_dhtsensor/tasks/main.yml
Normal file
46
roles/pi_dhtsensor/tasks/main.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
# Use the deprecated version here instead, not the new circuitpython adafruit-circuitpython-dht version
|
||||
# the new version needs a lot of CPU time and doesn't work correctly on old raspi 1
|
||||
# a copy of the deprecated repo is downloaded as zip (if it goes away)
|
||||
|
||||
- name: Uninstall libgpiod2 (circuitpython) if present
|
||||
ansible.builtin.apt:
|
||||
name: libgpiod2
|
||||
cache_valid_time: "7200"
|
||||
state: absent
|
||||
- name: Pip uninstall adafruit-circuitpython-dht
|
||||
ansible.builtin.pip:
|
||||
name: adafruit-circuitpython-dht
|
||||
executable: pip3
|
||||
state: absent
|
||||
extra_args: "--break-system-packages"
|
||||
- name: Pip install adafruit-dht
|
||||
ansible.builtin.pip:
|
||||
name: adafruit-dht
|
||||
executable: pip3
|
||||
extra_args: "--break-system-packages"
|
||||
- name: Install script config
|
||||
ansible.builtin.template:
|
||||
src: dht22_sensing.json
|
||||
dest: /etc/dht22_sensing.json
|
||||
- name: Install script
|
||||
ansible.builtin.copy:
|
||||
src: dht22_sensing.py
|
||||
dest: /usr/bin/dht22_sensing
|
||||
owner: root
|
||||
mode: u+rwx
|
||||
- name: Install systemd service file
|
||||
ansible.builtin.copy:
|
||||
src: dht22_sensing.service
|
||||
dest: /etc/systemd/system/
|
||||
- name: Add script to autostart and start now
|
||||
ansible.builtin.systemd:
|
||||
name: dht22_sensing
|
||||
state: restarted
|
||||
enabled: "yes"
|
||||
daemon_reload: "yes"
|
||||
- name: Add to sysdweb
|
||||
ansible.builtin.include_role:
|
||||
name: pi_sysdweb
|
||||
vars:
|
||||
sysdweb_name: dht22_sensing
|
||||
@@ -1,8 +1,8 @@
|
||||
# pi-dhtsensor-circuitpython
|
||||
# pi_dhtsensor_circuitpython
|
||||
|
||||
Installs the DHT22 temperature/humidity sensor polling script based on
|
||||
`adafruit-circuitpython-dht` (requires `libgpiod2`) — the newer alternative
|
||||
to the `pi-dhtsensor` role's legacy `Adafruit_DHT` library. Mutually
|
||||
exclusive with `pi-dhtsensor`.
|
||||
to the `pi_dhtsensor` role's legacy `Adafruit_DHT` library. Mutually
|
||||
exclusive with `pi_dhtsensor`.
|
||||
|
||||
**Key vars:** `dht_pin`, `dht_polling_sleep_time_seconds`
|
||||
35
roles/pi_dhtsensor_circuitpython/tasks/main.yml
Normal file
35
roles/pi_dhtsensor_circuitpython/tasks/main.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
- name: Apt install libgpiod2
|
||||
ansible.builtin.apt:
|
||||
name: libgpiod2
|
||||
cache_valid_time: "7200"
|
||||
state: present
|
||||
- name: Pip install adafruit-circuitpython-dht
|
||||
ansible.builtin.pip:
|
||||
name: adafruit-circuitpython-dht
|
||||
executable: pip3
|
||||
- name: Install script config
|
||||
ansible.builtin.template:
|
||||
src: dht22_sensing.json
|
||||
dest: /etc/dht22_sensing.json
|
||||
- name: Install script
|
||||
ansible.builtin.copy:
|
||||
src: dht22_sensing.py
|
||||
dest: /usr/bin/dht22_sensing
|
||||
owner: root
|
||||
mode: u+rwx
|
||||
- name: Install systemd service file
|
||||
ansible.builtin.copy:
|
||||
src: dht22_sensing.service
|
||||
dest: /lib/systemd/system/
|
||||
- name: Add script to autostart and start now
|
||||
ansible.builtin.systemd:
|
||||
name: dht22_sensing
|
||||
state: started
|
||||
enabled: "yes"
|
||||
daemon_reload: "yes"
|
||||
- name: Add to sysdweb
|
||||
ansible.builtin.include_role:
|
||||
name: pi_sysdweb
|
||||
vars:
|
||||
sysdweb_name: dht22_sensing
|
||||
@@ -1,4 +1,4 @@
|
||||
# pi-disable-onboard-bluetooth
|
||||
# pi_disable_onboard_bluetooth
|
||||
|
||||
Disables the Pi's onboard Bluetooth radio via `dtoverlay=disable-bt` in the
|
||||
boot config, for hosts that use an external BT/audio dongle instead.
|
||||
3
roles/pi_disable_onboard_bluetooth/handlers/main.yml
Normal file
3
roles/pi_disable_onboard_bluetooth/handlers/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: Reboot
|
||||
ansible.builtin.reboot:
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: Deactivate onboard bluetooth
|
||||
lineinfile:
|
||||
ansible.builtin.lineinfile:
|
||||
path: /boot/firmware/config.txt
|
||||
regexp: "^#?dtoverlay=disable-bt"
|
||||
line: "dtoverlay=disable-bt"
|
||||
notify: reboot
|
||||
notify: Reboot
|
||||
@@ -1,4 +1,4 @@
|
||||
# pi-hifiberry-amp
|
||||
# pi_hifiberry_amp
|
||||
|
||||
Deactivates the Pi's onboard analog audio and activates a HiFiBerry
|
||||
amp/DAC overlay instead.
|
||||
3
roles/pi_hifiberry_amp/handlers/main.yml
Normal file
3
roles/pi_hifiberry_amp/handlers/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: Reboot
|
||||
ansible.builtin.reboot:
|
||||
3
roles/pi_hifiberry_amp/meta/main.yml
Normal file
3
roles/pi_hifiberry_amp/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: pi_alsasetup
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
- name: Deactivate normal audio
|
||||
lineinfile:
|
||||
ansible.builtin.lineinfile:
|
||||
path: /boot/config.txt
|
||||
regexp: "^#?dtparam=audio=on"
|
||||
line: "#dtparam=audio=on"
|
||||
notify: reboot
|
||||
notify: Reboot
|
||||
- name: Activate Hifiberry
|
||||
lineinfile:
|
||||
ansible.builtin.lineinfile:
|
||||
path: /boot/firmware/config.txt
|
||||
regexp: "^#?dtoverlay=hifiberry-amp"
|
||||
line: "dtoverlay={{ hifiberry_overlay }}"
|
||||
notify: reboot
|
||||
notify: Reboot
|
||||
@@ -1,5 +1,5 @@
|
||||
# pi-irserver
|
||||
# pi_irserver
|
||||
|
||||
Installs and configures `irserver` (with a Hauppauge remote config) as an
|
||||
autostarted systemd service for IR remote control, and registers it with
|
||||
`pi-sysdweb`.
|
||||
`pi_sysdweb`.
|
||||
29
roles/pi_irserver/tasks/main.yml
Normal file
29
roles/pi_irserver/tasks/main.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Copy irserver
|
||||
ansible.builtin.copy:
|
||||
src: irserver
|
||||
dest: /usr/bin/irserver
|
||||
mode: u+rx
|
||||
- name: Make config dir for remotes
|
||||
ansible.builtin.file:
|
||||
path: /usr/bin/remotes
|
||||
state: directory
|
||||
- name: Copy hauppauge remote
|
||||
ansible.builtin.copy:
|
||||
src: hauppauge.rem
|
||||
dest: /usr/bin/remotes/
|
||||
- name: Copy irserver systemd file
|
||||
ansible.builtin.copy:
|
||||
src: irserver.service
|
||||
dest: /lib/systemd/system/
|
||||
- name: Enable irserver autostart
|
||||
ansible.builtin.systemd:
|
||||
name: irserver
|
||||
state: restarted
|
||||
enabled: "yes"
|
||||
daemon_reload: "yes"
|
||||
- name: Add irserver to sysdweb
|
||||
ansible.builtin.include_role:
|
||||
name: pi_sysdweb
|
||||
vars:
|
||||
sysdweb_name: irserver
|
||||
@@ -1,4 +1,4 @@
|
||||
# pi-lirc
|
||||
# pi_lirc
|
||||
|
||||
Installs and configures LIRC (Linux Infrared Remote Control): package,
|
||||
`lirc_options.conf`, `lircd.conf`, a remote definition file, and the
|
||||
36
roles/pi_lirc/tasks/main.yml
Normal file
36
roles/pi_lirc/tasks/main.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Install lirc
|
||||
ansible.builtin.apt:
|
||||
name: lirc
|
||||
- name: Install config file lirc_options.conf
|
||||
ansible.builtin.copy:
|
||||
src: lirc_options.conf
|
||||
dest: /etc/lirc/lirc_options.conf
|
||||
- name: Install config file lircd.conf
|
||||
ansible.builtin.copy:
|
||||
src: lircd.conf
|
||||
dest: /etc/lirc/lircd.conf
|
||||
- name: Install remote file
|
||||
ansible.builtin.copy:
|
||||
src: hauppauge.conf
|
||||
dest: /etc/lirc/hauppauge.conf
|
||||
- name: Activate overlay in boot config
|
||||
ansible.builtin.lineinfile:
|
||||
path: /boot/firmware/config.txt
|
||||
regexp: "^#?dtoverlay=gpio-ir"
|
||||
line: "dtoverlay=gpio-ir,gpio_pin=17"
|
||||
register: boot_overlay
|
||||
- name: Restart lircd
|
||||
ansible.builtin.systemd:
|
||||
name: lircd
|
||||
state: started
|
||||
enabled: "yes"
|
||||
daemon_reload: "yes"
|
||||
- name: Reboot if boot overlay changed
|
||||
ansible.builtin.reboot:
|
||||
when: boot_overlay.changed
|
||||
- name: Add to sysdweb
|
||||
ansible.builtin.include_role:
|
||||
name: pi_sysdweb
|
||||
vars:
|
||||
sysdweb_name: lircd
|
||||
@@ -1,4 +1,4 @@
|
||||
# pi-musicmouse
|
||||
# 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"]
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Packages
|
||||
apt:
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- python3
|
||||
- python3-pip
|
||||
@@ -8,9 +8,9 @@
|
||||
- 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'
|
||||
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:
|
||||
@@ -18,19 +18,32 @@
|
||||
virtualenv: /opt/musicmouse_venv
|
||||
virtualenv_command: "/usr/bin/python3 -m venv"
|
||||
- name: Create media directory
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: /media/musicmouse
|
||||
state: directory
|
||||
- name: Install config file
|
||||
copy: src=config.yml dest=/media/musicmouse/config.yml
|
||||
ansible.builtin.copy:
|
||||
src: config.yml
|
||||
dest: /media/musicmouse/config.yml
|
||||
- name: Install systemd service file
|
||||
copy: src=musicmouse.service dest=/etc/systemd/system/
|
||||
ansible.builtin.copy:
|
||||
src: musicmouse.service
|
||||
dest: /etc/systemd/system/
|
||||
- name: Add script to autostart and start now
|
||||
systemd: name=musicmouse state=restarted enabled=yes daemon_reload=yes
|
||||
ansible.builtin.systemd:
|
||||
name: musicmouse
|
||||
state: restarted
|
||||
enabled: "yes"
|
||||
daemon_reload: "yes"
|
||||
- name: Samba setup
|
||||
copy: src=smb.conf dest=/etc/samba/
|
||||
ansible.builtin.copy:
|
||||
src: smb.conf
|
||||
dest: /etc/samba/
|
||||
- name: Restart samba
|
||||
systemd: name=smbd state=restarted enabled=yes
|
||||
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)
|
||||
@@ -1,4 +1,4 @@
|
||||
# pi-shairport
|
||||
# pi_shairport
|
||||
|
||||
Builds and installs shairport-sync (AirPlay receiver) from source, copies
|
||||
its config, and patches the systemd service to run as root.
|
||||
3
roles/pi_shairport/defaults/main.yml
Normal file
3
roles/pi_shairport/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
shairport_sync_version: "3.3.5"
|
||||
shairport_name: Unnamed Raspberry with shairport
|
||||
3
roles/pi_shairport/meta/main.yml
Normal file
3
roles/pi_shairport/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: pi_alsasetup
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Apt install dependencies
|
||||
apt:
|
||||
ansible.builtin.apt:
|
||||
cache_valid_time: 7200
|
||||
state: present
|
||||
name:
|
||||
@@ -18,21 +18,26 @@
|
||||
- libssl-dev
|
||||
- libsoxr-dev
|
||||
- name: Build and Install Shairport sync (may take a while)
|
||||
script: "build-shairport-sync.sh ${shairport_sync_version}"
|
||||
ansible.builtin.script: "build-shairport-sync.sh ${shairport_sync_version}"
|
||||
args:
|
||||
creates: /usr/local/bin/shairport-sync
|
||||
- name: Copy config
|
||||
template: src=shairport-sync.conf dest=/etc/shairport-sync.conf
|
||||
ansible.builtin.template:
|
||||
src: shairport-sync.conf
|
||||
dest: /etc/shairport-sync.conf
|
||||
- name: Modify service file to run as root
|
||||
lineinfile:
|
||||
ansible.builtin.lineinfile:
|
||||
path: /lib/systemd/system/shairport-sync.service
|
||||
regexp: "^#?User="
|
||||
line: "User=root"
|
||||
- name: Restart shairport-sync
|
||||
systemd: name=shairport-sync state=restarted enabled=yes daemon_reload=yes
|
||||
ansible.builtin.systemd:
|
||||
name: shairport-sync
|
||||
state: restarted
|
||||
enabled: "yes"
|
||||
daemon_reload: "yes"
|
||||
- name: Add to sysdweb
|
||||
include_role:
|
||||
name: pi-sysdweb
|
||||
ansible.builtin.include_role:
|
||||
name: pi_sysdweb
|
||||
vars:
|
||||
sysdweb_name: shairport-sync
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# pi-sispmctl
|
||||
# pi_sispmctl
|
||||
|
||||
Builds and installs `sispmctl` (controls Gembird SIS-PM controllable power
|
||||
strips) from source and runs it as an autostarted systemd service.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user