diff --git a/.ansible/.lock b/.ansible/.lock new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index bff942e..e48a0ff 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/full.yml b/full.yml index 9269c88..a362111 100644 --- a/full.yml +++ b/full.yml @@ -1,61 +1,63 @@ --- - - -#- hosts: esszimmerradio +# - 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 +# - hosts: octopi # roles: -# - pi-dhtsensor - -#- hosts: newrpi +# - pi_dhtsensor + +# - hosts: newrpi # roles: -# - pi-standard-setup -# - pi-lirc +# - pi_standard_setup +# - pi_lirc diff --git a/inventory.yml b/inventory.yml index f601d88..b8f30e1 100644 --- a/inventory.yml +++ b/inventory.yml @@ -1,10 +1,10 @@ +--- all: hosts: server: ansible_host: home.bauer.tech ansible_port: 22187 server2: - children: iot: hosts: @@ -33,7 +33,7 @@ all: esszimmerradio: # oben, eltern squeezelite_name: Esszimmer shairport_name: _Oben_Esszimmer - #alsa_card_name: Device + # alsa_card_name: Device squeezeserver: 192.168.178.100 configure_wifi: true alsa_card_name: 1 @@ -49,7 +49,7 @@ all: musicmouse: squeezelite_name: MusicMouse shairport_name: MusicMouse - alsa_card_name: sndrpihifiberry + alsa_card_name: sndrpihifiberry hifiberry_overlay: hifiberry-dacplus sensor_room_name: Kinderzimmer sensor_room_name_ascii: kinderzimmer @@ -60,7 +60,7 @@ all: alsa_card_name: 0 sensor_room_name_ascii: testraum sensor_room_name: Test Raum - heatingpi: + heatingpi: server: sensor_room_name: Arbeitszimmer sensor_room_name_ascii: arbeitszimmer @@ -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 diff --git a/newrpi-provisioning.yml b/newrpi-provisioning.yml index aa0936f..54d0927 100644 --- a/newrpi-provisioning.yml +++ b/newrpi-provisioning.yml @@ -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 diff --git a/octopisetup.yml b/octopisetup.yml index 7a32cc7..e542f1f 100644 --- a/octopisetup.yml +++ b/octopisetup.yml @@ -1,3 +1,5 @@ -- hosts: octopi +--- +- name: Octopi + hosts: octopi roles: - - pi-dhtsensor + - pi_dhtsensor diff --git a/pis/debmatic-install.yml b/pis/debmatic-install.yml index 0f9dc1c..0d0600c 100644 --- a/pis/debmatic-install.yml +++ b/pis/debmatic-install.yml @@ -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 - repo: deb https://www.debmatic.de/debmatic stable main - state: present - filename: debmatic + 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 diff --git a/roles/better-shell-env/README.md b/roles/better-shell-env/README.md deleted file mode 100644 index fa71af0..0000000 --- a/roles/better-shell-env/README.md +++ /dev/null @@ -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` diff --git a/roles/better-shell-env/tasks/files/dot.fish b/roles/better-shell-env/tasks/files/dot.fish deleted file mode 100644 index 304b0dd..0000000 --- a/roles/better-shell-env/tasks/files/dot.fish +++ /dev/null @@ -1,3 +0,0 @@ -function dot -w git -d "Manages dotfiles" - git --git-dir=$HOME/.dot --work-tree=$HOME $argv -end \ No newline at end of file diff --git a/roles/better-shell-env/tasks/main.yml b/roles/better-shell-env/tasks/main.yml deleted file mode 100644 index 1f3f032..0000000 --- a/roles/better-shell-env/tasks/main.yml +++ /dev/null @@ -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" - diff --git a/roles/bluetooth-monitor/tasks/main.yml b/roles/bluetooth-monitor/tasks/main.yml deleted file mode 100644 index 12355fe..0000000 --- a/roles/bluetooth-monitor/tasks/main.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/roles/bluetooth-monitor/README.md b/roles/bluetooth_monitor/README.md similarity index 96% rename from roles/bluetooth-monitor/README.md rename to roles/bluetooth_monitor/README.md index ccff2ab..c6e4086 100644 --- a/roles/bluetooth-monitor/README.md +++ b/roles/bluetooth_monitor/README.md @@ -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 diff --git a/roles/bluetooth-monitor/files/filter.cpp b/roles/bluetooth_monitor/files/filter.cpp similarity index 100% rename from roles/bluetooth-monitor/files/filter.cpp rename to roles/bluetooth_monitor/files/filter.cpp diff --git a/roles/bluetooth-monitor/files/filter.py b/roles/bluetooth_monitor/files/filter.py similarity index 100% rename from roles/bluetooth-monitor/files/filter.py rename to roles/bluetooth_monitor/files/filter.py diff --git a/roles/bluetooth-monitor/files/filtered b/roles/bluetooth_monitor/files/filtered similarity index 100% rename from roles/bluetooth-monitor/files/filtered rename to roles/bluetooth_monitor/files/filtered diff --git a/roles/bluetooth-monitor/files/my_btmonitor.service b/roles/bluetooth_monitor/files/my_btmonitor.service similarity index 100% rename from roles/bluetooth-monitor/files/my_btmonitor.service rename to roles/bluetooth_monitor/files/my_btmonitor.service diff --git a/roles/bluetooth-monitor/other/Dockerfile b/roles/bluetooth_monitor/other/Dockerfile similarity index 100% rename from roles/bluetooth-monitor/other/Dockerfile rename to roles/bluetooth_monitor/other/Dockerfile diff --git a/roles/bluetooth-monitor/other/analysis.py b/roles/bluetooth_monitor/other/analysis.py similarity index 100% rename from roles/bluetooth-monitor/other/analysis.py rename to roles/bluetooth_monitor/other/analysis.py diff --git a/roles/bluetooth-monitor/other/bt_monitor_analyze.ipynb b/roles/bluetooth_monitor/other/bt_monitor_analyze.ipynb similarity index 100% rename from roles/bluetooth-monitor/other/bt_monitor_analyze.ipynb rename to roles/bluetooth_monitor/other/bt_monitor_analyze.ipynb diff --git a/roles/bluetooth-monitor/other/bt_monitor_server.py b/roles/bluetooth_monitor/other/bt_monitor_server.py similarity index 100% rename from roles/bluetooth-monitor/other/bt_monitor_server.py rename to roles/bluetooth_monitor/other/bt_monitor_server.py diff --git a/roles/bluetooth-monitor/other/collected_backup.csv b/roles/bluetooth_monitor/other/collected_backup.csv similarity index 100% rename from roles/bluetooth-monitor/other/collected_backup.csv rename to roles/bluetooth_monitor/other/collected_backup.csv diff --git a/roles/bluetooth-monitor/other/requirements.txt b/roles/bluetooth_monitor/other/requirements.txt similarity index 100% rename from roles/bluetooth-monitor/other/requirements.txt rename to roles/bluetooth_monitor/other/requirements.txt diff --git a/roles/bluetooth-monitor/other/training_data.csv b/roles/bluetooth_monitor/other/training_data.csv similarity index 100% rename from roles/bluetooth-monitor/other/training_data.csv rename to roles/bluetooth_monitor/other/training_data.csv diff --git a/roles/bluetooth_monitor/tasks/main.yml b/roles/bluetooth_monitor/tasks/main.yml new file mode 100644 index 0000000..11e9da7 --- /dev/null +++ b/roles/bluetooth_monitor/tasks/main.yml @@ -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 diff --git a/roles/bluetooth-monitor/templates/my_btmonitor.py b/roles/bluetooth_monitor/templates/my_btmonitor.py similarity index 100% rename from roles/bluetooth-monitor/templates/my_btmonitor.py rename to roles/bluetooth_monitor/templates/my_btmonitor.py diff --git a/roles/pi-alsasetup/tasks/main.yml b/roles/pi-alsasetup/tasks/main.yml deleted file mode 100644 index 4c7b059..0000000 --- a/roles/pi-alsasetup/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: Sync alsa config - template: src=asound.conf dest=/etc/asound.conf diff --git a/roles/pi-dhtsensor-circuitpython/tasks/main.yml b/roles/pi-dhtsensor-circuitpython/tasks/main.yml deleted file mode 100644 index b959448..0000000 --- a/roles/pi-dhtsensor-circuitpython/tasks/main.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/roles/pi-dhtsensor/tasks/main.yml b/roles/pi-dhtsensor/tasks/main.yml deleted file mode 100644 index 45e3778..0000000 --- a/roles/pi-dhtsensor/tasks/main.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/roles/pi-disable-onboard-bluetooth/handlers/main.yml b/roles/pi-disable-onboard-bluetooth/handlers/main.yml deleted file mode 100644 index 173576f..0000000 --- a/roles/pi-disable-onboard-bluetooth/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: reboot - reboot: - diff --git a/roles/pi-hifiberry-amp/handlers/main.yml b/roles/pi-hifiberry-amp/handlers/main.yml deleted file mode 100644 index 173576f..0000000 --- a/roles/pi-hifiberry-amp/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: reboot - reboot: - diff --git a/roles/pi-hifiberry-amp/meta/main.yml b/roles/pi-hifiberry-amp/meta/main.yml deleted file mode 100644 index d73d575..0000000 --- a/roles/pi-hifiberry-amp/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - role: pi-alsasetup \ No newline at end of file diff --git a/roles/pi-irserver/tasks/main.yml b/roles/pi-irserver/tasks/main.yml deleted file mode 100644 index c7eada3..0000000 --- a/roles/pi-irserver/tasks/main.yml +++ /dev/null @@ -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 diff --git a/roles/pi-lirc/tasks/main.yml b/roles/pi-lirc/tasks/main.yml deleted file mode 100644 index 3146875..0000000 --- a/roles/pi-lirc/tasks/main.yml +++ /dev/null @@ -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 diff --git a/roles/pi-musicmouse/files/config.yml b/roles/pi-musicmouse/files/config.yml deleted file mode 100644 index 71454ce..0000000 --- a/roles/pi-musicmouse/files/config.yml +++ /dev/null @@ -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"] - diff --git a/roles/pi-shairport/defaults/main.yml b/roles/pi-shairport/defaults/main.yml deleted file mode 100644 index 5464208..0000000 --- a/roles/pi-shairport/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -shairport_sync_version: "3.3.5" -shairport_name: Unnamed Raspberry with shairport \ No newline at end of file diff --git a/roles/pi-shairport/meta/main.yml b/roles/pi-shairport/meta/main.yml deleted file mode 100644 index d73d575..0000000 --- a/roles/pi-shairport/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - role: pi-alsasetup \ No newline at end of file diff --git a/roles/pi-sispmctl/tasks/main.yml b/roles/pi-sispmctl/tasks/main.yml deleted file mode 100644 index 5f64764..0000000 --- a/roles/pi-sispmctl/tasks/main.yml +++ /dev/null @@ -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 diff --git a/roles/pi-squeezelite-custom/tasks/main.yml b/roles/pi-squeezelite-custom/tasks/main.yml deleted file mode 100644 index 13e91ed..0000000 --- a/roles/pi-squeezelite-custom/tasks/main.yml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/roles/pi-squeezelite/defaults/main.yml b/roles/pi-squeezelite/defaults/main.yml deleted file mode 100644 index 1f1eb58..0000000 --- a/roles/pi-squeezelite/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -squeezeserver: 192.168.178.80 \ No newline at end of file diff --git a/roles/pi-squeezelite/handlers/main.yml b/roles/pi-squeezelite/handlers/main.yml deleted file mode 100644 index 6e93ead..0000000 --- a/roles/pi-squeezelite/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: restart-squeezelite - systemd: name=squeezelite state=restarted enabled=yes daemon_reload=yes diff --git a/roles/pi-squeezelite/meta/main.yml b/roles/pi-squeezelite/meta/main.yml deleted file mode 100644 index d73d575..0000000 --- a/roles/pi-squeezelite/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - role: pi-alsasetup \ No newline at end of file diff --git a/roles/pi-squeezelite/tasks/main.yml b/roles/pi-squeezelite/tasks/main.yml deleted file mode 100644 index b074630..0000000 --- a/roles/pi-squeezelite/tasks/main.yml +++ /dev/null @@ -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 - \ No newline at end of file diff --git a/roles/pi-standard-setup/defaults/main.yml b/roles/pi-standard-setup/defaults/main.yml deleted file mode 100644 index 837d414..0000000 --- a/roles/pi-standard-setup/defaults/main.yml +++ /dev/null @@ -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 - diff --git a/roles/pi-standard-setup/handlers/main.yml b/roles/pi-standard-setup/handlers/main.yml deleted file mode 100644 index 24946f0..0000000 --- a/roles/pi-standard-setup/handlers/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: restart sshd - service: - name: sshd - state: restarted -- name: reboot - reboot: - diff --git a/roles/pi-standard-setup/tasks/main.yml b/roles/pi-standard-setup/tasks/main.yml deleted file mode 100644 index 335c17c..0000000 --- a/roles/pi-standard-setup/tasks/main.yml +++ /dev/null @@ -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 diff --git a/roles/pi-alsasetup/README.md b/roles/pi_alsasetup/README.md similarity index 76% rename from roles/pi-alsasetup/README.md rename to roles/pi_alsasetup/README.md index 458a41c..399e25c 100644 --- a/roles/pi-alsasetup/README.md +++ b/roles/pi_alsasetup/README.md @@ -1,3 +1,3 @@ -# pi-alsasetup +# pi_alsasetup Syncs the ALSA configuration file to the host. diff --git a/roles/pi_alsasetup/tasks/main.yml b/roles/pi_alsasetup/tasks/main.yml new file mode 100644 index 0000000..51a94ae --- /dev/null +++ b/roles/pi_alsasetup/tasks/main.yml @@ -0,0 +1,5 @@ +--- +- name: Sync alsa config + ansible.builtin.template: + src: asound.conf + dest: /etc/asound.conf diff --git a/roles/pi-alsasetup/templates/asound.conf b/roles/pi_alsasetup/templates/asound.conf similarity index 100% rename from roles/pi-alsasetup/templates/asound.conf rename to roles/pi_alsasetup/templates/asound.conf diff --git a/roles/pi-dhtsensor/Adafruit_Python_DHT-master.zip b/roles/pi_dhtsensor/Adafruit_Python_DHT-master.zip similarity index 100% rename from roles/pi-dhtsensor/Adafruit_Python_DHT-master.zip rename to roles/pi_dhtsensor/Adafruit_Python_DHT-master.zip diff --git a/roles/pi-dhtsensor/README.md b/roles/pi_dhtsensor/README.md similarity index 67% rename from roles/pi-dhtsensor/README.md rename to roles/pi_dhtsensor/README.md index f320967..c897653 100644 --- a/roles/pi-dhtsensor/README.md +++ b/roles/pi_dhtsensor/README.md @@ -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` diff --git a/roles/pi-dhtsensor/defaults/main.yml b/roles/pi_dhtsensor/defaults/main.yml similarity index 100% rename from roles/pi-dhtsensor/defaults/main.yml rename to roles/pi_dhtsensor/defaults/main.yml diff --git a/roles/pi-dhtsensor/files/dht22_sensing.py b/roles/pi_dhtsensor/files/dht22_sensing.py similarity index 100% rename from roles/pi-dhtsensor/files/dht22_sensing.py rename to roles/pi_dhtsensor/files/dht22_sensing.py diff --git a/roles/pi-dhtsensor/files/dht22_sensing.service b/roles/pi_dhtsensor/files/dht22_sensing.service similarity index 100% rename from roles/pi-dhtsensor/files/dht22_sensing.service rename to roles/pi_dhtsensor/files/dht22_sensing.service diff --git a/roles/pi_dhtsensor/tasks/main.yml b/roles/pi_dhtsensor/tasks/main.yml new file mode 100644 index 0000000..3030b22 --- /dev/null +++ b/roles/pi_dhtsensor/tasks/main.yml @@ -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 diff --git a/roles/pi-dhtsensor-circuitpython/templates/dht22_sensing.json b/roles/pi_dhtsensor/templates/dht22_sensing.json similarity index 100% rename from roles/pi-dhtsensor-circuitpython/templates/dht22_sensing.json rename to roles/pi_dhtsensor/templates/dht22_sensing.json diff --git a/roles/pi-dhtsensor-circuitpython/README.md b/roles/pi_dhtsensor_circuitpython/README.md similarity index 63% rename from roles/pi-dhtsensor-circuitpython/README.md rename to roles/pi_dhtsensor_circuitpython/README.md index 92f02e5..24faaef 100644 --- a/roles/pi-dhtsensor-circuitpython/README.md +++ b/roles/pi_dhtsensor_circuitpython/README.md @@ -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` diff --git a/roles/pi-dhtsensor-circuitpython/defaults/main.yml b/roles/pi_dhtsensor_circuitpython/defaults/main.yml similarity index 100% rename from roles/pi-dhtsensor-circuitpython/defaults/main.yml rename to roles/pi_dhtsensor_circuitpython/defaults/main.yml diff --git a/roles/pi-dhtsensor-circuitpython/files/dht22_sensing.py b/roles/pi_dhtsensor_circuitpython/files/dht22_sensing.py similarity index 100% rename from roles/pi-dhtsensor-circuitpython/files/dht22_sensing.py rename to roles/pi_dhtsensor_circuitpython/files/dht22_sensing.py diff --git a/roles/pi-dhtsensor-circuitpython/files/dht22_sensing.service b/roles/pi_dhtsensor_circuitpython/files/dht22_sensing.service similarity index 100% rename from roles/pi-dhtsensor-circuitpython/files/dht22_sensing.service rename to roles/pi_dhtsensor_circuitpython/files/dht22_sensing.service diff --git a/roles/pi_dhtsensor_circuitpython/tasks/main.yml b/roles/pi_dhtsensor_circuitpython/tasks/main.yml new file mode 100644 index 0000000..911fd59 --- /dev/null +++ b/roles/pi_dhtsensor_circuitpython/tasks/main.yml @@ -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 diff --git a/roles/pi-dhtsensor/templates/dht22_sensing.json b/roles/pi_dhtsensor_circuitpython/templates/dht22_sensing.json similarity index 100% rename from roles/pi-dhtsensor/templates/dht22_sensing.json rename to roles/pi_dhtsensor_circuitpython/templates/dht22_sensing.json diff --git a/roles/pi-disable-onboard-bluetooth/README.md b/roles/pi_disable_onboard_bluetooth/README.md similarity index 82% rename from roles/pi-disable-onboard-bluetooth/README.md rename to roles/pi_disable_onboard_bluetooth/README.md index 1a79b85..d791b5a 100644 --- a/roles/pi-disable-onboard-bluetooth/README.md +++ b/roles/pi_disable_onboard_bluetooth/README.md @@ -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. diff --git a/roles/pi_disable_onboard_bluetooth/handlers/main.yml b/roles/pi_disable_onboard_bluetooth/handlers/main.yml new file mode 100644 index 0000000..a8f18bd --- /dev/null +++ b/roles/pi_disable_onboard_bluetooth/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: Reboot + ansible.builtin.reboot: diff --git a/roles/pi-disable-onboard-bluetooth/tasks/main.yml b/roles/pi_disable_onboard_bluetooth/tasks/main.yml similarity index 75% rename from roles/pi-disable-onboard-bluetooth/tasks/main.yml rename to roles/pi_disable_onboard_bluetooth/tasks/main.yml index dcc4bbf..cc7d963 100644 --- a/roles/pi-disable-onboard-bluetooth/tasks/main.yml +++ b/roles/pi_disable_onboard_bluetooth/tasks/main.yml @@ -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 \ No newline at end of file + notify: Reboot diff --git a/roles/pi-hifiberry-amp/README.md b/roles/pi_hifiberry_amp/README.md similarity index 87% rename from roles/pi-hifiberry-amp/README.md rename to roles/pi_hifiberry_amp/README.md index b0cf9a8..1986516 100644 --- a/roles/pi-hifiberry-amp/README.md +++ b/roles/pi_hifiberry_amp/README.md @@ -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. diff --git a/roles/pi_hifiberry_amp/handlers/main.yml b/roles/pi_hifiberry_amp/handlers/main.yml new file mode 100644 index 0000000..a8f18bd --- /dev/null +++ b/roles/pi_hifiberry_amp/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: Reboot + ansible.builtin.reboot: diff --git a/roles/pi_hifiberry_amp/meta/main.yml b/roles/pi_hifiberry_amp/meta/main.yml new file mode 100644 index 0000000..1843a33 --- /dev/null +++ b/roles/pi_hifiberry_amp/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: pi_alsasetup diff --git a/roles/pi-hifiberry-amp/tasks/main.yml b/roles/pi_hifiberry_amp/tasks/main.yml similarity index 62% rename from roles/pi-hifiberry-amp/tasks/main.yml rename to roles/pi_hifiberry_amp/tasks/main.yml index 36ba7bc..704271e 100644 --- a/roles/pi-hifiberry-amp/tasks/main.yml +++ b/roles/pi_hifiberry_amp/tasks/main.yml @@ -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 + line: "dtoverlay={{ hifiberry_overlay }}" + notify: Reboot diff --git a/roles/pi-irserver/README.md b/roles/pi_irserver/README.md similarity index 84% rename from roles/pi-irserver/README.md rename to roles/pi_irserver/README.md index 843cc06..fea98a7 100644 --- a/roles/pi-irserver/README.md +++ b/roles/pi_irserver/README.md @@ -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`. diff --git a/roles/pi-irserver/files/hauppauge.rem b/roles/pi_irserver/files/hauppauge.rem similarity index 100% rename from roles/pi-irserver/files/hauppauge.rem rename to roles/pi_irserver/files/hauppauge.rem diff --git a/roles/pi-irserver/files/irserver b/roles/pi_irserver/files/irserver similarity index 100% rename from roles/pi-irserver/files/irserver rename to roles/pi_irserver/files/irserver diff --git a/roles/pi-irserver/files/irserver-src.tar.gz b/roles/pi_irserver/files/irserver-src.tar.gz similarity index 100% rename from roles/pi-irserver/files/irserver-src.tar.gz rename to roles/pi_irserver/files/irserver-src.tar.gz diff --git a/roles/pi-irserver/files/irserver.readme b/roles/pi_irserver/files/irserver.readme similarity index 100% rename from roles/pi-irserver/files/irserver.readme rename to roles/pi_irserver/files/irserver.readme diff --git a/roles/pi-irserver/files/irserver.service b/roles/pi_irserver/files/irserver.service similarity index 100% rename from roles/pi-irserver/files/irserver.service rename to roles/pi_irserver/files/irserver.service diff --git a/roles/pi-irserver/files/irserver_old b/roles/pi_irserver/files/irserver_old similarity index 100% rename from roles/pi-irserver/files/irserver_old rename to roles/pi_irserver/files/irserver_old diff --git a/roles/pi_irserver/tasks/main.yml b/roles/pi_irserver/tasks/main.yml new file mode 100644 index 0000000..256d59d --- /dev/null +++ b/roles/pi_irserver/tasks/main.yml @@ -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 diff --git a/roles/pi-lirc/README.md b/roles/pi_lirc/README.md similarity index 94% rename from roles/pi-lirc/README.md rename to roles/pi_lirc/README.md index 1d96863..7e5828d 100644 --- a/roles/pi-lirc/README.md +++ b/roles/pi_lirc/README.md @@ -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 diff --git a/roles/pi-lirc/files/71-lirc.rules b/roles/pi_lirc/files/71-lirc.rules similarity index 100% rename from roles/pi-lirc/files/71-lirc.rules rename to roles/pi_lirc/files/71-lirc.rules diff --git a/roles/pi-lirc/files/debs/liblirc0_0.10.1-5.2_armhf.deb b/roles/pi_lirc/files/debs/liblirc0_0.10.1-5.2_armhf.deb similarity index 100% rename from roles/pi-lirc/files/debs/liblirc0_0.10.1-5.2_armhf.deb rename to roles/pi_lirc/files/debs/liblirc0_0.10.1-5.2_armhf.deb diff --git a/roles/pi-lirc/files/debs/liblircclient0_0.10.1-5.2_armhf.deb b/roles/pi_lirc/files/debs/liblircclient0_0.10.1-5.2_armhf.deb similarity index 100% rename from roles/pi-lirc/files/debs/liblircclient0_0.10.1-5.2_armhf.deb rename to roles/pi_lirc/files/debs/liblircclient0_0.10.1-5.2_armhf.deb diff --git a/roles/pi-lirc/files/debs/lirc_0.10.1-5.2_armhf.deb b/roles/pi_lirc/files/debs/lirc_0.10.1-5.2_armhf.deb similarity index 100% rename from roles/pi-lirc/files/debs/lirc_0.10.1-5.2_armhf.deb rename to roles/pi_lirc/files/debs/lirc_0.10.1-5.2_armhf.deb diff --git a/roles/pi-lirc/files/hauppauge.conf b/roles/pi_lirc/files/hauppauge.conf similarity index 100% rename from roles/pi-lirc/files/hauppauge.conf rename to roles/pi_lirc/files/hauppauge.conf diff --git a/roles/pi-lirc/files/lirc_options.conf b/roles/pi_lirc/files/lirc_options.conf similarity index 100% rename from roles/pi-lirc/files/lirc_options.conf rename to roles/pi_lirc/files/lirc_options.conf diff --git a/roles/pi-lirc/files/lircd.conf b/roles/pi_lirc/files/lircd.conf similarity index 100% rename from roles/pi-lirc/files/lircd.conf rename to roles/pi_lirc/files/lircd.conf diff --git a/roles/pi-lirc/files/small_led_remote.conf b/roles/pi_lirc/files/small_led_remote.conf similarity index 100% rename from roles/pi-lirc/files/small_led_remote.conf rename to roles/pi_lirc/files/small_led_remote.conf diff --git a/roles/pi_lirc/tasks/main.yml b/roles/pi_lirc/tasks/main.yml new file mode 100644 index 0000000..5d15429 --- /dev/null +++ b/roles/pi_lirc/tasks/main.yml @@ -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 diff --git a/roles/pi-musicmouse/README.md b/roles/pi_musicmouse/README.md similarity index 90% rename from roles/pi-musicmouse/README.md rename to roles/pi_musicmouse/README.md index c72700f..f00b787 100644 --- a/roles/pi-musicmouse/README.md +++ b/roles/pi_musicmouse/README.md @@ -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. diff --git a/roles/pi_musicmouse/files/config.yml b/roles/pi_musicmouse/files/config.yml new file mode 100644 index 0000000..b5b348b --- /dev/null +++ b/roles/pi_musicmouse/files/config.yml @@ -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"] diff --git a/roles/pi-musicmouse/files/musicmouse.service b/roles/pi_musicmouse/files/musicmouse.service similarity index 100% rename from roles/pi-musicmouse/files/musicmouse.service rename to roles/pi_musicmouse/files/musicmouse.service diff --git a/roles/pi-musicmouse/files/smb.conf b/roles/pi_musicmouse/files/smb.conf similarity index 100% rename from roles/pi-musicmouse/files/smb.conf rename to roles/pi_musicmouse/files/smb.conf diff --git a/roles/pi-musicmouse/tasks/main.yml b/roles/pi_musicmouse/tasks/main.yml similarity index 59% rename from roles/pi-musicmouse/tasks/main.yml rename to roles/pi_musicmouse/tasks/main.yml index 93e1911..47e428e 100644 --- a/roles/pi-musicmouse/tasks/main.yml +++ b/roles/pi_musicmouse/tasks/main.yml @@ -1,16 +1,16 @@ --- - name: Packages - apt: - name: + 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' + 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,20 +18,33 @@ 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 -# manual steps: + 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? diff --git a/roles/pi-shairport/README.md b/roles/pi_shairport/README.md similarity index 92% rename from roles/pi-shairport/README.md rename to roles/pi_shairport/README.md index 7a4d8f7..55afa81 100644 --- a/roles/pi-shairport/README.md +++ b/roles/pi_shairport/README.md @@ -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. diff --git a/roles/pi_shairport/defaults/main.yml b/roles/pi_shairport/defaults/main.yml new file mode 100644 index 0000000..e241a02 --- /dev/null +++ b/roles/pi_shairport/defaults/main.yml @@ -0,0 +1,3 @@ +--- +shairport_sync_version: "3.3.5" +shairport_name: Unnamed Raspberry with shairport diff --git a/roles/pi-shairport/files/build-shairport-sync.sh b/roles/pi_shairport/files/build-shairport-sync.sh similarity index 100% rename from roles/pi-shairport/files/build-shairport-sync.sh rename to roles/pi_shairport/files/build-shairport-sync.sh diff --git a/roles/pi_shairport/meta/main.yml b/roles/pi_shairport/meta/main.yml new file mode 100644 index 0000000..1843a33 --- /dev/null +++ b/roles/pi_shairport/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: pi_alsasetup diff --git a/roles/pi-shairport/tasks/main.yml b/roles/pi_shairport/tasks/main.yml similarity index 64% rename from roles/pi-shairport/tasks/main.yml rename to roles/pi_shairport/tasks/main.yml index 53e9558..28b6db9 100644 --- a/roles/pi-shairport/tasks/main.yml +++ b/roles/pi_shairport/tasks/main.yml @@ -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 - \ No newline at end of file diff --git a/roles/pi-shairport/templates/shairport-sync.conf b/roles/pi_shairport/templates/shairport-sync.conf similarity index 100% rename from roles/pi-shairport/templates/shairport-sync.conf rename to roles/pi_shairport/templates/shairport-sync.conf diff --git a/roles/pi-sispmctl/README.md b/roles/pi_sispmctl/README.md similarity index 91% rename from roles/pi-sispmctl/README.md rename to roles/pi_sispmctl/README.md index 29205ba..9b4b380 100644 --- a/roles/pi-sispmctl/README.md +++ b/roles/pi_sispmctl/README.md @@ -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. diff --git a/roles/pi-sispmctl/files/sispmctl-4.7.tar.gz b/roles/pi_sispmctl/files/sispmctl-4.7.tar.gz similarity index 100% rename from roles/pi-sispmctl/files/sispmctl-4.7.tar.gz rename to roles/pi_sispmctl/files/sispmctl-4.7.tar.gz diff --git a/roles/pi-sispmctl/files/sispmctl.service b/roles/pi_sispmctl/files/sispmctl.service similarity index 100% rename from roles/pi-sispmctl/files/sispmctl.service rename to roles/pi_sispmctl/files/sispmctl.service diff --git a/roles/pi_sispmctl/tasks/main.yml b/roles/pi_sispmctl/tasks/main.yml new file mode 100644 index 0000000..2c431b6 --- /dev/null +++ b/roles/pi_sispmctl/tasks/main.yml @@ -0,0 +1,34 @@ +--- +- name: Check if sispmctl already exists + ansible.builtin.stat: + path: /usr/bin/sispmctl + register: sispmctl_file +- name: Install dependencies + ansible.builtin.apt: + name: "libusb-dev" + cache_valid_time: "7200" + state: present +- name: Copy sispmctl sources + ansible.builtin.unarchive: + src: sispmctl-4.7.tar.gz + dest: /tmp + when: not sispmctl_file.stat.exists +- name: Build and install + ansible.builtin.shell: cd /tmp/sispmctl*/ && ./configure --prefix=/usr && make install + when: not sispmctl_file.stat.exists + changed_when: true +- name: Install systemd service file + ansible.builtin.copy: + src: sispmctl.service + dest: /lib/systemd/system/ +- name: Add script to autostart and start now + ansible.builtin.systemd: + name: sispmctl + state: started + enabled: "yes" + daemon_reload: "yes" +- name: Add to sysdweb + ansible.builtin.include_role: + name: pi_sysdweb + vars: + sysdweb_name: sispmctl diff --git a/roles/pi-squeezelite/README.md b/roles/pi_squeezelite/README.md similarity index 58% rename from roles/pi-squeezelite/README.md rename to roles/pi_squeezelite/README.md index 54fbcc0..11d8720 100644 --- a/roles/pi-squeezelite/README.md +++ b/roles/pi_squeezelite/README.md @@ -1,6 +1,6 @@ -# pi-squeezelite +# pi_squeezelite Installs the distro-packaged `squeezelite` client (Logitech Media Server -player), installs its config file, and registers it with `pi-sysdweb`. +player), installs its config file, and registers it with `pi_sysdweb`. **Key vars:** `squeezeserver` diff --git a/roles/pi_squeezelite/defaults/main.yml b/roles/pi_squeezelite/defaults/main.yml new file mode 100644 index 0000000..93e415c --- /dev/null +++ b/roles/pi_squeezelite/defaults/main.yml @@ -0,0 +1,2 @@ +--- +squeezeserver: 192.168.178.80 diff --git a/roles/pi_squeezelite/handlers/main.yml b/roles/pi_squeezelite/handlers/main.yml new file mode 100644 index 0000000..e9a67fc --- /dev/null +++ b/roles/pi_squeezelite/handlers/main.yml @@ -0,0 +1,7 @@ +--- +- name: Restart-squeezelite + ansible.builtin.systemd: + name: squeezelite + state: restarted + enabled: "yes" + daemon_reload: "yes" diff --git a/roles/pi_squeezelite/meta/main.yml b/roles/pi_squeezelite/meta/main.yml new file mode 100644 index 0000000..1843a33 --- /dev/null +++ b/roles/pi_squeezelite/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: pi_alsasetup diff --git a/roles/pi_squeezelite/tasks/main.yml b/roles/pi_squeezelite/tasks/main.yml new file mode 100644 index 0000000..41e67a7 --- /dev/null +++ b/roles/pi_squeezelite/tasks/main.yml @@ -0,0 +1,17 @@ +--- +- name: Apt install squeezelite package + ansible.builtin.apt: + name: squeezelite + cache_valid_time: "7200" + state: present + notify: Restart-squeezelite +- name: Install config file + ansible.builtin.template: + src: squeezelite.cfg + dest: /etc/default/squeezelite + notify: Restart-squeezelite +- name: Add to sysdweb + ansible.builtin.include_role: + name: pi_sysdweb + vars: + sysdweb_name: squeezelite diff --git a/roles/pi-squeezelite/templates/squeezelite.cfg b/roles/pi_squeezelite/templates/squeezelite.cfg similarity index 100% rename from roles/pi-squeezelite/templates/squeezelite.cfg rename to roles/pi_squeezelite/templates/squeezelite.cfg diff --git a/roles/pi-squeezelite-custom/README.md b/roles/pi_squeezelite_custom/README.md similarity index 61% rename from roles/pi-squeezelite-custom/README.md rename to roles/pi_squeezelite_custom/README.md index 9a3033a..5595687 100644 --- a/roles/pi-squeezelite-custom/README.md +++ b/roles/pi_squeezelite_custom/README.md @@ -1,5 +1,5 @@ -# pi-squeezelite-custom +# pi_squeezelite_custom -Like `pi-squeezelite`, but uninstalls the distro package and deploys a +Like `pi_squeezelite`, but uninstalls the distro package and deploys a custom-compiled `squeezelite` build instead as a systemd service. See `custom build/readme_build.md` for how that build is produced. diff --git a/roles/pi-squeezelite-custom/custom build/readme_build.md b/roles/pi_squeezelite_custom/custom build/readme_build.md similarity index 100% rename from roles/pi-squeezelite-custom/custom build/readme_build.md rename to roles/pi_squeezelite_custom/custom build/readme_build.md diff --git a/roles/pi-squeezelite-custom/files/squeezelite b/roles/pi_squeezelite_custom/files/squeezelite similarity index 100% rename from roles/pi-squeezelite-custom/files/squeezelite rename to roles/pi_squeezelite_custom/files/squeezelite diff --git a/roles/pi-squeezelite-custom/files/squeezelite_old b/roles/pi_squeezelite_custom/files/squeezelite_old similarity index 100% rename from roles/pi-squeezelite-custom/files/squeezelite_old rename to roles/pi_squeezelite_custom/files/squeezelite_old diff --git a/roles/pi_squeezelite_custom/tasks/main.yml b/roles/pi_squeezelite_custom/tasks/main.yml new file mode 100644 index 0000000..71bcd2e --- /dev/null +++ b/roles/pi_squeezelite_custom/tasks/main.yml @@ -0,0 +1,44 @@ +--- +- name: Uninstall system package of squeezelite + ansible.builtin.apt: + name: squeezelite + state: absent +- name: Install dependencies + ansible.builtin.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 + ansible.builtin.file: + path: /etc/default/squeezelite + state: absent +- name: Copy over custom compile version of squeezelite + ansible.builtin.copy: + src: squeezelite + dest: /opt/squeezelite + mode: "700" +- name: Install systemd service file + ansible.builtin.template: + src: squeezelite.service + dest: /lib/systemd/system/ +- name: Enable sysdweb autostart + ansible.builtin.systemd: + name: squeezelite + state: restarted + enabled: "yes" + daemon_reload: "yes" +- name: Add to sysdweb + ansible.builtin.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 diff --git a/roles/pi-squeezelite-custom/templates/squeezelite.service b/roles/pi_squeezelite_custom/templates/squeezelite.service similarity index 100% rename from roles/pi-squeezelite-custom/templates/squeezelite.service rename to roles/pi_squeezelite_custom/templates/squeezelite.service diff --git a/roles/pi-squeezeserver/README.md b/roles/pi_squeezeserver/README.md similarity index 57% rename from roles/pi-squeezeserver/README.md rename to roles/pi_squeezeserver/README.md index e2a84ed..97c18b2 100644 --- a/roles/pi-squeezeserver/README.md +++ b/roles/pi_squeezeserver/README.md @@ -1,4 +1,4 @@ -# pi-squeezeserver +# pi_squeezeserver Installs and enables the Logitech Media Server (`squeezeserver`) package, -and registers it with `pi-sysdweb`. +and registers it with `pi_sysdweb`. diff --git a/roles/pi-squeezeserver/files/logitechmediaserver_7.9.2_arm.deb b/roles/pi_squeezeserver/files/logitechmediaserver_7.9.2_arm.deb similarity index 100% rename from roles/pi-squeezeserver/files/logitechmediaserver_7.9.2_arm.deb rename to roles/pi_squeezeserver/files/logitechmediaserver_7.9.2_arm.deb diff --git a/roles/pi-squeezeserver/files/logitechmediaserver_8.4.0_arm.deb b/roles/pi_squeezeserver/files/logitechmediaserver_8.4.0_arm.deb similarity index 100% rename from roles/pi-squeezeserver/files/logitechmediaserver_8.4.0_arm.deb rename to roles/pi_squeezeserver/files/logitechmediaserver_8.4.0_arm.deb diff --git a/roles/pi-squeezeserver/files/source_url.txt b/roles/pi_squeezeserver/files/source_url.txt similarity index 100% rename from roles/pi-squeezeserver/files/source_url.txt rename to roles/pi_squeezeserver/files/source_url.txt diff --git a/roles/pi-squeezeserver/tasks/main.yml b/roles/pi_squeezeserver/tasks/main.yml similarity index 61% rename from roles/pi-squeezeserver/tasks/main.yml rename to roles/pi_squeezeserver/tasks/main.yml index 97bbbf7..921da28 100644 --- a/roles/pi-squeezeserver/tasks/main.yml +++ b/roles/pi_squeezeserver/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Install packages required for squeeze server - apt: + ansible.builtin.apt: name: - libsox-fmt-all - libflac-dev @@ -14,19 +14,25 @@ - iptables-persistent cache_valid_time: 7200 state: present -- name: copy squeezeserver package - copy: src=logitechmediaserver_8.4.0_arm.deb dest=/tmp -- name: install squeezeserver package - apt: deb=/tmp/logitechmediaserver_8.4.0_arm.deb +- name: Copy squeezeserver package + ansible.builtin.copy: + src: logitechmediaserver_8.4.0_arm.deb + dest: /tmp +- name: Install squeezeserver package + ansible.builtin.apt: + deb: /tmp/logitechmediaserver_8.4.0_arm.deb - name: Enable sysdweb autostart - systemd: name=logitechmediaserver state=started enabled=yes + ansible.builtin.systemd: + name: logitechmediaserver + state: started + enabled: "yes" - name: Add to sysdweb - include_role: - name: pi-sysdweb + ansible.builtin.include_role: + name: pi_sysdweb vars: sysdweb_name: logitechmediaserver - name: Forward port 80 to 9000 - iptables: + ansible.builtin.iptables: table: nat chain: PREROUTING in_interface: eth0 @@ -36,4 +42,3 @@ jump: REDIRECT to_ports: "9000" comment: Redirect web traffic to port 9000 - diff --git a/roles/pi-standard-setup/README.md b/roles/pi_standard_setup/README.md similarity index 96% rename from roles/pi-standard-setup/README.md rename to roles/pi_standard_setup/README.md index 7cbc28d..312a19f 100644 --- a/roles/pi-standard-setup/README.md +++ b/roles/pi_standard_setup/README.md @@ -1,4 +1,4 @@ -# pi-standard-setup +# pi_standard_setup Baseline provisioning applied to every Pi: apt update/upgrade, detects the Pi model, adds a root SSH key, disables the SSH locale-forwarding warning, diff --git a/roles/pi_standard_setup/defaults/main.yml b/roles/pi_standard_setup/defaults/main.yml new file mode 100644 index 0000000..49663da --- /dev/null +++ b/roles/pi_standard_setup/defaults/main.yml @@ -0,0 +1,11 @@ +--- +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: true diff --git a/roles/pi-standard-setup/files/gitconfig b/roles/pi_standard_setup/files/gitconfig similarity index 100% rename from roles/pi-standard-setup/files/gitconfig rename to roles/pi_standard_setup/files/gitconfig diff --git a/roles/pi-standard-setup/files/motd/bedroompi b/roles/pi_standard_setup/files/motd/bedroompi similarity index 100% rename from roles/pi-standard-setup/files/motd/bedroompi rename to roles/pi_standard_setup/files/motd/bedroompi diff --git a/roles/pi-standard-setup/files/motd/esszimmerradio b/roles/pi_standard_setup/files/motd/esszimmerradio similarity index 100% rename from roles/pi-standard-setup/files/motd/esszimmerradio rename to roles/pi_standard_setup/files/motd/esszimmerradio diff --git a/roles/pi-standard-setup/files/motd/kitchenpi b/roles/pi_standard_setup/files/motd/kitchenpi similarity index 100% rename from roles/pi-standard-setup/files/motd/kitchenpi rename to roles/pi_standard_setup/files/motd/kitchenpi diff --git a/roles/pi-standard-setup/files/motd/musicmouse b/roles/pi_standard_setup/files/motd/musicmouse similarity index 100% rename from roles/pi-standard-setup/files/motd/musicmouse rename to roles/pi_standard_setup/files/motd/musicmouse diff --git a/roles/pi-standard-setup/files/motd/musikserverwohnzimmeroben b/roles/pi_standard_setup/files/motd/musikserverwohnzimmeroben similarity index 100% rename from roles/pi-standard-setup/files/motd/musikserverwohnzimmeroben rename to roles/pi_standard_setup/files/motd/musikserverwohnzimmeroben diff --git a/roles/pi-standard-setup/files/motd/newrpi b/roles/pi_standard_setup/files/motd/newrpi similarity index 100% rename from roles/pi-standard-setup/files/motd/newrpi rename to roles/pi_standard_setup/files/motd/newrpi diff --git a/roles/pi-standard-setup/files/motd/octopi b/roles/pi_standard_setup/files/motd/octopi similarity index 100% rename from roles/pi-standard-setup/files/motd/octopi rename to roles/pi_standard_setup/files/motd/octopi diff --git a/roles/pi-standard-setup/files/raspi-leds-off.service b/roles/pi_standard_setup/files/raspi-leds-off.service similarity index 100% rename from roles/pi-standard-setup/files/raspi-leds-off.service rename to roles/pi_standard_setup/files/raspi-leds-off.service diff --git a/roles/pi-standard-setup/files/raspi-leds-off.sh b/roles/pi_standard_setup/files/raspi-leds-off.sh similarity index 100% rename from roles/pi-standard-setup/files/raspi-leds-off.sh rename to roles/pi_standard_setup/files/raspi-leds-off.sh diff --git a/roles/pi-standard-setup/files/sshkey.pub b/roles/pi_standard_setup/files/sshkey.pub similarity index 100% rename from roles/pi-standard-setup/files/sshkey.pub rename to roles/pi_standard_setup/files/sshkey.pub diff --git a/roles/pi-standard-setup/files/vimrc b/roles/pi_standard_setup/files/vimrc similarity index 100% rename from roles/pi-standard-setup/files/vimrc rename to roles/pi_standard_setup/files/vimrc diff --git a/roles/pi-standard-setup/files/wifi-watchdog.sh b/roles/pi_standard_setup/files/wifi-watchdog.sh similarity index 100% rename from roles/pi-standard-setup/files/wifi-watchdog.sh rename to roles/pi_standard_setup/files/wifi-watchdog.sh diff --git a/roles/pi_standard_setup/handlers/main.yml b/roles/pi_standard_setup/handlers/main.yml new file mode 100644 index 0000000..07ceff9 --- /dev/null +++ b/roles/pi_standard_setup/handlers/main.yml @@ -0,0 +1,7 @@ +--- +- name: Restart sshd + ansible.builtin.service: + name: sshd + state: restarted +- name: Reboot + ansible.builtin.reboot: diff --git a/roles/pi_standard_setup/tasks/main.yml b/roles/pi_standard_setup/tasks/main.yml new file mode 100644 index 0000000..9a0a65c --- /dev/null +++ b/roles/pi_standard_setup/tasks/main.yml @@ -0,0 +1,135 @@ +--- +- name: Do apt update/upgrade + ansible.builtin.apt: + upgrade: "yes" + update_cache: "yes" + cache_valid_time: "7200" +- name: Detect Raspi Model + ansible.builtin.slurp: + src: /sys/firmware/devicetree/base/model + register: raspberry_model +- name: Show Raspi Model + ansible.builtin.debug: + msg: "{{ raspberry_model.content | b64decode }}" +- name: Add authorized SSH key to root account + ansible.posix.authorized_key: + user: root + key: "{{ lookup('file', 'sshkey.pub') }}" + state: present +- name: Activate root login with key + ansible.builtin.lineinfile: + path: /etc/ssh/sshd_config + regexp: "^#?PermitRootLogin" + line: "PermitRootLogin prohibit-password" + notify: Restart sshd +- name: Deactive SSH accepting locale vars (leads to warnings) + ansible.builtin.lineinfile: + path: /etc/ssh/sshd_config + regexp: "^#?AcceptEnv LANG LC_*" + line: "#AcceptEnv LANG LC_*" + notify: Restart sshd +- name: Get hostname + ansible.builtin.command: "raspi-config nonint get_hostname" + register: pi_hostname + changed_when: false +- name: Change hostname {{ new_hostname }} + ansible.builtin.command: "raspi-config nonint do_hostname {{ new_hostname }}" + when: new_hostname | bool and pi_hostname.stdout != new_hostname + register: set_hostname + changed_when: true + notify: Reboot +- name: Get hostname + ansible.builtin.command: "raspi-config nonint get_hostname" + register: pi_hostname + changed_when: false +- name: Set boot mode to CLI + ansible.builtin.command: "raspi-config nonint do_boot_behaviour B1" + changed_when: true +# I2 Change Timezone +- name: Change timezone + ansible.builtin.command: "raspi-config nonint do_change_timezone {{ timezone }}" + changed_when: true +- name: Change locale + ansible.builtin.command: "raspi-config nonint do_change_locale en_US.UTF-8" + changed_when: true +- name: Change password of default pi account + ansible.builtin.user: + name: pi + update_password: always + password: "{{ lookup('keepass', 'ansible://default_rpi_password') | password_hash('sha512') }}" +- name: Install Packages (vim, git, basic python stuff) + ansible.builtin.apt: + name: + - vim + - git + - python3 + - python3-pip + - python3-wheel + - telnet + cache_valid_time: 7200 + state: present +- name: Copy vim config + ansible.builtin.copy: + src: vimrc + dest: /root/.vimrc +- name: Copy git config + ansible.builtin.copy: + src: gitconfig + dest: /root/.gitconfig +# Wifi +- name: Get WiFi country + ansible.builtin.command: "raspi-config nonint get_wifi_country" + register: wifi_country + changed_when: false + ignore_errors: true # to avoid error when WiFi is not present +- name: Change WiFi country + ansible.builtin.command: "raspi-config nonint do_wifi_country {{ wifi_country }}" + when: configure_wifi + changed_when: true +- name: Set WiFi credentials + ansible.builtin.command: "raspi-config nonint do_wifi_ssid_passphrase {{ wifi_ssid }} {{ lookup('keepass', 'bauer_wifi') }}" + when: configure_wifi + changed_when: true +- name: Install watchdog + ansible.builtin.apt: + name: watchdog + cache_valid_time: "7200" + state: present + when: not wifi_ssid is defined +- name: Configure watchdog + ansible.builtin.blockinfile: + path: /etc/watchdog.conf + block: | + interface = wlan0 + retry-timeout = 90 + ping = {{ router_ip }} + interval = 15 + when: configure_wifi +- name: Start watchdog + ansible.builtin.systemd: # state=restarted not working, also not manually + name: watchdog + state: started + enabled: "yes" + daemon_reload: "yes" + when: configure_wifi +# Message of the day +- name: Set Message of the day + ansible.builtin.copy: + src: motd/{{ pi_hostname.stdout }} + dest: /etc/motd +# LED off script +- name: Copy led off script + ansible.builtin.copy: + src: raspi-leds-off.sh + dest: /usr/sbin/raspi-leds-off.sh + mode: "u+rwx" +- name: Copy led off service + ansible.builtin.copy: + src: raspi-leds-off.service + dest: /lib/systemd/system/ +- name: Activate led off servic + ansible.builtin.systemd: + name: raspi-leds-off + state: restarted + enabled: "yes" + daemon_reload: "yes" diff --git a/roles/pi-sysdweb/README.md b/roles/pi_sysdweb/README.md similarity index 92% rename from roles/pi-sysdweb/README.md rename to roles/pi_sysdweb/README.md index 650a10e..0826a8c 100644 --- a/roles/pi-sysdweb/README.md +++ b/roles/pi_sysdweb/README.md @@ -1,4 +1,4 @@ -# pi-sysdweb +# pi_sysdweb Installs `sysdweb` (a small web UI for managing systemd units) and creates its service user. Other roles register their services with it. diff --git a/roles/pi-sysdweb/files/sysdweb-system.service b/roles/pi_sysdweb/files/sysdweb-system.service similarity index 100% rename from roles/pi-sysdweb/files/sysdweb-system.service rename to roles/pi_sysdweb/files/sysdweb-system.service diff --git a/roles/pi-sysdweb/tasks/main.yml b/roles/pi_sysdweb/tasks/main.yml similarity index 55% rename from roles/pi-sysdweb/tasks/main.yml rename to roles/pi_sysdweb/tasks/main.yml index 7be32a1..c230804 100644 --- a/roles/pi-sysdweb/tasks/main.yml +++ b/roles/pi_sysdweb/tasks/main.yml @@ -1,39 +1,44 @@ --- - - name: Apt install python3-pip - apt: - name: python3-pip + ansible.builtin.apt: + name: python3-pip cache_valid_time: 7200 state: present - name: Install sysdweb - pip: + ansible.builtin.pip: name: sysdweb executable: pip3 extra_args: "--break-system-packages" -- name: sysdweb user - user: +- name: Sysdweb user + ansible.builtin.user: name: sysdweb shell: /usr/bin/nologin password: "$6$TcTD23xOXln$RxN3Kd0vJRaxffoyKqjoBJM0Q5Va6REBVZ6BOgmGXs3fTAWc7voSW5QcN35t9pfro2do0LeSaeGsrMLbArZ.2." update_password: always - name: Configure sysdweb user - blockinfile: + ansible.builtin.blockinfile: path: /etc/sysdweb.conf create: true marker: "# {mark} ansible user" - block : | + block: | [DEFAULT] users = sysdweb - name: Configure sysdweb - blockinfile: + ansible.builtin.blockinfile: path: /etc/sysdweb.conf create: true - marker: "# {mark} ansible managed for {{sysdweb_name}}" + marker: "# {mark} ansible managed for {{ sysdweb_name }}" block: | - [{{sysdweb_name}}] - title = {{sysdweb_name}} - unit = {{sysdweb_name}}.service + [{{ sysdweb_name }}] + title = {{ sysdweb_name }} + unit = {{ sysdweb_name }}.service - name: Install systemd service file - copy: src=sysdweb-system.service dest=/etc/systemd/system/ + ansible.builtin.copy: + src: sysdweb-system.service + dest: /etc/systemd/system/ - name: Enable sysdweb autostart - systemd: name=sysdweb-system state=restarted enabled=yes daemon_reload=yes + ansible.builtin.systemd: + name: sysdweb-system + state: restarted + enabled: "yes" + daemon_reload: "yes" diff --git a/roles/server-exthdd-mount/tasks/main.yml b/roles/server-exthdd-mount/tasks/main.yml deleted file mode 100644 index 2ffef8d..0000000 --- a/roles/server-exthdd-mount/tasks/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- - -- name: Automount passport4 systemd file - copy: src=media-passport4.mount dest=/etc/systemd/system -- name: Automount passport5 systemd file - copy: src=media-passport5.mount dest=/etc/systemd/system -- name: Create udev rules - copy: src=99-automounts.rules dest=/etc/udev/rules.d -- name: Systemd reread configs - ansible.builtin.systemd: - daemon_reload: true -- name: Reload udev - ansible.builtin.command: - cmd: "udevadm control --reload" \ No newline at end of file diff --git a/roles/server-link-aggregation/tasks/main.yml b/roles/server-link-aggregation/tasks/main.yml deleted file mode 100644 index 2e9ee24..0000000 --- a/roles/server-link-aggregation/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- name: Apt install download & unzip packages - apt: - name: - - ifenslave -- name: Interface file - copy: src=interfaces dest=/etc/network/interfaces \ No newline at end of file diff --git a/roles/server-basic-environment/README.md b/roles/server_basic_environment/README.md similarity index 72% rename from roles/server-basic-environment/README.md rename to roles/server_basic_environment/README.md index 4f08590..bc0a2c9 100644 --- a/roles/server-basic-environment/README.md +++ b/roles/server_basic_environment/README.md @@ -1,3 +1,3 @@ -# server-basic-environment +# server_basic_environment apt update/upgrade, plus downloads and installs `mbenv` on the server. diff --git a/roles/server-basic-environment/tasks/main.yml b/roles/server_basic_environment/tasks/main.yml similarity index 73% rename from roles/server-basic-environment/tasks/main.yml rename to roles/server_basic_environment/tasks/main.yml index e3dbb49..09f6ac7 100644 --- a/roles/server-basic-environment/tasks/main.yml +++ b/roles/server_basic_environment/tasks/main.yml @@ -1,10 +1,12 @@ --- - - name: Do apt update/upgrade - apt: upgrade=yes update_cache=yes cache_valid_time=300 + ansible.builtin.apt: + upgrade: "yes" + update_cache: "yes" + cache_valid_time: "300" - name: Apt install download & unzip packages - apt: - name: + ansible.builtin.apt: + name: - wget - zip - htop @@ -17,5 +19,5 @@ - name: Download and install mbenv ansible.builtin.unarchive: src: "https://owncloud.bauer.tech/s/vMu7X4mRl2vComu/download?path=%2F&files=mbenv.tar.xz" - remote_src: yes + remote_src: true dest: "/home/core/" diff --git a/roles/server-debian-docker/README.md b/roles/server_debian_docker/README.md similarity index 75% rename from roles/server-debian-docker/README.md rename to roles/server_debian_docker/README.md index 2ebee2c..4a726aa 100644 --- a/roles/server-debian-docker/README.md +++ b/roles/server_debian_docker/README.md @@ -1,3 +1,3 @@ -# server-debian-docker +# server_debian_docker Installs Docker CE on Debian via the official Docker apt repository. diff --git a/roles/server-debian-docker/tasks/main.yml b/roles/server_debian_docker/tasks/main.yml similarity index 82% rename from roles/server-debian-docker/tasks/main.yml rename to roles/server_debian_docker/tasks/main.yml index 76a890a..cad7acb 100644 --- a/roles/server-debian-docker/tasks/main.yml +++ b/roles/server_debian_docker/tasks/main.yml @@ -1,7 +1,6 @@ --- - - name: Install required system packages - apt: + ansible.builtin.apt: name: - apt-transport-https - ca-certificates @@ -14,25 +13,25 @@ update_cache: true - name: Add Docker GPG apt Key - apt_key: + ansible.builtin.apt_key: url: https://download.docker.com/linux/debian/gpg state: present - name: Add Docker Repository - apt_repository: + ansible.builtin.apt_repository: repo: deb https://download.docker.com/linux/debian {{ ansible_facts['distribution_release'] }} stable state: present - name: Update apt and install docker-ce - apt: - name: + ansible.builtin.apt: + name: - docker-ce - docker-compose-plugin state: latest update_cache: true - name: Add core to docker group - ansible.builtin.user: + ansible.builtin.user: name: core groups: docker - append: true \ No newline at end of file + append: true diff --git a/roles/server-exthdd-mount/README.md b/roles/server_exthdd_mount/README.md similarity index 82% rename from roles/server-exthdd-mount/README.md rename to roles/server_exthdd_mount/README.md index 6217096..e6ad906 100644 --- a/roles/server-exthdd-mount/README.md +++ b/roles/server_exthdd_mount/README.md @@ -1,4 +1,4 @@ -# server-exthdd-mount +# server_exthdd_mount Sets up systemd automount units and udev rules for external hard drives (`passport4`, `passport5`). diff --git a/roles/server-exthdd-mount/files/99-automounts.rules b/roles/server_exthdd_mount/files/99-automounts.rules similarity index 100% rename from roles/server-exthdd-mount/files/99-automounts.rules rename to roles/server_exthdd_mount/files/99-automounts.rules diff --git a/roles/server-exthdd-mount/files/media-passport4.mount b/roles/server_exthdd_mount/files/media-passport4.mount similarity index 100% rename from roles/server-exthdd-mount/files/media-passport4.mount rename to roles/server_exthdd_mount/files/media-passport4.mount diff --git a/roles/server-exthdd-mount/files/media-passport5.mount b/roles/server_exthdd_mount/files/media-passport5.mount similarity index 100% rename from roles/server-exthdd-mount/files/media-passport5.mount rename to roles/server_exthdd_mount/files/media-passport5.mount diff --git a/roles/server_exthdd_mount/tasks/main.yml b/roles/server_exthdd_mount/tasks/main.yml new file mode 100644 index 0000000..2dad193 --- /dev/null +++ b/roles/server_exthdd_mount/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- name: Automount passport4 systemd file + ansible.builtin.copy: + src: media-passport4.mount + dest: /etc/systemd/system +- name: Automount passport5 systemd file + ansible.builtin.copy: + src: media-passport5.mount + dest: /etc/systemd/system +- name: Create udev rules + ansible.builtin.copy: + src: 99-automounts.rules + dest: /etc/udev/rules.d +- name: Systemd reread configs + ansible.builtin.systemd: + daemon_reload: true +- name: Reload udev + ansible.builtin.command: + cmd: "udevadm control --reload" + changed_when: true diff --git a/roles/server-link-aggregation/README.md b/roles/server_link_aggregation/README.md similarity index 76% rename from roles/server-link-aggregation/README.md rename to roles/server_link_aggregation/README.md index d333a5f..1902ead 100644 --- a/roles/server-link-aggregation/README.md +++ b/roles/server_link_aggregation/README.md @@ -1,4 +1,4 @@ -# server-link-aggregation +# server_link_aggregation Configures a network interface file for link aggregation (bonding) on the server. diff --git a/roles/server-link-aggregation/files/interfaces b/roles/server_link_aggregation/files/interfaces similarity index 100% rename from roles/server-link-aggregation/files/interfaces rename to roles/server_link_aggregation/files/interfaces diff --git a/roles/server_link_aggregation/tasks/main.yml b/roles/server_link_aggregation/tasks/main.yml new file mode 100644 index 0000000..e653d5f --- /dev/null +++ b/roles/server_link_aggregation/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- name: Apt install download & unzip packages + ansible.builtin.apt: + name: + - ifenslave +- name: Interface file + ansible.builtin.copy: + src: interfaces + dest: /etc/network/interfaces diff --git a/roles/server-nfs/README.md b/roles/server_nfs/README.md similarity index 87% rename from roles/server-nfs/README.md rename to roles/server_nfs/README.md index cd08815..4c85b43 100644 --- a/roles/server-nfs/README.md +++ b/roles/server_nfs/README.md @@ -1,4 +1,4 @@ -# server-nfs +# server_nfs Installs the NFS server, manages `/etc/exports`, and restarts `nfs-kernel-server` on changes. diff --git a/roles/server-nfs/tasks/main.yml b/roles/server_nfs/tasks/main.yml similarity index 55% rename from roles/server-nfs/tasks/main.yml rename to roles/server_nfs/tasks/main.yml index 499bac1..ab1d49e 100644 --- a/roles/server-nfs/tasks/main.yml +++ b/roles/server_nfs/tasks/main.yml @@ -1,20 +1,17 @@ --- - - name: Apt install NFS server - apt: + ansible.builtin.apt: name: nfs-kernel-server - update_cache: yes + update_cache: true - name: Ensure correct entry in /etc/exports - lineinfile: + ansible.builtin.lineinfile: path: /etc/exports state: present line: "{{ item }}" with_items: - - '/data/main 192.168.178.0/255.255.255.0(rw,async,no_subtree_check)' -- name: Restart nfs-kernel-server.service + - "/data/main 192.168.178.0/255.255.255.0(rw,async,no_subtree_check)" +- name: Restart nfs-kernel-server.service ansible.builtin.systemd: - daemon_reload: yes + daemon_reload: true state: started name: nfs-kernel-server.service - - diff --git a/server.yml b/server.yml index c6f4ea2..46497a8 100644 --- a/server.yml +++ b/server.yml @@ -1,10 +1,10 @@ - -- hosts: server +--- +- name: Server + hosts: server roles: - - server-basic-environment - - server-debian-docker - - server-exthdd-mount - - server-nfs - #- server-link-aggregation - #- bluetooth-monitor - + - server_basic_environment + - server_debian_docker + - server_exthdd_mount + - server_nfs + # - server_link_aggregation + # - bluetooth_monitor diff --git a/test_keepass.yml b/test_keepass.yml index 84fd9fd..4c2d33c 100644 --- a/test_keepass.yml +++ b/test_keepass.yml @@ -1,12 +1,11 @@ --- - -- hosts: all +- name: Test keepass lookup + hosts: all vars: ansible_ssh_pass: raspberry remote_user: pi tasks: - - name: test - debug: + - name: Test + ansible.builtin.debug: msg: Lookup rpi pw {{ lookup('keepass', 'default_rpi_password') }} - diff --git a/todo.md b/todo.md index 0b9196c..f62827c 100644 --- a/todo.md +++ b/todo.md @@ -17,7 +17,7 @@ dpkg-buildpackage -b -uc Bluetooth: make adapter non-discoverable (rather than fully disabling it, see -pi-disable-onboard-bluetooth) by editing /var/lib/bluetooth//settings: +pi_disable_onboard_bluetooth) by editing /var/lib/bluetooth//settings: [General] Discoverable=false diff --git a/working.yml b/working.yml index b771ab8..bed723e 100644 --- a/working.yml +++ b/working.yml @@ -1,33 +1,38 @@ --- - -- hosts: server +- name: Server + hosts: server roles: - - bluetooth-monitor + - bluetooth_monitor -- hosts: musikserverwohnzimmeroben +- name: Musikserver Wohnzimmer oben + hosts: musikserverwohnzimmeroben roles: - - bluetooth-monitor + - bluetooth_monitor -- hosts: kitchenpi +- name: Kitchen pi + hosts: kitchenpi roles: - - pi-disable-onboard-bluetooth - - bluetooth-monitor + - pi_disable_onboard_bluetooth + - bluetooth_monitor -- hosts: bedroompi +- name: Bedroom pi + hosts: bedroompi roles: - - pi-disable-onboard-bluetooth - - bluetooth-monitor + - 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: homeassistant +- name: Home Assistant + hosts: homeassistant roles: - - bluetooth-monitor \ No newline at end of file + - bluetooth_monitor