diff --git a/Dockerfile b/Dockerfile index 68877974..9a203faa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM fedora:40 +FROM fedora:41 # ENV container docker ENV FEDORA_USERNAME=mikee @@ -28,18 +28,18 @@ rm -f /lib/systemd/system/basic.target.wants/*; \ rm -f /lib/systemd/system/anaconda.target.wants/*; # https://pypi.org/project/pip/ -RUN pip3 install --no-cache-dir --upgrade pip==24.0 && \ +RUN pip3 install --no-cache-dir --upgrade pip==24.3.1 && \ pip3 install --no-cache-dir \ # https://pypi.org/project/ansible/ - ansible==9.5.1 \ + ansible==10.5.0 \ # https://pypi.org/project/ansible-lint/ - ansible-lint==24.2.3 \ + ansible-lint==24.9.2 \ # https://pypi.org/project/yamllint/ yamllint==1.35.1 \ # https://pypi.org/project/packaging/ - packaging==24.0 \ + packaging==24.1 \ # https://pypi.org/project/pyOpenSSL/ - pyOpenSSL==24.1.0 + pyOpenSSL==24.2.1 # Dive RUN curl -LO https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.tar.gz && \ diff --git a/Dockerfile-ubuntu b/Dockerfile-ubuntu index 3466926c..556c9203 100644 --- a/Dockerfile-ubuntu +++ b/Dockerfile-ubuntu @@ -1,7 +1,8 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 # ENV container docker ENV UBUNTU_USERNAME=mikee +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get upgrade -y \ @@ -11,18 +12,19 @@ RUN apt-get update \ && apt-get clean all # https://pypi.org/project/pip/ -RUN pip3 install --no-cache-dir --upgrade pip==24.0 && \ - pip3 install --no-cache-dir \ +# rm -rfv /usr/lib/*/EXTERNALLY-MANAGED +# RUN pip3 install --break-system-packages --no-cache-dir --upgrade pip==24.3.1 && \ +RUN pip3 install --break-system-packages --no-cache-dir \ # https://pypi.org/project/ansible/ - ansible==9.5.1 \ + ansible==10.5.0 \ # https://pypi.org/project/ansible-lint/ - ansible-lint==24.2.3 \ + ansible-lint==24.9.2 \ # https://pypi.org/project/yamllint/ yamllint==1.35.1 \ # https://pypi.org/project/packaging/ - packaging==24.0 \ + packaging==24.1 \ # https://pypi.org/project/pyOpenSSL/ - pyOpenSSL==24.1.0 + pyOpenSSL==24.2.1 RUN useradd ${UBUNTU_USERNAME} && usermod -aG sudo ${UBUNTU_USERNAME} diff --git a/README.md b/README.md index bb392545..6e0c205e 100644 --- a/README.md +++ b/README.md @@ -165,9 +165,9 @@ Contributions are what make the open source community such an amazing place to b 1. Install - VSCode - - - Ubuntu 22.04 WSL2 + - Ubuntu 24.04 WSL2 - - - + - - - Docker Desktop for Windows - - Windows Terminal @@ -187,7 +187,7 @@ Contributions are what make the open source community such an amazing place to b ```bash sudo -i apt-get install -y git python3-pip curl sudo - pip3 install ansible + pip3 install --break-system-packages ansible ``` 4. Clone repository @@ -531,6 +531,43 @@ toolkit.tabbox.switchByScrolling = true gfx.canvas.accelerated = false ``` +20. On Fedora 41 or newer, when connection Azure DevOps or GitHub over SSH fails with an error: + +``` +ssh_dispatch_run_fatal: Connection to 40.74.28.12 port 22: error in libcrypto +``` + +It needs to fixed by executing `update-crypto-policies --set LEGACY` and rebooting the machine. + +21. ssh-config for Azure DevOps and GitHub: + +``` +Host ssh.dev.azure.com + HostName ssh.dev.azure.com + User git + Port 22 + IdentityFile ~/.ssh/id_rsa + IdentitiesOnly yes + PubkeyAcceptedKeyTypes=ssh-rsa + HostKeyAlgorithms=+ssh-rsa + +Host vs-ssh.visualstudio.com + HostName vs-ssh.visualstudio.com + User git + Port 22 + IdentityFile ~/.ssh/id_rsa + IdentitiesOnly yes + PubkeyAcceptedKeyTypes=ssh-rsa + HostKeyAlgorithms=+ssh-rsa + +Host github.com + HostName github.com + User git + Port 22 + IdentityFile ~/.ssh/id_rsa + IdentitiesOnly yes +``` + ## License diff --git a/playbooks/ansible.cfg b/playbooks/ansible.cfg index 8b050d96..eb36bf30 100644 --- a/playbooks/ansible.cfg +++ b/playbooks/ansible.cfg @@ -7,5 +7,5 @@ force_color = True forks=50 pipelining = True -stdout_callback=debug -stderr_callback=debug +# stdout_callback=debug +# stderr_callback=debug diff --git a/playbooks/group_vars/all.yml b/playbooks/group_vars/all.yml index e1b1ff66..c34112d2 100644 --- a/playbooks/group_vars/all.yml +++ b/playbooks/group_vars/all.yml @@ -53,8 +53,8 @@ dnf_pkgs: - setroubleshoot-server - ShellCheck - smartmontools - - python3.11 - - python3.11-devel + - python3.12 + - python3.12-devel - cargo - python3-argcomplete - python3-psutil @@ -103,8 +103,9 @@ flatpak_repos: url: https://flathub.org/repo/flathub.flatpakrepo pip_apps: - - name: pip - virtualenv_enabled: false + # fails on newer Ubuntu as it OS managed + # - name: pip + # virtualenv_enabled: false - name: pyOpenSSL virtualenv_enabled: false - name: ansible @@ -113,7 +114,7 @@ pip_apps: # virtualenv_enabled: false - name: azure-cli virtualenv_enabled: true - virtualenv_python: "python3.11" + # virtualenv_python: "python3.11" - name: ansible-lint virtualenv_enabled: true - name: yamllint @@ -159,7 +160,8 @@ gnome_extension_ids: "{{ gnome_shell_extensions }}" # https://github.com/gruntwork-io/terragrunt/releases/latest # terragrunt_version: 0.31.8 # https://releases.hashicorp.com/vagrant -# vagrant_version: 2.2.19 +# https://github.com/hashicorp/vagrant/issues/13527 +vagrant_version: 2.4.1 # https://github.com/boz/kail/releases # kail_version: 0.16.1 diff --git a/roles/apps/aws-cli/tasks/install.yml b/roles/apps/aws-cli/tasks/install.yml index 4a3d9456..31eb764b 100644 --- a/roles/apps/aws-cli/tasks/install.yml +++ b/roles/apps/aws-cli/tasks/install.yml @@ -4,7 +4,7 @@ name: "https://github.com/aws/aws-cli/archive/refs/tags/{{ aws_cli_version }}.tar.gz" state: present virtualenv: "{{ virtualenv_install_path }}/aws-cli" - virtualenv_python: "python3.11" + virtualenv_python: "python3.12" - name: Create a symbolic link for aws-cli file: diff --git a/roles/apps/docker/tasks/install.yml b/roles/apps/docker/tasks/install.yml index 6b1a489f..d66ed5f9 100644 --- a/roles/apps/docker/tasks/install.yml +++ b/roles/apps/docker/tasks/install.yml @@ -6,24 +6,41 @@ changed_when: docker_check.rc != 0 ignore_errors: true +# - name: Remove old deps before installing docker +# package: +# name: "{{ pkgs }}" +# state: absent +# when: docker_check.rc != 0 +# vars: +# pkgs: +# - docker +# - docker-client +# - docker-client-latest +# - docker-common +# - docker-latest +# - docker-latest-logrotate +# - docker-logrotate +# - docker-selinux +# - docker-engine-selinux +# - docker-engine +# - podman-docker + - name: Remove old deps before installing docker - package: - name: "{{ pkgs }}" - state: absent + shell: | + dnf -y remove docker \ + docker-client \ + docker-client-latest \ + docker-common \ + docker-latest \ + docker-latest-logrotate \ + docker-logrotate \ + docker-selinux \ + docker-engine-selinux \ + docker-engine + register: docker_inst_cleanup when: docker_check.rc != 0 - vars: - pkgs: - - docker - - docker-client - - docker-client-latest - - docker-common - - docker-latest - - docker-latest-logrotate - - docker-logrotate - - docker-selinux - - docker-engine-selinux - - docker-engine - - podman-docker + # changed_when: + - name: Check if docker-repo is installed shell: | @@ -36,7 +53,7 @@ when: docker_repo_check.rc != 0 - name: Install Docker - package: + dnf: name: "{{ pkgs }}" state: present vars: diff --git a/roles/apps/docker/tasks/repo.yml b/roles/apps/docker/tasks/repo.yml index c37455d0..60d4b126 100644 --- a/roles/apps/docker/tasks/repo.yml +++ b/roles/apps/docker/tasks/repo.yml @@ -1,24 +1,30 @@ --- -- name: Install Docker deps - package: - name: "dnf-plugins-core" - state: present +# - name: Install Docker deps +# package: +# name: "dnf-plugins-core" +# state: present -- name: Add docker yum repo - shell: | - dnf config-manager \ - --add-repo \ - https://download.docker.com/linux/fedora/docker-ce.repo +# - name: Add docker yum repo +# shell: | +# dnf config-manager \ +# --add-repo \ +# https://download.docker.com/linux/fedora/docker-ce.repo -- name: Check releasever - shell: | - dnf config-manager --dump-variables | grep releasever | awk '{print $NF}' - register: releasever_check - ignore_errors: true +- name: Download docker-ce.repo archive + get_url: + url: "https://download.docker.com/linux/fedora/docker-ce.repo" + dest: "/etc/yum.repos.d/docker-ce.repo" + mode: 644 -- name: Overwrite Fedora release version in yum repo URL (37 doesn't exist yet) - ansible.builtin.replace: - path: /etc/yum.repos.d/docker-ce.repo - regexp: '\$releasever' - replace: '40' - when: releasever_check.stdout == "rawhide" +# - name: Check releasever +# shell: | +# dnf config-manager --dump-variables | grep releasever | awk '{print $NF}' +# register: releasever_check +# ignore_errors: true + +# - name: Overwrite Fedora release version in yum repo URL (37 doesn't exist yet) +# ansible.builtin.replace: +# path: /etc/yum.repos.d/docker-ce.repo +# regexp: '\$releasever' +# replace: '41' +# when: releasever_check.stdout == "rawhide" diff --git a/roles/apps/vagrant/tasks/install_x86_64.yml b/roles/apps/vagrant/tasks/install_x86_64.yml index 64016505..fcd5c146 100644 --- a/roles/apps/vagrant/tasks/install_x86_64.yml +++ b/roles/apps/vagrant/tasks/install_x86_64.yml @@ -25,10 +25,10 @@ - include_tasks: get_latest_version.yml when: vagrant_version is not defined -# name: "https://releases.hashicorp.com/vagrant/{{ version.stdout }}/vagrant_{{ version.stdout }}_x86_64.rpm" +# name: "https://releases.hashicorp.com/vagrant/{{ vagrant_version }}/vagrant_{{ vagrant_version}}_x86_64.rpm" - name: Install vagrant from hashicorp repo dnf: - name: "https://releases.hashicorp.com/vagrant/{{ version.stdout }}/vagrant-{{ version.stdout }}-1.x86_64.rpm" + name: "https://releases.hashicorp.com/vagrant/{{ vagrant_version}}/vagrant-{{ vagrant_version }}-1.x86_64.rpm" state: latest disable_gpg_check: true when: installed_vagrant_version.stdout != vagrant_version diff --git a/roles/desktop/machines/wsl/tasks/main.yml b/roles/desktop/machines/wsl/tasks/main.yml index a687cfab..ddcdc487 100644 --- a/roles/desktop/machines/wsl/tasks/main.yml +++ b/roles/desktop/machines/wsl/tasks/main.yml @@ -20,10 +20,10 @@ upgrade: dist update_cache: yes -- name: Install python3.11 package - apt: - name: "python3.11" - state: present +# - name: Install python3.11 package +# apt: +# name: "python3.11" +# state: present - name: Install packages apt: diff --git a/roles/pkg_mgmt/dnf/tasks/dnf5.yml b/roles/pkg_mgmt/dnf/tasks/dnf5.yml index e90696be..a0b4d5fe 100644 --- a/roles/pkg_mgmt/dnf/tasks/dnf5.yml +++ b/roles/pkg_mgmt/dnf/tasks/dnf5.yml @@ -7,11 +7,16 @@ # - debug: # var: dnf_symlink +- name: Bootstrap a host without python3-libdnf5 installed + ansible.builtin.raw: if dnf list --installed | grep -q -i python3-libdnf5; then echo -n "exists"; else dnf install -y python3-libdnf5; fi + changed_when: python3_libdnf5_installed.stdout != "exists" + register: python3_libdnf5_installed + - name: Install dnf5 dnf: - name: ["dnf5", "python3-libdnf5"] + name: ["dnf5"] state: present - # when: dnf_symlink.stat.lnk_target == "dnf-3" + when: dnf_symlink.stat.lnk_target == "dnf-3" - name: Create a symbolic link ansible.builtin.file: @@ -20,4 +25,4 @@ owner: root group: root state: link - # when: dnf_symlink.stat.lnk_target == "dnf-3" + when: dnf_symlink.stat.lnk_target == "dnf-3" diff --git a/roles/pkg_mgmt/pip/tasks/main.yml b/roles/pkg_mgmt/pip/tasks/main.yml index 14a3a89b..432ce525 100644 --- a/roles/pkg_mgmt/pip/tasks/main.yml +++ b/roles/pkg_mgmt/pip/tasks/main.yml @@ -1,4 +1,9 @@ --- +- name: Remove all system-wide errors in pip + shell: rm -rfv /usr/lib/*/EXTERNALLY-MANAGED + register: pip_ext_managed + changed_when: pip_ext_managed.stdout != "" + - name: Install PIP virtualenv pip: name: "virtualenv" diff --git a/roles/servers/apps/home-assistant/defaults/main.yml b/roles/servers/apps/home-assistant/defaults/main.yml index 1cece1c7..75254db8 100644 --- a/roles/servers/apps/home-assistant/defaults/main.yml +++ b/roles/servers/apps/home-assistant/defaults/main.yml @@ -59,35 +59,60 @@ home_assistant: - entity_id: switch.sonoff_4chpror3_garaz_4chpror3_swiatlo_garaz_zew - entity_id: switch.sonoff_4chpror3_garaz_4chpror3_swiatlo_garaz_brama_dwor_btn + climate: + # - name: garaz + - name: przedpokoj + switch: switch.sonoff_4chpror3_podlogowkadol1_4chpror3_switch_przedpokoj + # - name: lazienka_dol + # switch: switch.sonoff_4chpror3_podlogowkadol1_4chpror3_switch_przedpokoj + - name: salon + switch: switch.sonoff_4chpror3_podlogowkadol1_4chpror3_switch_przedpokoj + - name: kuchnia + switch: switch.sonoff_4chpror3_podlogowkadol1_4chpror3_switch_przedpokoj + - name: sypialnia_dol + switch: switch.sonoff_4chpror3_podlogowkadol1_4chpror3_switch_przedpokoj + - name: pokoj_julia + switch: switch.sonoff_4chpror3_podlogowkagora1_4chpror3_switch_przedpokoj + - name: serwerownia + switch: switch.sonoff_4chpror3_podlogowkagora1_4chpror3_switch_przedpokoj + - name: pokoj_timi + switch: switch.sonoff_4chpror3_podlogowkagora1_4chpror3_switch_przedpokoj + - name: biuro_miki + switch: switch.sonoff_4chpror3_podlogowkagora1_4chpror3_switch_przedpokoj + - name: sypialnia_gora + switch: switch.sonoff_4chpror3_podlogowkagora2_4chpror3_switch_przedpokoj + - name: garderoba + switch: switch.sonoff_4chpror3_podlogowkagora2_4chpror3_switch_przedpokoj + mqtt: zigbee_coordinator_base_topic: "tasmota_10B490" sonoff: - temp_humidity: - - name: sypialnia_dol - - name: kuchnia - - name: salon - - name: sypialnia_gora - - name: biuro_miki - - name: pokoj_timi - - name: pokoj_nad_garazem - - name: garderoba - - name: serwerownia - - name: ogrod - - name: garaz - - name: lazienka_dol - - name: przedpokoj + temp_humidity: [] + # - name: sypialnia_dol + # - name: kuchnia + # - name: salon + # - name: sypialnia_gora + # - name: biuro_miki + # - name: pokoj_timi + # - name: pokoj_nad_garazem + # - name: garderoba + # - name: serwerownia + # - name: ogrod + # - name: garaz + # - name: lazienka_dol + # - name: przedpokoj - button: - - name: dol_1 - door: - - name: garaz_brama - - name: dwor_brama - zbmini: - - name: sypialnia_gora - power_plug: - - name: salon + button: [] + # - name: dol_1 + door: [] + # - name: garaz_brama + # - name: dwor_brama + zbmini: [] + # - name: sypialnia_gora + power_plug: [] + # - name: salon ikea: - button: - - name: kuchnia - tradfri_single_dimm: - - name: kuchnia_szafki + button: [] + # - name: kuchnia + tradfri_single_dimm: [] + # - name: kuchnia_szafki diff --git a/roles/servers/apps/home-assistant/templates/config/configuration.yaml b/roles/servers/apps/home-assistant/files/config/configuration.yaml similarity index 74% rename from roles/servers/apps/home-assistant/templates/config/configuration.yaml rename to roles/servers/apps/home-assistant/files/config/configuration.yaml index 2174c6c6..abbb3f4e 100644 --- a/roles/servers/apps/home-assistant/templates/config/configuration.yaml +++ b/roles/servers/apps/home-assistant/files/config/configuration.yaml @@ -67,6 +67,18 @@ sensor: !include sensors.yaml template: !include template.yaml virtual: + yaml_config: true switch: !include switch.yaml climate: !include climate.yaml + + +zha: + zigpy_config: + ota: + ikea_provider: true # Enable OTA update downloads for Trådfri devices + inovelli_provider: true # Enable OTA update downloads for INOVELLI devices + ledvance_provider: true # Enable OTA update downloads for LEDVANCE/OSRAM devices + salus_provider: true # Enable OTA update downloads for SALUS/Computime devices + sonoff_provider: true # Enable OTA update downloads for Sonoff (ITead) devices + thirdreality_provider: true # Enable OTA update downloads for 3REALITY devices diff --git a/roles/servers/apps/home-assistant/templates/config/dashboard-tesla.yaml b/roles/servers/apps/home-assistant/files/config/dashboard-tesla.yaml similarity index 100% rename from roles/servers/apps/home-assistant/templates/config/dashboard-tesla.yaml rename to roles/servers/apps/home-assistant/files/config/dashboard-tesla.yaml diff --git a/roles/servers/apps/home-assistant/templates/config/mqtt.yaml b/roles/servers/apps/home-assistant/files/config/mqtt.yaml similarity index 100% rename from roles/servers/apps/home-assistant/templates/config/mqtt.yaml rename to roles/servers/apps/home-assistant/files/config/mqtt.yaml diff --git a/roles/servers/apps/home-assistant/templates/config/multiscrape.yaml b/roles/servers/apps/home-assistant/files/config/multiscrape.yaml similarity index 100% rename from roles/servers/apps/home-assistant/templates/config/multiscrape.yaml rename to roles/servers/apps/home-assistant/files/config/multiscrape.yaml diff --git a/roles/servers/apps/home-assistant/templates/config/sensors.yaml b/roles/servers/apps/home-assistant/files/config/sensors.yaml similarity index 100% rename from roles/servers/apps/home-assistant/templates/config/sensors.yaml rename to roles/servers/apps/home-assistant/files/config/sensors.yaml diff --git a/roles/servers/apps/home-assistant/templates/config/template.yaml b/roles/servers/apps/home-assistant/files/config/template.yaml similarity index 100% rename from roles/servers/apps/home-assistant/templates/config/template.yaml rename to roles/servers/apps/home-assistant/files/config/template.yaml diff --git a/roles/servers/apps/home-assistant/files/config/zvirtual.yaml b/roles/servers/apps/home-assistant/files/config/zvirtual.yaml new file mode 100644 index 00000000..acfc79eb --- /dev/null +++ b/roles/servers/apps/home-assistant/files/config/zvirtual.yaml @@ -0,0 +1,42 @@ +--- +version: 1 +devices: + ogrzewanie_pompy: + - platform: switch + name: ogrzewanie_pompy + ogrzewanie_dol_lazienka: + - platform: switch + name: ogrzewanie_dol_lazienka + ogrzewanie_dol_sypialnia: + - platform: switch + name: ogrzewanie_dol_sypialnia + ogrzewanie_dol_salon: + - platform: switch + name: ogrzewanie_dol_salon + ogrzewanie_dol_kuchnia: + - platform: switch + name: ogrzewanie_dol_kuchnia + ogrzewanie_dol_przedpokoj: + - platform: switch + name: ogrzewanie_dol_przedpokoj + ogrzewanie_gora_pokoj_julia: + - platform: switch + name: ogrzewanie_gora_pokoj_julia + ogrzewanie_gora_garderoba: + - platform: switch + name: ogrzewanie_gora_gaderoba + ogrzewanie_gora_sypialnia: + - platform: switch + name: ogrzewanie_gora_sypialnia + ogrzewanie_gora_biuro_miki: + - platform: switch + name: ogrzewanie_gora_biuro_miki + ogrzewanie_gora_lazienka: + - platform: switch + name: ogrzewanie_gora_lazienka + ogrzewanie_gora_pokoj_timi: + - platform: switch + name: ogrzewanie_gora_pokoj_timi + ogrzewanie_gora_pokoj_timi: + - platform: switch + name: ogrzewanie_gora_korytarz diff --git a/roles/servers/apps/home-assistant/tasks/config.yml b/roles/servers/apps/home-assistant/tasks/config.yml index a0a2140f..581f0132 100644 --- a/roles/servers/apps/home-assistant/tasks/config.yml +++ b/roles/servers/apps/home-assistant/tasks/config.yml @@ -12,12 +12,22 @@ - "{{ install_path }}/config/mqtt/lights" - "{{ install_path }}/config/mqtt/switches" -- name: Configure config +- name: Configure config files copy: src: "{{ item }}" dest: "{{ install_path }}/config/" mode: 0664 backup: true + with_fileglob: + - ../files/config/* + # - "{{ playbook_dir }}/../../ansible-ops-private/templates/home-assistant/config/*" + +- name: Configure config templates + template: + src: "{{ item }}" + dest: "{{ install_path }}/config/" + mode: 0664 + backup: true with_fileglob: - ../templates/config/* - "{{ playbook_dir }}/../../ansible-ops-private/templates/home-assistant/config/*" @@ -82,3 +92,13 @@ when: not storage_result.stat.exists with_fileglob: - "{{ playbook_dir }}/../../ansible-ops-private/templates/home-assistant/.storage/*" + +- name: Configure config init + copy: + src: "{{ item }}" + dest: "{{ install_path }}/config/" + mode: 0664 + backup: true + force: false + with_fileglob: + - "{{ playbook_dir }}/../../ansible-ops-private/templates/home-assistant/config_init/*" diff --git a/roles/servers/apps/home-assistant/tasks/main.yml b/roles/servers/apps/home-assistant/tasks/main.yml index f4f32d59..5b47208e 100644 --- a/roles/servers/apps/home-assistant/tasks/main.yml +++ b/roles/servers/apps/home-assistant/tasks/main.yml @@ -21,7 +21,7 @@ # - include_tasks: cleanup.yml # when: home_assistant_clean -- import_tasks: custom.yml +# - import_tasks: custom.yml - import_tasks: config.yml -- import_tasks: config_mosquitto.yml -- import_tasks: install.yml +# - import_tasks: config_mosquitto.yml +# - import_tasks: install.yml diff --git a/roles/servers/apps/home-assistant/templates/config/automations/automations.yaml b/roles/servers/apps/home-assistant/templates/config/automations/automations.yaml index cc016de9..5c5a4ae2 100644 --- a/roles/servers/apps/home-assistant/templates/config/automations/automations.yaml +++ b/roles/servers/apps/home-assistant/templates/config/automations/automations.yaml @@ -11,7 +11,7 @@ - service: switch.turn_on data: {} target: - entity_id: switch.gosund_switch_pompa_cyrkulacyjna + entity_id: switch.gosund_pompa_gosund_switch_pompa_cyrkulacyjna mode: single - alias: Wylacz cyrkulacje description: '' @@ -25,7 +25,7 @@ - service: switch.turn_off data: {} target: - entity_id: switch.gosund_switch_pompa_cyrkulacyjna + entity_id: switch.gosund_pompa_gosund_switch_pompa_cyrkulacyjna mode: single - alias: Click button to close dwor_brama description: '' @@ -43,6 +43,50 @@ target: entity_id: switch.sonoff_4chpror3_dwor_4chpror3_switch_dwor_brama mode: single +- alias: ogrzewanie_wlacz + description: "" + triggers: + - trigger: state + entity_id: +{% for i in home_assistant.climate %} + - switch.virtual_ogrzewanie_{{ i.name }} +{% endfor %} + from: "off" + to: "on" + conditions: [] + actions: + - action: switch.turn_on + metadata: {} + data: {} + target: + entity_id: switch.virtual_ogrzewanie_pompy + mode: single +- alias: ogrzewanie_wylacz + description: "" + triggers: + - trigger: state + entity_id: + - switch.group_ogrzewanie_podlogowe + from: "on" + to: "off" + conditions: [] + actions: + # - action: switch.turn_on + # metadata: {} + # data: {} + # target: + # entity_id: switch.virtual_ogrzewanie_dol_lazienka + # - delay: + # hours: 0 + # minutes: 1 + # seconds: 0 + # milliseconds: 0 + - action: switch.turn_off + metadata: {} + data: {} + target: + entity_id: switch.virtual_ogrzewanie_pompy + mode: single # - alias: Alert Brama # description: '' diff --git a/roles/servers/apps/home-assistant/templates/config/climate.yaml b/roles/servers/apps/home-assistant/templates/config/climate.yaml index 3280bf36..cdc0b162 100644 --- a/roles/servers/apps/home-assistant/templates/config/climate.yaml +++ b/roles/servers/apps/home-assistant/templates/config/climate.yaml @@ -1,14 +1,14 @@ --- +{% for i in home_assistant.climate %} - platform: generic_thermostat - name: sypialnia_dol - heater: switch.virtual_ogrzewanie_dol_sypialnia - target_sensor: sensor.th_temperature_sypialnia_dol -- platform: generic_thermostat - name: kuchnia - heater: switch.virtual_ogrzewanie_dol_kuchnia - target_sensor: sensor.th_temperature_kuchnia + name: "{{ i.name }}" + # heater: "{{ i.switch }}" + heater: "switch.virtual_ogrzewanie_{{ i.name }}" + target_sensor: "sensor.th_{{ i.name }}_temperature" min_temp: 16 max_temp: 24 + target_temp: 20.0 initial_hvac_mode: heat cold_tolerance: 0.2 hot_tolerance: 0.2 +{% endfor %} diff --git a/roles/servers/apps/home-assistant/templates/config/switch.yaml b/roles/servers/apps/home-assistant/templates/config/switch.yaml index 0acd1394..2f6cf585 100644 --- a/roles/servers/apps/home-assistant/templates/config/switch.yaml +++ b/roles/servers/apps/home-assistant/templates/config/switch.yaml @@ -2,38 +2,14 @@ - platform: virtual name: ogrzewanie_pompy +{% for i in home_assistant.climate %} - platform: virtual - name: ogrzewanie_dol_lazienka + name: ogrzewanie_{{ i.name }} +{% endfor %} -- platform: virtual - name: ogrzewanie_dol_sypialnia - -- platform: virtual - name: ogrzewanie_dol_salon - -- platform: virtual - name: ogrzewanie_dol_kuchnia - -- platform: virtual - name: ogrzewanie_dol_korytarz - -- platform: virtual - name: ogrzewanie_gora_biuro_miki - -- platform: virtual - name: ogrzewanie_gora_garderoba - -- platform: virtual - name: ogrzewanie_gora_sypialnia - -- platform: virtual - name: ogrzewanie_gora_pokoj_nad_garazem - -- platform: virtual - name: ogrzewanie_gora_lazienka - -- platform: virtual - name: ogrzewanie_gora_timi_pokoj - -- platform: virtual - name: ogrzewanie_gora_korytarz +- platform: group + name: group_ogrzewanie_podlogowe + entities: +{% for i in home_assistant.climate %} + - switch.virtual_ogrzewanie_{{ i.name }} +{% endfor %} diff --git a/roles/servers/apps/home-assistant/templates/config/ui-lovelace.yaml b/roles/servers/apps/home-assistant/templates/config/ui-lovelace.yaml index 615eff2f..6b204366 100644 --- a/roles/servers/apps/home-assistant/templates/config/ui-lovelace.yaml +++ b/roles/servers/apps/home-assistant/templates/config/ui-lovelace.yaml @@ -8,165 +8,177 @@ views: entities: - type: section label: Inne - - entity: sensor.th_temperature_ogrod + - entity: sensor.th_ogrod_temperature type: custom:multiple-entity-row name: Ogrod show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_ogrod + - entity: sensor.th_ogrod_temperature name: Temperatura - - entity: sensor.th_humidity_ogrod + - entity: sensor.th_ogrod_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_ogrod + - entity: sensor.th_ogrod_battery name: Bateria - - entity: sensor.th_temperature_garaz + - entity: sensor.th_garaz_temperature type: custom:multiple-entity-row name: Garaz show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_garaz + - entity: sensor.th_garaz_temperature name: Temperatura - - entity: sensor.th_humidity_garaz + - entity: sensor.th_garaz_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_garaz + - entity: sensor.th_garaz_battery name: Bateria - type: section label: Dol - - entity: sensor.th_temperature_kuchnia + - entity: sensor.th_kuchnia_temperature type: custom:multiple-entity-row name: Kuchnia show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_kuchnia + - entity: sensor.th_kuchnia_temperature name: Temperatura - - entity: sensor.th_humidity_kuchnia + - entity: sensor.th_kuchnia_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_kuchnia + - entity: sensor.th_kuchnia_battery name: Bateria - - entity: sensor.th_temperature_salon + - entity: sensor.th_salon_temperature type: custom:multiple-entity-row name: Salon show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_salon + - entity: sensor.th_salon_temperature name: Temperatura - - entity: sensor.th_humidity_salon + - entity: sensor.th_salon_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_salon + - entity: sensor.th_salon_battery name: Bateria - - entity: sensor.th_temperature_sypialnia_dol + - entity: sensor.th_sypialnia_dol_temperature type: custom:multiple-entity-row name: Sypialnia Dol show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_sypialnia_dol + - entity: sensor.th_sypialnia_dol_temperature name: Temperatura - - entity: sensor.th_humidity_sypialnia_dol + - entity: sensor.th_sypialnia_dol_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_sypialnia_dol + - entity: sensor.th_sypialnia_dol_battery name: Bateria - - entity: sensor.th_temperature_lazienka_dol + - entity: sensor.th_lazienka_dol_temperature type: custom:multiple-entity-row name: Lazienka Dol show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_lazienka_dol + - entity: sensor.th_lazienka_dol_temperature name: Temperatura - - entity: sensor.th_humidity_lazienka_dol + - entity: sensor.th_lazienka_dol_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_lazienka_dol + - entity: sensor.th_lazienka_dol_battery name: Bateria - - entity: sensor.th_temperature_przedpokoj + - entity: sensor.th_przedpokoj_temperature type: custom:multiple-entity-row name: Przedpokoj show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_przedpokoj + - entity: sensor.th_przedpokoj_temperature name: Temperatura - - entity: sensor.th_humidity_przedpokoj + - entity: sensor.th_przedpokoj_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_przedpokoj + - entity: sensor.th_przedpokoj_battery name: Bateria - type: section label: Gora - - entity: sensor.th_temperature_pokoj_timi + - entity: sensor.th_pokoj_timi_temperature type: custom:multiple-entity-row name: Pokoj Timi show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_pokoj_timi + - entity: sensor.th_pokoj_timi_temperature name: Temperatura - - entity: sensor.th_humidity_pokoj_timi + - entity: sensor.th_pokoj_timi_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_pokoj_timi + - entity: sensor.th_pokoj_timi_battery name: Bateria - - entity: sensor.th_temperature_pokoj_nad_garazem + # - entity: sensor.th_lazienka_gora_temperature + # type: custom:multiple-entity-row + # name: Pokoj Timi + # show_state: false + # secondary_info: last-changed + # entities: + # - entity: sensor.th_lazienka_gora_temperature + # name: Temperatura + # - entity: sensor.th_lazienka_gora_humidity + # name: Wilgotnosc + # - entity: sensor.th_lazienka_gora_battery + # name: Bateria + - entity: sensor.th_biuro_miki_temperature type: custom:multiple-entity-row - name: Pokoj nad garazem + name: Biuro Miki show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_pokoj_nad_garazem + - entity: sensor.th_biuro_miki_temperature name: Temperatura - - entity: sensor.th_humidity_pokoj_nad_garazem + - entity: sensor.th_biuro_miki_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_pokoj_nad_garazem + - entity: sensor.th_biuro_miki_battery name: Bateria - - entity: sensor.th_temperature_sypialnia_gora + - entity: sensor.th_sypialnia_gora_temperature type: custom:multiple-entity-row name: Sypialnia Gora show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_sypialnia_gora + - entity: sensor.th_sypialnia_gora_temperature name: Temperatura - - entity: sensor.th_humidity_sypialnia_gora + - entity: sensor.th_sypialnia_gora_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_sypialnia_gora + - entity: sensor.th_sypialnia_gora_battery name: Bateria - - entity: sensor.th_temperature_garderoba + - entity: sensor.th_garderoba_temperature type: custom:multiple-entity-row name: Garderoba show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_garderoba + - entity: sensor.th_garderoba_temperature name: Temperatura - - entity: sensor.th_humidity_garderoba + - entity: sensor.th_garderoba_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_garderoba + - entity: sensor.th_garderoba_battery name: Bateria - - entity: sensor.th_temperature_serwerownia + - entity: sensor.th_serwerownia_temperature type: custom:multiple-entity-row name: Serwerownia show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_serwerownia + - entity: sensor.th_serwerownia_temperature name: Temperatura - - entity: sensor.th_humidity_serwerownia + - entity: sensor.th_serwerownia_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_serwerownia + - entity: sensor.th_serwerownia_battery name: Bateria - - entity: sensor.th_temperature_biuro_miki + - entity: sensor.th_pokoj_julia_temperature type: custom:multiple-entity-row - name: Biuro Miki + name: Pokoj Julia show_state: false secondary_info: last-changed entities: - - entity: sensor.th_temperature_biuro_miki + - entity: sensor.th_pokoj_julia_temperature name: Temperatura - - entity: sensor.th_humidity_biuro_miki + - entity: sensor.th_pokoj_julia_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_biuro_miki + - entity: sensor.th_pokoj_julia_battery name: Bateria - type: entities entities: @@ -178,10 +190,10 @@ views: - entity: switch.sonoff_minir2_salon_kinkiety_minir2_swiatlo_salon_kinkiety name: Salon Kinkiety icon: mdi:wall-sconce - - entity: switch.spp_salon + - entity: switch.sp_sonoff_salon_switch name: Salon Lampa icon: mdi:floor-lamp-torchiere-variant - - entity: light.ikea_tradfri_kuchnia_szafki + - entity: light.ikea_led_kuchnia_light name: Kuchnia LED szafki icon: mdi:led-strip - entity: switch.sonoff_minir2_taras_minir2_swiatlo_taras @@ -193,9 +205,15 @@ views: icon: mdi:ceiling-light - type: section label: Gora - - entity: switch.zbmini_swiatlo_sypialnia_gora + - entity: light.zbmini_sypialnia_gora_light name: Sypialnia Gora icon: mdi:ceiling-light + - entity: light.ikea_bulb_lampka_sypialnia_gora_light + name: Sypialnia Gora Lampka + icon: mdi:lamp + - entity: light.ikea_bulb_biuro_miki_light + name: Biuro Miki Lampka + icon: mdi:lamp title: Swiatla show_header_toggle: false state_color: true @@ -274,13 +292,13 @@ views: title: SpeedTest - type: entities entities: - - entity: sensor.ikea_button_state_kuchnia + - entity: sensor.ikea_5b_kuchnia_battery type: custom:multiple-entity-row name: Ikea kuchnia show_state: false icon: mdi:gesture-tap-button entities: - - entity: sensor.ikea_button_battery_percentage_kuchnia + - entity: sensor.ikea_5b_kuchnia_battery name: Battery - entity: sensor.button_state_dol_1 type: custom:multiple-entity-row @@ -319,9 +337,9 @@ views: toggle: true show_state: true entities: - - entity: sensor.door_battery_percentage_garaz_brama + - entity: sensor.door_brama_garaz_battery name: Bateria - - entity: binary_sensor.door_state_garaz_brama + - entity: binary_sensor.door_brama_garaz_opening name: Stan - entity: switch.sonoff_4chpror3_garaz_4chpror3_swiatlo_garaz_wew name: Garaz Swiatlo @@ -486,20 +504,20 @@ views: cards: - type: entities entities: - - vacuum.roborock_s5_max - - sensor.roborock_s5_max_battery - - sensor.roborock_s5_max_status - - entity: select.roborock_s5_max_mop_intensity + - vacuum.roborock_qrevo_master + - sensor.roborock_qrevo_master_battery + - sensor.roborock_qrevo_master_status + - entity: select.roborock_qrevo_master_mop_intensity name: Mop intensity - - binary_sensor.roborock_s5_max_mop_attached - - binary_sensor.roborock_s5_max_water_box_attached - - entity: sensor.roborock_s5_max_cleaning_time + - binary_sensor.roborock_qrevo_master_mop_attached + - binary_sensor.roborock_qrevo_master_water_box_attached + - entity: sensor.roborock_qrevo_master_cleaning_time name: Cleaning time - - entity: image.roborock_s5_max_dol + - entity: image.roborock_qrevo_master_dol name: Mapa dol - - entity: image.roborock_s5_max_gora + - entity: image.roborock_qrevo_master_gora name: Mapa gora - title: Roborock S5 Max + title: Roborock Qrevo Master - type: entities entities: - entity: sensor.nawilzacz_powietrza_humidity @@ -568,22 +586,16 @@ views: - type: entities entities: - switch.virtual_ogrzewanie_pompy - - switch.virtual_ogrzewanie_dol_korytarz - - switch.virtual_ogrzewanie_dol_kuchnia - - switch.virtual_ogrzewanie_dol_lazienka - - switch.virtual_ogrzewanie_dol_salon - - switch.virtual_ogrzewanie_dol_sypialnia - - switch.virtual_ogrzewanie_gora_biuro_miki - - switch.virtual_ogrzewanie_gora_garderoba - - switch.virtual_ogrzewanie_gora_korytarz - - switch.virtual_ogrzewanie_gora_lazienka - - switch.virtual_ogrzewanie_gora_pokoj_nad_garazem - - switch.virtual_ogrzewanie_gora_sypialnia - - switch.virtual_ogrzewanie_gora_timi_pokoj - - type: thermostat - entity: climate.sypialnia_dol + - switch.group_ogrzewanie_podlogowe + - type: section + label: Silowniki +{% for i in home_assistant.climate %} + - switch.virtual_ogrzewanie_{{ i.name }} +{% endfor %} +{% for i in home_assistant.climate %} - type: thermostat - entity: climate.kuchnia + entity: climate.{{ i.name }} +{% endfor %} - type: entities title: Temperatury Zigbee entities: @@ -591,11 +603,15 @@ views: type: custom:multiple-entity-row name: Kuchnia show_state: false + secondary_info: last-changed entities: - - entity: sensor.th_temperature_kuchnia + - entity: climate.kuchnia + name: Termostat + name: Termostat Stan + - entity: sensor.th_kuchnia_temperature name: Temperatura - - entity: sensor.th_humidity_kuchnia + - entity: sensor.th_kuchnia_humidity name: Wilgotnosc - - entity: sensor.th_battery_percentage_kuchnia + - entity: sensor.th_kuchnia_battery name: Bateria title: MikiDashboardYAML diff --git a/roles/servers/apps/home-assistant/templates/docker-compose.yml b/roles/servers/apps/home-assistant/templates/docker-compose.yml index ff6d182f..25a7849b 100644 --- a/roles/servers/apps/home-assistant/templates/docker-compose.yml +++ b/roles/servers/apps/home-assistant/templates/docker-compose.yml @@ -17,8 +17,8 @@ services: environment: # DISABLE_JEMALLOC: true TZ: 'Europe/Warsaw' - # devices: - # - /dev/ttyUSB0:/dev/ttyUSB0 + devices: + - /dev/ttyUSB0:/dev/ttyUSB0 ports: - '8123:8123' logging: diff --git a/roles/servers/apps/jenkins/templates/casc_configs/jenkins.yml b/roles/servers/apps/jenkins/templates/casc_configs/jenkins.yml index 9f948875..60755656 100644 --- a/roles/servers/apps/jenkins/templates/casc_configs/jenkins.yml +++ b/roles/servers/apps/jenkins/templates/casc_configs/jenkins.yml @@ -39,9 +39,9 @@ security: useScriptSecurity: false unclassified: - locale: - systemLocale: en - ignoreAcceptLanguage: true + # locale: + # systemLocale: en + # ignoreAcceptLanguage: true location: adminAddress: "mikee@jenkins.local" diff --git a/roles/servers/libvirt/defaults/main.yml b/roles/servers/libvirt/defaults/main.yml index 6899d35e..10ee1e93 100644 --- a/roles/servers/libvirt/defaults/main.yml +++ b/roles/servers/libvirt/defaults/main.yml @@ -14,17 +14,11 @@ cloud_init_config_files: # https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html # https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html -# cloud_image_url: "https://dl.fedoraproject.org/pub/fedora/linux/releases/35/Cloud/aarch64/images/Fedora-Cloud-Base-35-1.2.aarch64.qcow2" -# cloud_image_name: "Fedora-Cloud-Base-35-1.2.aarch64.qcow2" -# cloud_image_checksum: "sha256:c71f2e6ce75b516d565e2c297ea9994c69b946cb3eaa0a4bbea400dbd6f59ae6." -# https://download.fedoraproject.org/pub/fedora/linux/releases/39/Cloud/x86_64/images/ -# cloud_image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/39/Cloud/x86_64/images/Fedora-Cloud-Base-39-1.5.x86_64.qcow2" -# cloud_image_name: "Fedora-Cloud-Base-39-1.5.x86_64.qcow2" -# cloud_image_checksum: "sha256:ab5be5058c5c839528a7d6373934e0ce5ad6c8f80bd71ed3390032027da52f37" -cloud_image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-UEFI-UKI.x86_64-40-1.14.qcow2" -cloud_image_name: "Fedora-Cloud-Base-UEFI-UKI.x86_64-40-1.14.qcow2" -cloud_image_checksum: "sha256:e58fbd6c147c0eda6eca72491ddc74871c3c3db9b808dc4fcf0d313510c43d81" - +# https://mirroronet.pl/pub/mirrors/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2 +# https://mirroronet.pl/pub/mirrors/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-UEFI-UKI-41-1.4.x86_64.qcow2 +cloud_image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/Fedora-Cloud-Base-UEFI-UKI-41-1.4.x86_64.qcow2" +cloud_image_name: "Fedora-Cloud-Base-UEFI-UKI-41-1.4.x86_64.qcow2" +cloud_image_checksum: "sha256:2a39a9c66d4c18f6541e0ca160beaceeb6b3f802e9f24affaf8292d679e0f1c2" libvirt_images_dir: "/var/lib/libvirt/images" diff --git a/roles/servers/libvirt/tasks/setup.yml b/roles/servers/libvirt/tasks/setup.yml index 98c1d103..8c9456b0 100644 --- a/roles/servers/libvirt/tasks/setup.yml +++ b/roles/servers/libvirt/tasks/setup.yml @@ -22,3 +22,8 @@ package: name: genisoimage state: present + +- name: "Install pip passlib" + pip: + name: passlib + state: present