diff options
-rw-r--r-- | chaos-at-home/ch-cm4-test.yml | 22 | ||||
-rw-r--r-- | chaos-at-home/ch-gw-lan.yml | 2 | ||||
-rw-r--r-- | chaos-at-home/ch-mc.yml | 32 | ||||
-rw-r--r-- | chaos-at-home/ch-mcbr.yml | 13 | ||||
-rw-r--r-- | chaos-at-home/ch-mclr.yml | 15 | ||||
-rw-r--r-- | inventory/group_vars/chaos-at-home-sensors/vars.yml | 9 | ||||
-rw-r--r-- | inventory/group_vars/chaos-at-home/network.yml | 1 | ||||
-rw-r--r-- | inventory/host_vars/ch-cm4-test.yml | 4 | ||||
-rw-r--r-- | inventory/host_vars/ch-mc.yml | 75 | ||||
-rw-r--r-- | inventory/host_vars/ch-mcbr.yml | 22 | ||||
-rw-r--r-- | inventory/host_vars/ch-mclr.yml | 45 | ||||
-rw-r--r-- | inventory/host_vars/ch-router.yml | 10 | ||||
-rw-r--r-- | inventory/hosts.ini | 1 | ||||
-rw-r--r-- | roles/kodi/config/defaults/main.yml | 27 | ||||
-rw-r--r-- | roles/kodi/config/tasks/main.yml | 55 | ||||
-rw-r--r-- | roles/kodi/config/templates/sources.xml.j2 | 14 | ||||
-rw-r--r-- | roles/kodi/standalone/templates/kodi.service.j2 | 2 | ||||
-rwxr-xr-x | roles/ws/minet/templates/connections/horstWireless.j2 | 4 |
18 files changed, 195 insertions, 158 deletions
diff --git a/chaos-at-home/ch-cm4-test.yml b/chaos-at-home/ch-cm4-test.yml deleted file mode 100644 index 2726fc07..00000000 --- a/chaos-at-home/ch-cm4-test.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- name: Basic Setup - hosts: ch-cm4-test - roles: - - role: apt-repo/base - - role: core/base - - role: core/sshd/base - - role: core/zsh - - role: core/ntp - -- name: Payload Setup - hosts: ch-cm4-test - roles: - - role: kodi/standalone - post_tasks: - - name: mount fileserver volumes - mount: - src: "{{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets['ch-prometheus']) | ansible.utils.ipaddr('address') }}:/" - path: /srv/files - fstype: nfs4 - opts: nodev,x-systemd.automount,nofail,ro - state: mounted diff --git a/chaos-at-home/ch-gw-lan.yml b/chaos-at-home/ch-gw-lan.yml index 37ed17fa..e845c385 100644 --- a/chaos-at-home/ch-gw-lan.yml +++ b/chaos-at-home/ch-gw-lan.yml @@ -20,7 +20,7 @@ - name: epimetheus interface: lan0 mac: 90:2b:34:35:da:88 - - name: mc + - name: mcbr interface: lan0 mac: 00:1e:8c:f4:e6:d8 loop_control: diff --git a/chaos-at-home/ch-mc.yml b/chaos-at-home/ch-mc.yml deleted file mode 100644 index 8ded2b5a..00000000 --- a/chaos-at-home/ch-mc.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- name: Basic Setup - hosts: ch-mc - roles: - - role: apt-repo/base - - role: core/base - - role: core/sshd/base - - role: core/zsh - - role: core/cpu-microcode - -- name: Payload Setup - hosts: ch-mc - roles: - - role: network/wakeonlan - # - role: apt-repo/backports - # - role: kodi/standalone - - role: apt-repo/kodi - - role: ws/base - - role: ws/users - post_tasks: - - name: install nfs client packages - apt: - name: nfs-common - state: present - - - name: mount fileserver volumes - mount: - src: "{{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets['ch-prometheus']) | ansible.utils.ipaddr('address') }}:/" - path: /srv/files - fstype: nfs4 - opts: nodev,x-systemd.automount,nofail,ro - state: mounted diff --git a/chaos-at-home/ch-mcbr.yml b/chaos-at-home/ch-mcbr.yml index e2227b41..3fa66eef 100644 --- a/chaos-at-home/ch-mcbr.yml +++ b/chaos-at-home/ch-mcbr.yml @@ -13,15 +13,4 @@ hosts: ch-mcbr roles: - role: kodi/standalone - ## TODO: - ## - https://kodi.wiki/view/Kore_Manual - ## - https://kodi.wiki/view/MySQL/Setting_up_Kodi (need to wait for NFSv4 support ...) - post_tasks: - ## Kodi only supports NFSv3, however it will probably work with Kodi 20+ (https://github.com/xbmc/xbmc/pull/21659) - - name: mount fileserver volumes - mount: - src: "{{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets['ch-prometheus']) | ansible.utils.ipaddr('address') }}:/" - path: /srv/files - fstype: nfs4 - opts: nodev,x-systemd.automount,nofail,ro - state: mounted + - role: kodi/config diff --git a/chaos-at-home/ch-mclr.yml b/chaos-at-home/ch-mclr.yml new file mode 100644 index 00000000..d6aa7ae1 --- /dev/null +++ b/chaos-at-home/ch-mclr.yml @@ -0,0 +1,15 @@ +--- +- name: Basic Setup + hosts: ch-mclr + roles: + - role: apt-repo/base + - role: core/base + - role: core/sshd/base + - role: core/zsh + - role: core/ntp + +- name: Payload Setup + hosts: ch-mclr + roles: + - role: kodi/standalone + - role: kodi/config diff --git a/inventory/group_vars/chaos-at-home-sensors/vars.yml b/inventory/group_vars/chaos-at-home-sensors/vars.yml index d6783736..c613974b 100644 --- a/inventory/group_vars/chaos-at-home-sensors/vars.yml +++ b/inventory/group_vars/chaos-at-home-sensors/vars.yml @@ -13,6 +13,7 @@ openwrt_packages_remove: - ppp - ppp-mod-pppoe - firewall + - firewall4 - dnsmasq - odhcpd-ipv6only openwrt_packages_add: @@ -20,7 +21,7 @@ openwrt_packages_add: - kmod-i2c-mux-pca954x - kmod-iio-bmp280-i2c - kmod-iio-am2315 - - kmod-hwmon-ads1015 + - kmod-iio-ads1015 - kmod-hwmon-mcp3021 - kmod-w1-master-ds2482 - kmod-w1-slave-therm @@ -92,11 +93,15 @@ openwrt_uci: RootPasswordAuth: 'off' Port: '{{ ansible_port }}' + uhttpd: + - name: uhttpd main + options: + enabled: '0' + prometheus-node-exporter-lua: - name: prometheus-node-exporter-lua 'main' options: listen_interface: 'iot' - listen_ipv6: '0' listen_port: '9100' network: diff --git a/inventory/group_vars/chaos-at-home/network.yml b/inventory/group_vars/chaos-at-home/network.yml index c6279ed6..29e53a2b 100644 --- a/inventory/group_vars/chaos-at-home/network.yml +++ b/inventory/group_vars/chaos-at-home/network.yml @@ -13,7 +13,6 @@ network_zones: limit: 199 offsets: ch-equinox-ws: 1 - ch-mc: 10 ### legacy ch-mclr: 10 ch-mcbr: 11 ch-telesto: 20 diff --git a/inventory/host_vars/ch-cm4-test.yml b/inventory/host_vars/ch-cm4-test.yml index 314f7f2b..9a013fdf 100644 --- a/inventory/host_vars/ch-cm4-test.yml +++ b/inventory/host_vars/ch-cm4-test.yml @@ -23,7 +23,3 @@ raspios_boot_config: line: 'hdmi_enable_4kp60=1' base_entropy_generator: rngd - - -kodi_standalone_support_packages_extra: - - libgl1-mesa-dri ## missing dep for RaspiOS Kodi Package, TODO: bugreport diff --git a/inventory/host_vars/ch-mc.yml b/inventory/host_vars/ch-mc.yml deleted file mode 100644 index 45c2d82d..00000000 --- a/inventory/host_vars/ch-mc.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- -debian_preseed_language: de -debian_preseed_country: AT -debian_preseed_locales: - - de_AT.UTF-8 - - de_DE.UTF-8 - - en_US.UTF-8 - -debian_preseed_no_splash: no -debian_preseed_install_tasks: - - xubuntu-desktop - - -install: - efi: no - disks: - primary: /dev/disk/by-id/ata-OCZ-VERTEX2_OCZ-B7P98I86F4PC14I7 - system_lvm: - volumes: - - name: root - size: 30G - filesystem: ext4 - mountpoint: / - - name: var+log - size: 768M - filesystem: ext4 - mountpoint: /var/log - mount_options: - - noatime - - nodev - - noexec - -network: - nameservers: "{{ network_zones.lan.dns }}" - domain: "{{ host_domain }}" - primary: &_network_primary_ - name: eno1 - address: "{{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets[inventory_hostname]) }}" - gateway: "{{ network_zones.lan.gateway }}" - interfaces: - - *_network_primary_ - - -base_modules_blacklist: "{{ base_modules_blacklist_none }}" - -apt_repo_components: - - main - - restricted - - universe - - multiverse - - -ws_base_extra_packages: - - nfs-common - # needs apt-repo/kodi - - kodi - - kodi-inputstream-rtmp - - kodi-inputstream-adaptive - -ws_base_lightdm_defaults: - autologin-user: equinox - autologin-user-timeout: 0 - -ws_users: - - equinox - - -# kodi_standalone_support_packages_extra: -# - i965-va-driver-shaders - -# kodi_standalone_use_backports: yes -# kodi_standalone_kodi_packages_extra: -# - kodi-repository-kodi -# - kodi-inputstream-adaptive -# - kodi-inputstream-rtmp diff --git a/inventory/host_vars/ch-mcbr.yml b/inventory/host_vars/ch-mcbr.yml index 1ac236c8..fb464fb5 100644 --- a/inventory/host_vars/ch-mcbr.yml +++ b/inventory/host_vars/ch-mcbr.yml @@ -45,3 +45,25 @@ kodi_standalone_kodi_packages_extra: - kodi-repository-kodi - kodi-inputstream-adaptive - kodi-inputstream-rtmp + +kodi_config_nfs4_mounts: + - src: "{{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets['ch-prometheus']) | ansible.utils.ipaddr('address') }}:/" + path: /srv/files + +kodi_config_guisettings: + locale.keyboardlayouts: "German ABC|German QWERTZ" + locale.activekeyboardlayout: "German QWERTZ" + locale.country: Central Europe + locale.timezonecountry: Austria + locale.timezone: Europe/Vienna + services.devicename: "chaos at media (br)" + services.webserver: "true" + services.webserverauthentication: "false" + services.esallinterfaces: "true" + +kodi_config_sources: + video: + - name: Series + path: /srv/files/series + - name: Movies + path: /srv/files/movies diff --git a/inventory/host_vars/ch-mclr.yml b/inventory/host_vars/ch-mclr.yml new file mode 100644 index 00000000..457ee062 --- /dev/null +++ b/inventory/host_vars/ch-mclr.yml @@ -0,0 +1,45 @@ +--- +raspios_variant: lite +raspios_arch: arm64 + +network: + nameservers: "{{ network_zones.lan.dns }}" + domain: "{{ host_domain }}" + primary: &_network_primary_ + name: eth0 + address: "{{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets[inventory_hostname]) }}" + gateway: "{{ network_zones.lan.gateway }}" + interfaces: + - *_network_primary_ + +raspios_boot_config: + - regexp: '^#?hdmi_enable_4kp60=1' + line: 'hdmi_enable_4kp60=1' + +base_entropy_generator: rngd + + +kodi_standalone_support_packages_extra: + - libgl1-mesa-dri ## missing dep for RaspiOS Kodi Package, TODO: bugreport + +kodi_config_nfs4_mounts: + - src: "{{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets['ch-prometheus']) | ansible.utils.ipaddr('address') }}:/" + path: /srv/files + +kodi_config_guisettings: + locale.keyboardlayouts: "German ABC|German QWERTZ" + locale.activekeyboardlayout: "German QWERTZ" + locale.country: Central Europe + locale.timezonecountry: Austria + locale.timezone: Europe/Vienna + services.devicename: "chaos at media (lr)" + services.webserver: "true" + services.webserverauthentication: "false" + services.esallinterfaces: "true" + +kodi_config_sources: + video: + - name: Series + path: /srv/files/series + - name: Movies + path: /srv/files/movies diff --git a/inventory/host_vars/ch-router.yml b/inventory/host_vars/ch-router.yml index 952d07bd..63aabf94 100644 --- a/inventory/host_vars/ch-router.yml +++ b/inventory/host_vars/ch-router.yml @@ -242,17 +242,17 @@ openwrt_uci: RootPasswordAuth: 'off' Port: '{{ ansible_port | default(22) }}' + uhttpd: + - name: uhttpd main + options: + enabled: '0' + prometheus-node-exporter-lua: - name: prometheus-node-exporter-lua 'main' options: listen_interface: 'mgmt' listen_port: '9100' - uhttpd: - - name: uhttpd main - options: - enabled: '0' - openvpn: - name: openvpn 'extern' options: diff --git a/inventory/hosts.ini b/inventory/hosts.ini index 3e4288dc..8bbf4316 100644 --- a/inventory/hosts.ini +++ b/inventory/hosts.ini @@ -36,7 +36,6 @@ ch-vpn host_name=vpn ch-mon host_name=mon ch-omd host_name=omd ch-epimetheus host_name=epimetheus -ch-mc host_name=mc ch-mclr host_name=mclr ch-mcbr host_name=mcbr ch-atlas host_name=atlas diff --git a/roles/kodi/config/defaults/main.yml b/roles/kodi/config/defaults/main.yml new file mode 100644 index 00000000..54e6cfa7 --- /dev/null +++ b/roles/kodi/config/defaults/main.yml @@ -0,0 +1,27 @@ +--- +kodi_config_nfs4_mounts: {} + +# kodi_config_nfs4_mounts: +# - src: 192.0.2.0:/ +# path: /srv/files + + +kodi_config_guisettings: {} + +# kodi_config_guisettings: +# locale.keyboardlayouts: "German ABC|German QWERTZ" +# locale.activekeyboardlayout: "German QWERTZ" +# locale.country: Central Europe +# locale.timezonecountry: Austria +# locale.timezone: Europa Vienna +# services.devicename: "Kodi @ {{ host_name }}" + + +kodi_config_sources: {} + +# kodi_config_sources: +# video: +# - name: Series +# path: /srv/files/series +# - name: Movies +# path: /srv/files/movies diff --git a/roles/kodi/config/tasks/main.yml b/roles/kodi/config/tasks/main.yml new file mode 100644 index 00000000..4bfa2f5c --- /dev/null +++ b/roles/kodi/config/tasks/main.yml @@ -0,0 +1,55 @@ +--- + ## Kodi only supports NFSv3, however it will probably work with Kodi 20+ (https://github.com/xbmc/xbmc/pull/21659) +- name: mount NFSv4 volumes + loop: "{{ kodi_config_nfs4_mounts }}" + loop_control: + label: "{{ item.src }} -> {{ item.path }}" + mount: + src: "{{ item.src }}" + path: "{{ item.path }}" + fstype: nfs4 + opts: nodev,x-systemd.automount,nofail,ro + state: mounted + +- name: install python lxml + apt: + name: "{{ python_basename }}-lxml" + state: present + +- name: stop kodi + systemd: + name: kodi.service + state: stopped + + ## https://github.com/jose1711/kodi-ansible-role +- name: configure guisettings.xml + loop: "{{ kodi_config_guisettings | dict2items }}" + loop_control: + label: "{{ item.key }} = {{ item.value }}" + xml: + path: /home/kodi/.kodi/userdata/guisettings.xml + xpath: '/settings/setting[@id="{{ item.key }}"]' + value: "{{ item.value }}" + pretty_print: yes + +- name: configure guisettings.xml - remove defaults + loop: "{{ kodi_config_guisettings | dict2items }}" + loop_control: + label: "{{ item.key }} = {{ item.value }}" + xml: + path: /home/kodi/.kodi/userdata/guisettings.xml + xpath: '/settings/setting[@id="{{ item.key }}"]/@default' + state: absent + pretty_print: yes + +- name: generate sources.xml + template: + src: sources.xml.j2 + dest: /home/kodi/.kodi/userdata/sources.xml + owner: kodi + group: kodi + +- name: start kodi + systemd: + name: kodi.service + state: started diff --git a/roles/kodi/config/templates/sources.xml.j2 b/roles/kodi/config/templates/sources.xml.j2 new file mode 100644 index 00000000..0ae09b74 --- /dev/null +++ b/roles/kodi/config/templates/sources.xml.j2 @@ -0,0 +1,14 @@ +<sources> +{% for source_type in ['programs', 'video', 'music', 'pictures', 'files', 'games'] %} + <{{ source_type }}> + <default pathversion="1"></default> +{% for source in kodi_config_sources[source_type] | default([]) %} + <source> + <name>{{ source.name }}</name> + <path pathversion="1">{{ source.path }}</path> + <allowsharing>true</allowsharing> + </source> +{% endfor %} + </{{ source_type }}> +{% endfor %} +</sources> diff --git a/roles/kodi/standalone/templates/kodi.service.j2 b/roles/kodi/standalone/templates/kodi.service.j2 index c349010e..62d85831 100644 --- a/roles/kodi/standalone/templates/kodi.service.j2 +++ b/roles/kodi/standalone/templates/kodi.service.j2 @@ -1,6 +1,6 @@ [Unit] Description=Kodi standalone (GBM) -After=remote-fs.target systemd-user-sessions.service network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service lircd.service +After=remote-fs.target network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service lircd.service Wants=network-online.target polkit.service upower.service Conflicts=getty@tty1.service diff --git a/roles/ws/minet/templates/connections/horstWireless.j2 b/roles/ws/minet/templates/connections/horstWireless.j2 index c6d04b7e..648c407a 100755 --- a/roles/ws/minet/templates/connections/horstWireless.j2 +++ b/roles/ws/minet/templates/connections/horstWireless.j2 @@ -10,8 +10,8 @@ MODULE_NAME="{{ ws_minet_wireless_interface_module }}" case "$1" in start|"") echo "Connecting with $DESC_NAME" - activate_interface wlan0 $MODULE_NAME - iw dev wlan0 del + activate_interface "{{ ws_minet_wireless_interface_name }}" $MODULE_NAME + iw dev "{{ ws_minet_wireless_interface_name }}" del iw phy phy0 interface add $INTERFACE type monitor xfce4-terminal --maximize -x horst -i $INTERFACE ;; |