From 1e56e04ed52da85e05593e9b89b0dd6f1e79abab Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 9 Dec 2023 15:50:11 +0100 Subject: [PATCH 001/374] 111 --- playbooks/mailu_switch_to_primary.yaml | 5 ++++- playbooks/sync_all.yaml | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/playbooks/mailu_switch_to_primary.yaml b/playbooks/mailu_switch_to_primary.yaml index d007ee1..20ad91c 100644 --- a/playbooks/mailu_switch_to_primary.yaml +++ b/playbooks/mailu_switch_to_primary.yaml @@ -20,6 +20,9 @@ - mailu2-webmail-1 - HomeAssistant - mosquitto-mosquitto-1 + - gitlab + - semaphore-app-1 + - semaphore-db-1 tasks: - name: Get ruleset @@ -58,7 +61,7 @@ # - 180 - name: Stop mailu containers - command: "docker pause {{ containers | join(' ') }}" + command: "docker stop {{ containers | join(' ') }}" become: true ignore_errors: true when: inventory_hostname in groups['raspberry'] \ No newline at end of file diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 31d4641..a6d446a 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -3,15 +3,15 @@ hosts: containers gather_facts: false tasks: - - include_tasks: stop_containers.yaml - name: Stop Containers - when: inventory_hostname in groups['raspberrypi5'] - - name: Pause for 60 seconds - ansible.builtin.pause: - seconds: 60 + # - include_tasks: stop_containers.yaml + # name: Stop Containers + # when: inventory_hostname in groups['raspberrypi5'] + # - name: Pause for 60 seconds + # ansible.builtin.pause: + # seconds: 60 - - include_tasks: sync_container_data.yaml - name: Sync Container Data + # - include_tasks: sync_container_data.yaml + # name: Sync Container Data - include_tasks: reconfigure_nginx.yaml name: Reconfigure nginx proxy manager loop: From 5c14f4c9a6a726894cb92b4b29446569ea54180a Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 9 Dec 2023 16:05:41 +0100 Subject: [PATCH 002/374] 111 --- playbooks/mailu_switch_to_primary.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_primary.yaml b/playbooks/mailu_switch_to_primary.yaml index 20ad91c..059ed6d 100644 --- a/playbooks/mailu_switch_to_primary.yaml +++ b/playbooks/mailu_switch_to_primary.yaml @@ -31,7 +31,7 @@ register: ruleset - name: Set new ruleset - command: nvram set vts_rulelist="{{ ruleset.stdout | replace('192.168.77.246', '192.168.77.106') }}" + command: nvram set vts_rulelist="{{ ruleset.stdout | replace('192.168.77.238', '192.168.77.106') }}" when: inventory_hostname in groups['router'] - name: Nvram commit From ad548611b208e4919324a37368ef145062fd2fdf Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 9 Dec 2023 16:09:42 +0100 Subject: [PATCH 003/374] 111 --- playbooks/mailu_switch_to_primary.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_primary.yaml b/playbooks/mailu_switch_to_primary.yaml index 059ed6d..009d791 100644 --- a/playbooks/mailu_switch_to_primary.yaml +++ b/playbooks/mailu_switch_to_primary.yaml @@ -64,4 +64,4 @@ command: "docker stop {{ containers | join(' ') }}" become: true ignore_errors: true - when: inventory_hostname in groups['raspberry'] \ No newline at end of file + when: inventory_hostname in groups['raspberry'] or inventory_hostname in groups['raspberrypi5'] \ No newline at end of file From 6b0693a9d099487899edef9e42d7e9c246a9ca44 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 10 Dec 2023 13:35:30 +0100 Subject: [PATCH 004/374] 111 --- playbooks/00_poweroff.yml | 1 + playbooks/sync_all.yaml | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/playbooks/00_poweroff.yml b/playbooks/00_poweroff.yml index f37d03e..5908b42 100644 --- a/playbooks/00_poweroff.yml +++ b/playbooks/00_poweroff.yml @@ -5,3 +5,4 @@ tasks: - name: Shut down community.general.shutdown: + ignore_errors: yes diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index a65d396..0923d8d 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -56,4 +56,16 @@ when: inventory_hostname in groups['raspberrypi5'] - include_tasks: start_containers.yaml name: Start Containers + when: inventory_hostname in groups['raspberrypi5'] + - name: Get relevant configs + ansible.builtin.shell: 'docker exec -it gitlab update-permissions' + ignore_errors: yes + become: yes + register: result + when: inventory_hostname in groups['raspberrypi5'] + - name: Get relevant configs + ansible.builtin.shell: 'docker restart gitlab' + ignore_errors: yes + become: yes + register: result when: inventory_hostname in groups['raspberrypi5'] \ No newline at end of file From 9209d134a5e1224f04220c23f67d991a0a96f36c Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 11 Dec 2023 17:33:05 +0100 Subject: [PATCH 005/374] 111 --- playbooks/00_initial_adjustments.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/playbooks/00_initial_adjustments.yml b/playbooks/00_initial_adjustments.yml index 742dcaa..2f7a7de 100644 --- a/playbooks/00_initial_adjustments.yml +++ b/playbooks/00_initial_adjustments.yml @@ -13,18 +13,32 @@ ansible.builtin.lineinfile: path: /home/jd/.bashrc line: "export HISTCONTROL=ignoreboth" + # - name: Set a hostname + # ansible.builtin.hostname: + # name: >- + # {%- if ansible_eth0.macaddress == "00:1e:06:48:cd:8e" -%} + # odroidc4-1 + # {%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:00" -%} + # odroidc4-2 + # {%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:01" -%} + # odroidc4-3 + # {%- elif ansible_eth0.macaddress == "00:1e:06:48:cd:86" -%} + # odroidc4-4 + # {%- elif ansible_eth0.macaddress == "00:1e:06:48:b3:0c" -%} + # odroidc4-5 + # {%- endif -%} - name: Set a hostname ansible.builtin.hostname: name: >- - {%- if ansible_eth0.macaddress == "00:1e:06:48:cd:8e" -%} + {%- if ansible_end0.macaddress == "00:1e:06:48:cd:8e" -%} odroidc4-1 - {%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:00" -%} + {%- elif ansible_end0.macaddress == "00:1e:06:48:d0:00" -%} odroidc4-2 - {%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:01" -%} + {%- elif ansible_end0.macaddress == "00:1e:06:48:d0:01" -%} odroidc4-3 - {%- elif ansible_eth0.macaddress == "00:1e:06:48:cd:86" -%} + {%- elif ansible_end0.macaddress == "00:1e:06:48:cd:86" -%} odroidc4-4 - {%- elif ansible_eth0.macaddress == "00:1e:06:48:b3:0c" -%} + {%- elif ansible_end0.macaddress == "00:1e:06:48:b3:0c" -%} odroidc4-5 {%- endif -%} From f774b136f37e07606d929aab3af180a92df2f711 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 11 Dec 2023 17:41:59 +0100 Subject: [PATCH 006/374] 111 --- playbooks/00_initial_adjustments.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/00_initial_adjustments.yml b/playbooks/00_initial_adjustments.yml index 2f7a7de..c67afc1 100644 --- a/playbooks/00_initial_adjustments.yml +++ b/playbooks/00_initial_adjustments.yml @@ -1,7 +1,7 @@ - hosts: odroid_cluster name: Initial Adjustments become: true - gather_facts: no + gather_facts: yes vars: iface: "eth0" tasks: From a5061d7e77179bf9e2c6774851e0f0aa327bcdc8 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 08:16:23 +0100 Subject: [PATCH 007/374] 111 --- playbooks/00_initial_adjustments.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playbooks/00_initial_adjustments.yml b/playbooks/00_initial_adjustments.yml index c67afc1..b1f4944 100644 --- a/playbooks/00_initial_adjustments.yml +++ b/playbooks/00_initial_adjustments.yml @@ -5,6 +5,8 @@ vars: iface: "eth0" tasks: + - debug: + msg: "{{ ansible_default_ipv4.interface }}" - name: Reconfigure /root/.bashrc ansible.builtin.lineinfile: path: /root/.bashrc From 7adcd0a3fec632ddfdb2e49656ae79a5a7f16527 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 08:17:32 +0100 Subject: [PATCH 008/374] 111 --- playbooks/00_initial_adjustments.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/playbooks/00_initial_adjustments.yml b/playbooks/00_initial_adjustments.yml index b1f4944..3cfc165 100644 --- a/playbooks/00_initial_adjustments.yml +++ b/playbooks/00_initial_adjustments.yml @@ -5,8 +5,9 @@ vars: iface: "eth0" tasks: - - debug: - msg: "{{ ansible_default_ipv4.interface }}" + - name: Debug + ansible.builtin.debug: + msg: "{{ ansible_default_ipv4.interface }}" - name: Reconfigure /root/.bashrc ansible.builtin.lineinfile: path: /root/.bashrc From 7cb78be4878508704b949e02c010f8a9b2cc02ce Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 08:20:05 +0100 Subject: [PATCH 009/374] 111 --- playbooks/00_initial_adjustments.yml | 32 +++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/playbooks/00_initial_adjustments.yml b/playbooks/00_initial_adjustments.yml index 3cfc165..ece1648 100644 --- a/playbooks/00_initial_adjustments.yml +++ b/playbooks/00_initial_adjustments.yml @@ -8,6 +8,7 @@ - name: Debug ansible.builtin.debug: msg: "{{ ansible_default_ipv4.interface }}" + - name: Reconfigure /root/.bashrc ansible.builtin.lineinfile: path: /root/.bashrc @@ -16,20 +17,21 @@ ansible.builtin.lineinfile: path: /home/jd/.bashrc line: "export HISTCONTROL=ignoreboth" - # - name: Set a hostname - # ansible.builtin.hostname: - # name: >- - # {%- if ansible_eth0.macaddress == "00:1e:06:48:cd:8e" -%} - # odroidc4-1 - # {%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:00" -%} - # odroidc4-2 - # {%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:01" -%} - # odroidc4-3 - # {%- elif ansible_eth0.macaddress == "00:1e:06:48:cd:86" -%} - # odroidc4-4 - # {%- elif ansible_eth0.macaddress == "00:1e:06:48:b3:0c" -%} - # odroidc4-5 - # {%- endif -%} + - name: Set a hostname + ansible.builtin.hostname: + name: >- + {%- if ansible_eth0.macaddress == "00:1e:06:48:cd:8e" -%} + odroidc4-1 + {%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:00" -%} + odroidc4-2 + {%- elif ansible_eth0.macaddress == "00:1e:06:48:d0:01" -%} + odroidc4-3 + {%- elif ansible_eth0.macaddress == "00:1e:06:48:cd:86" -%} + odroidc4-4 + {%- elif ansible_eth0.macaddress == "00:1e:06:48:b3:0c" -%} + odroidc4-5 + {%- endif -%} + when: "{{ ansible_default_ipv4.interface }}" == "eth0" - name: Set a hostname ansible.builtin.hostname: name: >- @@ -44,7 +46,7 @@ {%- elif ansible_end0.macaddress == "00:1e:06:48:b3:0c" -%} odroidc4-5 {%- endif -%} - + when: "{{ ansible_default_ipv4.interface }}" == "end0" - name: Iptables 1 ansible.builtin.command: iptables -F From 0efd569d51299a220fe5b10f0a2964f3210f44cc Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 08:21:15 +0100 Subject: [PATCH 010/374] 111 --- playbooks/00_initial_adjustments.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/00_initial_adjustments.yml b/playbooks/00_initial_adjustments.yml index ece1648..e2ed4f2 100644 --- a/playbooks/00_initial_adjustments.yml +++ b/playbooks/00_initial_adjustments.yml @@ -31,7 +31,7 @@ {%- elif ansible_eth0.macaddress == "00:1e:06:48:b3:0c" -%} odroidc4-5 {%- endif -%} - when: "{{ ansible_default_ipv4.interface }}" == "eth0" + when: ansible_default_ipv4.interface == "eth0" - name: Set a hostname ansible.builtin.hostname: name: >- @@ -46,7 +46,7 @@ {%- elif ansible_end0.macaddress == "00:1e:06:48:b3:0c" -%} odroidc4-5 {%- endif -%} - when: "{{ ansible_default_ipv4.interface }}" == "end0" + when: ansible_default_ipv4.interface == "end0" - name: Iptables 1 ansible.builtin.command: iptables -F From 637e2ae0c6fc26a858534387ac0fe70ab45fb839 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 09:08:54 +0100 Subject: [PATCH 011/374] 111 --- playbooks/05_install_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index 6475fee..ab917f3 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -36,7 +36,7 @@ content: | [Service] ExecStart= - ExecStart=/usr/sbin/dockerd -H fd:// -H tcp://0.0.0.0:2375 + ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 - name: Just force systemd to reread configs (2.4 and above) ansible.builtin.systemd_service: daemon_reload: true From 3e66dababf7e2b901d1449aac0749429264a1f33 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 15:06:30 +0100 Subject: [PATCH 012/374] 111 --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 32aea02..1205afb 100644 --- a/hosts.yml +++ b/hosts.yml @@ -35,7 +35,7 @@ datacenter: hosts: 192.168.77.189: vars: - ansible_user: jd + ansible_ssh_user: jd ansible_ssh_pass: lacijaydee ansible_become_password: lacijaydee rhasspy: From 60107d3a3cf9e631d815c81844013daa9ac072f8 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 15:07:49 +0100 Subject: [PATCH 013/374] 111 --- hosts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts.yml b/hosts.yml index 1205afb..69a9000 100644 --- a/hosts.yml +++ b/hosts.yml @@ -38,6 +38,7 @@ datacenter: ansible_ssh_user: jd ansible_ssh_pass: lacijaydee ansible_become_password: lacijaydee + ansible_user_password: jd rhasspy: hosts: 192.168.77.16[6:7] From eb696af9132636a6a75caa9f6ed3a3afb2b97c40 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 15:11:00 +0100 Subject: [PATCH 014/374] 111 --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 69a9000..ba9684f 100644 --- a/hosts.yml +++ b/hosts.yml @@ -38,7 +38,7 @@ datacenter: ansible_ssh_user: jd ansible_ssh_pass: lacijaydee ansible_become_password: lacijaydee - ansible_user_password: jd + ansible_become_user: root rhasspy: hosts: 192.168.77.16[6:7] From 69007867e56a9eb00370769099671b8ac7375a70 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 15:11:50 +0100 Subject: [PATCH 015/374] 111 --- hosts.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/hosts.yml b/hosts.yml index ba9684f..7bf82fd 100644 --- a/hosts.yml +++ b/hosts.yml @@ -37,8 +37,6 @@ datacenter: vars: ansible_ssh_user: jd ansible_ssh_pass: lacijaydee - ansible_become_password: lacijaydee - ansible_become_user: root rhasspy: hosts: 192.168.77.16[6:7] From 82d38cfa13ae87e0cde6fc27c1d9596764b2d2cd Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 15:13:10 +0100 Subject: [PATCH 016/374] 111 --- hosts.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts.yml b/hosts.yml index 7bf82fd..133a544 100644 --- a/hosts.yml +++ b/hosts.yml @@ -35,8 +35,12 @@ datacenter: hosts: 192.168.77.189: vars: + ansible_user: jd + ansible_password: lacijaydee ansible_ssh_user: jd ansible_ssh_pass: lacijaydee + ansible_become_user: root + ansible_become_password: lacijaydee rhasspy: hosts: 192.168.77.16[6:7] From 078966b4f7d26d9e23b2e3f3043ea8b25a4c9716 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 15:19:23 +0100 Subject: [PATCH 017/374] 111 --- hosts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts.yml b/hosts.yml index 133a544..f677427 100644 --- a/hosts.yml +++ b/hosts.yml @@ -35,9 +35,9 @@ datacenter: hosts: 192.168.77.189: vars: - ansible_user: jd + ansible_user: root ansible_password: lacijaydee - ansible_ssh_user: jd + ansible_ssh_user: root ansible_ssh_pass: lacijaydee ansible_become_user: root ansible_become_password: lacijaydee From 1a06701eea4991b4f3865f3ba3ff4835836a9aa4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 12 Dec 2023 15:25:23 +0100 Subject: [PATCH 018/374] 111 --- playbooks/00_install_zabbix_agent.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index 4a2fbdf..a81d14e 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -13,7 +13,7 @@ ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/ubuntu-arm64/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb when: - - ansible_facts.architecture != "armv7l" + - ansible_facts.architecture != "armv7l" and ansible_distribution == "Ubuntu" - name: Install a .deb package from the internet ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/raspbian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb @@ -21,8 +21,13 @@ delay: 5 when: - ansible_facts.architecture == "armv7l" - ignore_errors: true + + - name: Install a .deb package from the internet + ansible.builtin.apt: + deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb + when: + - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" # - name: Install a .deb package localy # ansible.builtin.apt: # deb: /tmp/zabbix-release_6.4-1+ubuntu22.04_all.deb From 4e64acedd0ecb35b80475983f1b835caf307c563 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Dec 2023 06:36:21 +0100 Subject: [PATCH 019/374] 111 --- playbooks/apt_upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/apt_upgrade.yml b/playbooks/apt_upgrade.yml index 78c10bd..61a0a80 100644 --- a/playbooks/apt_upgrade.yml +++ b/playbooks/apt_upgrade.yml @@ -1,4 +1,4 @@ -- hosts: morefine +- hosts: datacenter name: Apt udate become: true tasks: From bcf6982ad98451c15749f22dc40b8e48880b62a4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 22 Jan 2024 00:06:25 +0100 Subject: [PATCH 020/374] added proxmox --- hosts.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hosts.yml b/hosts.yml index f677427..98f52ab 100644 --- a/hosts.yml +++ b/hosts.yml @@ -41,6 +41,16 @@ datacenter: ansible_ssh_pass: lacijaydee ansible_become_user: root ansible_become_password: lacijaydee + proxmox: + hosts: + 192.168.77.4: + vars: + ansible_user: root + ansible_password: lacijaydee + ansible_ssh_user: root + ansible_ssh_pass: lacijaydee + ansible_become_user: root + ansible_become_password: lacijaydee rhasspy: hosts: 192.168.77.16[6:7] From f2265c05b2ccd25b8df0e3574749d5fbab8295da Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 22 Jan 2024 00:07:54 +0100 Subject: [PATCH 021/374] added proxmox --- hosts.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts.yml b/hosts.yml index 98f52ab..5afa2de 100644 --- a/hosts.yml +++ b/hosts.yml @@ -46,11 +46,11 @@ datacenter: 192.168.77.4: vars: ansible_user: root - ansible_password: lacijaydee + ansible_password: l4c1j4yd33Du5lo ansible_ssh_user: root - ansible_ssh_pass: lacijaydee + ansible_ssh_pass: l4c1j4yd33Du5lo ansible_become_user: root - ansible_become_password: lacijaydee + ansible_become_password: l4c1j4yd33Du5lo rhasspy: hosts: 192.168.77.16[6:7] From 629f54f677db0cfc65fa9c18f896c27af57fe303 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 22 Jan 2024 00:12:35 +0100 Subject: [PATCH 022/374] added proxmox --- playbooks/00_install_zabbix_agent.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index a81d14e..3d1368b 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -14,6 +14,8 @@ deb: https://repo.zabbix.com/zabbix/6.4/ubuntu-arm64/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb when: - ansible_facts.architecture != "armv7l" and ansible_distribution == "Ubuntu" + + - name: Install a .deb package from the internet ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/raspbian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb @@ -27,7 +29,15 @@ ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb when: - - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" + - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "11" + - name: Install a .deb package from the internet + ansible.builtin.apt: + deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb + when: + - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "12" + + + # - name: Install a .deb package localy # ansible.builtin.apt: # deb: /tmp/zabbix-release_6.4-1+ubuntu22.04_all.deb From 9973cf1d47248bd685ee5993c7db313b58029135 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 29 Feb 2024 09:17:28 +0100 Subject: [PATCH 023/374] flatpak --- playbooks/apt_upgrade.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/playbooks/apt_upgrade.yml b/playbooks/apt_upgrade.yml index 61a0a80..28b9196 100644 --- a/playbooks/apt_upgrade.yml +++ b/playbooks/apt_upgrade.yml @@ -5,4 +5,7 @@ - name: Upgrade the OS ansible.builtin.apt: upgrade: full + become: true + - name: Upgrade flatpack + ansible.builtin.command: flatpak update become: true \ No newline at end of file From 6cbf4243d17379eeefd2d21bc01db8f69aaa4c8a Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 29 Feb 2024 09:21:31 +0100 Subject: [PATCH 024/374] flatpak --- playbooks/apt_upgrade.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/apt_upgrade.yml b/playbooks/apt_upgrade.yml index 28b9196..578bcdf 100644 --- a/playbooks/apt_upgrade.yml +++ b/playbooks/apt_upgrade.yml @@ -7,5 +7,5 @@ upgrade: full become: true - name: Upgrade flatpack - ansible.builtin.command: flatpak update + ansible.builtin.command: flatpak update -y become: true \ No newline at end of file From aa9bba1f54b7885bd2374244527ec92c2dab6646 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 6 Mar 2024 09:29:44 +0100 Subject: [PATCH 025/374] flatpak --- playbooks/apt_upgrade.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/apt_upgrade.yml b/playbooks/apt_upgrade.yml index 578bcdf..44fab94 100644 --- a/playbooks/apt_upgrade.yml +++ b/playbooks/apt_upgrade.yml @@ -8,4 +8,5 @@ become: true - name: Upgrade flatpack ansible.builtin.command: flatpak update -y - become: true \ No newline at end of file + become: true + when: inventory_hostname in groups['morefine'] \ No newline at end of file From 22c88214bdb66871343ee31587a8005d6332f851 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 6 Mar 2024 10:35:43 +0100 Subject: [PATCH 026/374] flatpak --- playbooks/sync_all.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 0923d8d..e1e62ae 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -12,6 +12,11 @@ # - include_tasks: sync_container_data.yaml # name: Sync Container Data + - name: Syncing all + ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall,ha,gitlab} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + #ansible.builtin.shell: 'ls -la' + when: inventory_hostname in groups['nas'] - include_tasks: reconfigure_nginx.yaml name: Reconfigure nginx proxy manager loop: From b0495f399a3a72ed0992f36d7e48332d5f002dde Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 6 Mar 2024 10:38:11 +0100 Subject: [PATCH 027/374] flatpak --- playbooks/sync_all.yaml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index e1e62ae..21c13b7 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -3,20 +3,16 @@ hosts: containers gather_facts: false tasks: - # - include_tasks: stop_containers.yaml - # name: Stop Containers - # when: inventory_hostname in groups['raspberrypi5'] - # - name: Pause for 60 seconds - # ansible.builtin.pause: - # seconds: 60 + - include_tasks: stop_containers.yaml + name: Stop Containers + when: inventory_hostname in groups['raspberrypi5'] + - name: Pause for 60 seconds + ansible.builtin.pause: + seconds: 60 - # - include_tasks: sync_container_data.yaml - # name: Sync Container Data - - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall,ha,gitlab} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - #ansible.builtin.shell: 'ls -la' - when: inventory_hostname in groups['nas'] + - include_tasks: sync_container_data.yaml + name: Sync Container Data + - include_tasks: reconfigure_nginx.yaml name: Reconfigure nginx proxy manager loop: From 91ae08e6117e874468fd361142a896bbedbcf5b9 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 13 Mar 2024 09:51:16 +0100 Subject: [PATCH 028/374] flatpak --- playbooks/sync_container_data.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 870747e..1e4f316 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -1,9 +1,9 @@ - name: Changing permission - ansible.builtin.shell: 'chown -R admin. /share/docker_data/' + ansible.builtin.shell: 'chown -R root. /share/docker_data/' become: true when: inventory_hostname in groups['raspberry'] or inventory_hostname in groups['raspberrypi5'] - name: Syncing all - #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} admin@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} admin@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] \ No newline at end of file From 77d82aa5555ef8d070a61bfc6b22392f6c715beb Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 13 Mar 2024 15:06:47 +0100 Subject: [PATCH 029/374] flatpak --- playbooks/sync_all.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 21c13b7..48f550b 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -55,9 +55,9 @@ ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" become: true when: inventory_hostname in groups['raspberrypi5'] - - include_tasks: start_containers.yaml - name: Start Containers - when: inventory_hostname in groups['raspberrypi5'] + # - include_tasks: start_containers.yaml + # name: Start Containers + # when: inventory_hostname in groups['raspberrypi5'] - name: Get relevant configs ansible.builtin.shell: 'docker exec -it gitlab update-permissions' ignore_errors: yes From 460492110d2579978c9678dadf856b4edf505832 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 15 Apr 2024 07:51:59 +0200 Subject: [PATCH 030/374] remove raspberry host --- hosts.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hosts.yml b/hosts.yml index 5afa2de..e8026e1 100644 --- a/hosts.yml +++ b/hosts.yml @@ -78,15 +78,15 @@ datacenter: ansible_python_interpreter: /opt/bin/python ansible_user: admin ansible_pass: l4c1!j4yd33?Du5lo - raspberry: - hosts: - 192.168.77.246 - vars: - ansible_python_interpreter: /usr/bin/python - ansible_ssh_user: jd - ansible_ssh_pass: q - ansible_become_user: root - ansible_become_password: l4c1j4yd33Du5lo + # raspberry: + # hosts: + # 192.168.77.246 + # vars: + # ansible_python_interpreter: /usr/bin/python + # ansible_ssh_user: jd + # ansible_ssh_pass: q + # ansible_become_user: root + # ansible_become_password: l4c1j4yd33Du5lo raspberrypi5: hosts: 192.168.77.238 From 8f3a51026ac713e302c4dcf7807a14f6dbf2c423 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 15 Apr 2024 07:54:08 +0200 Subject: [PATCH 031/374] remove raspberry host --- playbooks/sync_container_data.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 1e4f316..757923a 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -1,7 +1,7 @@ - name: Changing permission ansible.builtin.shell: 'chown -R root. /share/docker_data/' become: true - when: inventory_hostname in groups['raspberry'] or inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname in groups['raspberrypi5'] - name: Syncing all ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' From 4b36935dc05c1e951047718f0bcad2e477943137 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 24 Apr 2024 08:26:08 +0200 Subject: [PATCH 032/374] no gitlab perms aplied --- playbooks/sync_all.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 48f550b..0c0ceb8 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -58,12 +58,12 @@ # - include_tasks: start_containers.yaml # name: Start Containers # when: inventory_hostname in groups['raspberrypi5'] - - name: Get relevant configs - ansible.builtin.shell: 'docker exec -it gitlab update-permissions' - ignore_errors: yes - become: yes - register: result - when: inventory_hostname in groups['raspberrypi5'] + # - name: Get relevant configs + # ansible.builtin.shell: 'docker exec -it gitlab update-permissions' + # ignore_errors: yes + # become: yes + # register: result + # when: inventory_hostname in groups['raspberrypi5'] - name: Get relevant configs ansible.builtin.shell: 'docker restart gitlab' ignore_errors: yes From ae2b88a0a9da9054b91fee02f5d5c144befa78e5 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 24 Apr 2024 08:33:27 +0200 Subject: [PATCH 033/374] no gitlab perms aplied --- playbooks/sync_all.yaml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 0c0ceb8..0546537 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -55,18 +55,21 @@ ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" become: true when: inventory_hostname in groups['raspberrypi5'] - # - include_tasks: start_containers.yaml - # name: Start Containers - # when: inventory_hostname in groups['raspberrypi5'] - # - name: Get relevant configs - # ansible.builtin.shell: 'docker exec -it gitlab update-permissions' - # ignore_errors: yes - # become: yes - # register: result - # when: inventory_hostname in groups['raspberrypi5'] - - name: Get relevant configs - ansible.builtin.shell: 'docker restart gitlab' + - include_tasks: start_containers.yaml + name: Start Containers + when: inventory_hostname in groups['raspberrypi5'] + - name: Pause for 60 seconds + ansible.builtin.pause: + seconds: 10 + - name: Update gitlab perms + ansible.builtin.shell: 'docker exec -it gitlab update-permissions' ignore_errors: yes become: yes register: result - when: inventory_hostname in groups['raspberrypi5'] \ No newline at end of file + when: inventory_hostname in groups['raspberrypi5'] + # - name: Get relevant configs + # ansible.builtin.shell: 'docker restart gitlab' + # ignore_errors: yes + # become: yes + # register: result + # when: inventory_hostname in groups['raspberrypi5'] \ No newline at end of file From 2dcd89247ca04e1b9a7c049cf6dc5174bc475deb Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 24 Apr 2024 08:47:09 +0200 Subject: [PATCH 034/374] no gitlab perms aplied --- playbooks/sync_all.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 0546537..da36768 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -62,7 +62,7 @@ ansible.builtin.pause: seconds: 10 - name: Update gitlab perms - ansible.builtin.shell: 'docker exec -it gitlab update-permissions' + ansible.builtin.shell: 'docker exec -t gitlab update-permissions' ignore_errors: yes become: yes register: result From d11ced8c5019df9aa8a3fe3675ff21ab93c62942 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 7 May 2024 21:43:10 +0200 Subject: [PATCH 035/374] bitwarden --- playbooks/sync_all.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index da36768..f74a0f6 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -55,12 +55,12 @@ ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" become: true when: inventory_hostname in groups['raspberrypi5'] - - include_tasks: start_containers.yaml - name: Start Containers - when: inventory_hostname in groups['raspberrypi5'] - - name: Pause for 60 seconds - ansible.builtin.pause: - seconds: 10 + # - include_tasks: start_containers.yaml + # name: Start Containers + # when: inventory_hostname in groups['raspberrypi5'] + # - name: Pause for 60 seconds + # ansible.builtin.pause: + # seconds: 10 - name: Update gitlab perms ansible.builtin.shell: 'docker exec -t gitlab update-permissions' ignore_errors: yes From e479a6f8706cf821ee9b2cbc75177b9196d05849 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 21 May 2024 11:59:10 +0200 Subject: [PATCH 036/374] bitwarden --- hosts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts.yml b/hosts.yml index e8026e1..6ab3d17 100644 --- a/hosts.yml +++ b/hosts.yml @@ -28,8 +28,8 @@ datacenter: 192.168.77.12: vars: ansible_python_interpreter: auto_silent - ansible_ssh_user: admin - ansible_ssh_pass: l4c1j4yd33Du5lo + ansible_ssh_user: jd + ansible_ssh_pass: q omv: hosts: From 09f9c0b357b7b9f5b364cdbf74eedff0541dfbdc Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 21 May 2024 11:59:53 +0200 Subject: [PATCH 037/374] bitwarden --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 6ab3d17..9ebe10b 100644 --- a/hosts.yml +++ b/hosts.yml @@ -30,7 +30,7 @@ datacenter: ansible_python_interpreter: auto_silent ansible_ssh_user: jd ansible_ssh_pass: q - + ansible_password: q omv: hosts: 192.168.77.189: From c35ea3c1f691c9fb6ac1d2bb926de3c0bcd09c2a Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 21 May 2024 12:00:20 +0200 Subject: [PATCH 038/374] bitwarden --- hosts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts.yml b/hosts.yml index 9ebe10b..5e83b0d 100644 --- a/hosts.yml +++ b/hosts.yml @@ -31,6 +31,8 @@ datacenter: ansible_ssh_user: jd ansible_ssh_pass: q ansible_password: q + ansible_become_user: root + ansible_become_password: q omv: hosts: 192.168.77.189: From 797ba4dc4d609489781b56c44d7bfb867cdb09fc Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:09:11 +0200 Subject: [PATCH 039/374] bitwarden --- playbooks/restore_docker.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 playbooks/restore_docker.yml diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml new file mode 100644 index 0000000..0c9ee80 --- /dev/null +++ b/playbooks/restore_docker.yml @@ -0,0 +1,7 @@ +- hosts: nas + name: Restore docker + ignore_unreachable: false + tasks: + - name: Restore folder + ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/rancher .' + when: inventory_hostname in groups['nas'] \ No newline at end of file From 8919d321b1ed6ea02d5e4c1d9c0dcee976063c5c Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:16:15 +0200 Subject: [PATCH 040/374] bitwarden --- hosts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts.yml b/hosts.yml index 5e83b0d..526439e 100644 --- a/hosts.yml +++ b/hosts.yml @@ -102,6 +102,8 @@ datacenter: hosts: 192.168.77.106: vars: + ansible_ssh_user: admin + ansible_ssh_pass: l4c1!j4yd33?Du5lo ansible_user: admin ansible_pass: l4c1!j4yd33?Du5lo ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython39/bin/python3 \ No newline at end of file From 58a4777ca84775522d5baf9788c19786bbe87f67 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:24:20 +0200 Subject: [PATCH 041/374] bitwarden --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 526439e..ea3f877 100644 --- a/hosts.yml +++ b/hosts.yml @@ -106,4 +106,4 @@ datacenter: ansible_ssh_pass: l4c1!j4yd33?Du5lo ansible_user: admin ansible_pass: l4c1!j4yd33?Du5lo - ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython39/bin/python3 \ No newline at end of file + ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 \ No newline at end of file From cb95a7a1b5600dbed38a96df3ee7cab2cae55dc6 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:27:15 +0200 Subject: [PATCH 042/374] bitwarden --- playbooks/restore_docker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index 0c9ee80..4c31ecb 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -2,6 +2,10 @@ name: Restore docker ignore_unreachable: false tasks: + - name: Stop running containers + docker_container: + name: rancher-rancher-1 + state: stopped - name: Restore folder ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/rancher .' when: inventory_hostname in groups['nas'] \ No newline at end of file From 5c32d28aa5b157a8363ecc4424cb732fa679ab5e Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:27:58 +0200 Subject: [PATCH 043/374] bitwarden --- playbooks/restore_docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index 4c31ecb..86c1e3f 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -3,9 +3,9 @@ ignore_unreachable: false tasks: - name: Stop running containers - docker_container: - name: rancher-rancher-1 - state: stopped + docker_container: + name: rancher-rancher-1 + state: stopped - name: Restore folder ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/rancher .' when: inventory_hostname in groups['nas'] \ No newline at end of file From 8694e523f47188979ed26146c28dcabad67becef Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:37:18 +0200 Subject: [PATCH 044/374] bitwarden --- playbooks/restore_docker.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index 86c1e3f..d464e65 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -3,9 +3,7 @@ ignore_unreachable: false tasks: - name: Stop running containers - docker_container: - name: rancher-rancher-1 - state: stopped + ansible.builtin.shell: docker stop rancher-rancher-1 - name: Restore folder ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/rancher .' when: inventory_hostname in groups['nas'] \ No newline at end of file From c4878e2c4860995c929ad4c89fce4d0a14933013 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:38:14 +0200 Subject: [PATCH 045/374] bitwarden --- playbooks/restore_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index d464e65..025a019 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -3,7 +3,7 @@ ignore_unreachable: false tasks: - name: Stop running containers - ansible.builtin.shell: docker stop rancher-rancher-1 + ansible.builtin.shell: /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop rancher-rancher-1 - name: Restore folder ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/rancher .' when: inventory_hostname in groups['nas'] \ No newline at end of file From f62b3838265aab125751d7a07f114cc0e069e3f4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:40:11 +0200 Subject: [PATCH 046/374] bitwarden --- playbooks/restore_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index 025a019..93e0add 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -5,5 +5,5 @@ - name: Stop running containers ansible.builtin.shell: /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop rancher-rancher-1 - name: Restore folder - ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/rancher .' + ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/rancher /share/docker_data/' when: inventory_hostname in groups['nas'] \ No newline at end of file From 2841698073d5dbbaf85cacc38723e1f95a7bbb45 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:45:56 +0200 Subject: [PATCH 047/374] bitwarden --- playbooks/restore_docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index 93e0add..defcc74 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -3,7 +3,7 @@ ignore_unreachable: false tasks: - name: Stop running containers - ansible.builtin.shell: /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop rancher-rancher-1 + ansible.builtin.shell: /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop {{ container_name }} - name: Restore folder - ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/rancher /share/docker_data/' + ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ app }} /share/docker_data/' when: inventory_hostname in groups['nas'] \ No newline at end of file From 44545ba8a4f5a77ebe412826ffe879c6fd53d9c7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:48:49 +0200 Subject: [PATCH 048/374] bitwarden --- playbooks/restore_docker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index defcc74..693f421 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -6,4 +6,6 @@ ansible.builtin.shell: /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop {{ container_name }} - name: Restore folder ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ app }} /share/docker_data/' - when: inventory_hostname in groups['nas'] \ No newline at end of file + when: inventory_hostname in groups['nas'] + - name: Start running containers + ansible.builtin.shell: /share/ZFS530_DATA/.qpkg/container-station/bin/docker start {{ container_name }} \ No newline at end of file From fe66d4c13bbfc903210bd4a410392479834ed156 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 10:58:52 +0200 Subject: [PATCH 049/374] bitwarden --- playbooks/restore_docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index 693f421..bdb5130 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -3,9 +3,9 @@ ignore_unreachable: false tasks: - name: Stop running containers - ansible.builtin.shell: /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop {{ container_name }} + ansible.builtin.shell: for i in `docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' ; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop $i;done - name: Restore folder ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ app }} /share/docker_data/' when: inventory_hostname in groups['nas'] - name: Start running containers - ansible.builtin.shell: /share/ZFS530_DATA/.qpkg/container-station/bin/docker start {{ container_name }} \ No newline at end of file + ansible.builtin.shell: for i in `docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' ; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker start $i;done \ No newline at end of file From 00ada0f6aeb9442b86c1d2a3f1e2a678886befa0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 11:00:19 +0200 Subject: [PATCH 050/374] bitwarden --- playbooks/restore_docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index bdb5130..f54ca2e 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -3,9 +3,9 @@ ignore_unreachable: false tasks: - name: Stop running containers - ansible.builtin.shell: for i in `docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' ; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop $i;done + ansible.builtin.shell: for i in `docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop $i;done - name: Restore folder ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ app }} /share/docker_data/' when: inventory_hostname in groups['nas'] - name: Start running containers - ansible.builtin.shell: for i in `docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' ; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker start $i;done \ No newline at end of file + ansible.builtin.shell: for i in `docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker start $i;done \ No newline at end of file From 5fccd711c49e04e21fac04b049ed30ba2f7cdcf8 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 11:04:16 +0200 Subject: [PATCH 051/374] bitwarden --- playbooks/restore_docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index f54ca2e..f2934aa 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -3,9 +3,9 @@ ignore_unreachable: false tasks: - name: Stop running containers - ansible.builtin.shell: for i in `docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop $i;done + ansible.builtin.shell: for i in `/share/ZFS530_DATA/.qpkg/container-station/bin/docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop $i;done - name: Restore folder ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ app }} /share/docker_data/' when: inventory_hostname in groups['nas'] - name: Start running containers - ansible.builtin.shell: for i in `docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker start $i;done \ No newline at end of file + ansible.builtin.shell: for i in `/share/ZFS530_DATA/.qpkg/container-station/bin/docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker start $i;done \ No newline at end of file From 02fd8b0313c34070fe20086898c1a8bf134eba2c Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 11:09:52 +0200 Subject: [PATCH 052/374] bitwarden --- playbooks/restore_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index f2934aa..f25c8c3 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -5,7 +5,7 @@ - name: Stop running containers ansible.builtin.shell: for i in `/share/ZFS530_DATA/.qpkg/container-station/bin/docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop $i;done - name: Restore folder - ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ app }} /share/docker_data/' + ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/{{ date }}/{{ app }} /share/docker_data/' when: inventory_hostname in groups['nas'] - name: Start running containers ansible.builtin.shell: for i in `/share/ZFS530_DATA/.qpkg/container-station/bin/docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker start $i;done \ No newline at end of file From f9e4ebd7931d644b199a9fd9659600239bef5ab6 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 11:10:53 +0200 Subject: [PATCH 053/374] bitwarden --- playbooks/restore_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index f25c8c3..a59a50d 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -5,7 +5,7 @@ - name: Stop running containers ansible.builtin.shell: for i in `/share/ZFS530_DATA/.qpkg/container-station/bin/docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker stop $i;done - name: Restore folder - ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/{{ date }}/{{ app }} /share/docker_data/' + ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/{{ resdate }}/{{ app }} /share/docker_data/' when: inventory_hostname in groups['nas'] - name: Start running containers ansible.builtin.shell: for i in `/share/ZFS530_DATA/.qpkg/container-station/bin/docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker start $i;done \ No newline at end of file From 5f34fc412656432d390dd53115c5b2e3b2f41096 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 25 May 2024 11:16:02 +0200 Subject: [PATCH 054/374] bitwarden --- playbooks/restore_docker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/playbooks/restore_docker.yml b/playbooks/restore_docker.yml index a59a50d..b1bc43b 100644 --- a/playbooks/restore_docker.yml +++ b/playbooks/restore_docker.yml @@ -7,5 +7,8 @@ - name: Restore folder ansible.builtin.shell: 'rsync -arv root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/{{ resdate }}/{{ app }} /share/docker_data/' when: inventory_hostname in groups['nas'] + - name: Change permissions + ansible.builtin.shell: chmod -R 700 /share/docker_data/rancher/rancher-data/k3s/server/ + when: app == "rancher" - name: Start running containers ansible.builtin.shell: for i in `/share/ZFS530_DATA/.qpkg/container-station/bin/docker ps -a|egrep -e '{{ app }}.*'|awk '{print $NF}' `; do /share/ZFS530_DATA/.qpkg/container-station/bin/docker start $i;done \ No newline at end of file From fa086aa7c2c012dff3ebeddaacfdfc5de4883f14 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 26 May 2024 17:16:28 +0200 Subject: [PATCH 055/374] bitwarden --- playbooks/backup_docker.yml | 0 playbooks/build_tasmota.yml | 8 ++++++++ 2 files changed, 8 insertions(+) create mode 100644 playbooks/backup_docker.yml create mode 100644 playbooks/build_tasmota.yml diff --git a/playbooks/backup_docker.yml b/playbooks/backup_docker.yml new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/build_tasmota.yml b/playbooks/build_tasmota.yml new file mode 100644 index 0000000..9488d61 --- /dev/null +++ b/playbooks/build_tasmota.yml @@ -0,0 +1,8 @@ +- hosts: nas + name: Build tasmota + ignore_unreachable: false + tasks: + - name: Build tasmota + ansible.builtin.shell: './compile.sh' + chdir: /share/docker_data/docker-tasmota/ + when: inventory_hostname in groups['nas'] \ No newline at end of file From 50786d199686cf2283f9149acbb78601eb331c96 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 26 May 2024 17:18:04 +0200 Subject: [PATCH 056/374] bitwarden --- playbooks/build_tasmota.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/playbooks/build_tasmota.yml b/playbooks/build_tasmota.yml index 9488d61..77272ce 100644 --- a/playbooks/build_tasmota.yml +++ b/playbooks/build_tasmota.yml @@ -3,6 +3,7 @@ ignore_unreachable: false tasks: - name: Build tasmota - ansible.builtin.shell: './compile.sh' - chdir: /share/docker_data/docker-tasmota/ + ansible.builtin.shell: + cmd: './compile.sh' + chdir: /share/docker_data/docker-tasmota/ when: inventory_hostname in groups['nas'] \ No newline at end of file From 78714317f02bc20c775a68ef97fba59295aebbab Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 13:50:47 +0200 Subject: [PATCH 057/374] bitwarden --- playbooks/build_tasmota_v2.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 playbooks/build_tasmota_v2.yml diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml new file mode 100644 index 0000000..36617f3 --- /dev/null +++ b/playbooks/build_tasmota_v2.yml @@ -0,0 +1,9 @@ +- hosts: nas + name: Build tasmota + ignore_unreachable: false + tasks: + - name: Build tasmota + ansible.builtin.shell: + cmd: 'git fetch https://github.com/arendst/Tasmota.git development' + chdir: /share/docker_data/docker-tasmota/Tasmota + when: inventory_hostname in groups['nas'] \ No newline at end of file From 88d216b10e916d4b8d62bed2184cbd86a15ed851 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 14:01:21 +0200 Subject: [PATCH 058/374] bitwarden --- playbooks/build_tasmota_v2.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index 36617f3..ab86799 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -1,9 +1,21 @@ - hosts: nas name: Build tasmota ignore_unreachable: false + vars: + DOCKER_IMAGE: docker-tasmota + FWS: tasmota tasks: - name: Build tasmota ansible.builtin.shell: cmd: 'git fetch https://github.com/arendst/Tasmota.git development' chdir: /share/docker_data/docker-tasmota/Tasmota - when: inventory_hostname in groups['nas'] \ No newline at end of file + when: inventory_hostname in groups['nas'] + + + - name: Build tasmota + ansible.builtin.shell: + cmd: 'docker run -it --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} {{ FWS }}' + chdir: /share/docker_data/docker-tasmota/ + when: inventory_hostname in groups['nas'] + + \ No newline at end of file From 003f0be8992706b254278bc1ce074cc94c73d2fb Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 14:02:26 +0200 Subject: [PATCH 059/374] bitwarden --- playbooks/build_tasmota_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index ab86799..313666d 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -14,7 +14,7 @@ - name: Build tasmota ansible.builtin.shell: - cmd: 'docker run -it --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} {{ FWS }}' + cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run -it --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} {{ FWS }}' chdir: /share/docker_data/docker-tasmota/ when: inventory_hostname in groups['nas'] From 1d45765dc0fca10c16162bd437d687d0798608cd Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 14:07:19 +0200 Subject: [PATCH 060/374] bitwarden --- playbooks/build_tasmota_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index 313666d..7c0f33f 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -14,7 +14,7 @@ - name: Build tasmota ansible.builtin.shell: - cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run -it --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} {{ FWS }}' + cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run -it --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} -e {{ FWS }}' chdir: /share/docker_data/docker-tasmota/ when: inventory_hostname in groups['nas'] From 468124b575cbd6ca03d4bc56adb132009fb66809 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 14:12:51 +0200 Subject: [PATCH 061/374] bitwarden --- playbooks/build_tasmota_v2.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index 7c0f33f..0f6d19b 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -11,7 +11,16 @@ chdir: /share/docker_data/docker-tasmota/Tasmota when: inventory_hostname in groups['nas'] - + - name: Copy platformio_override + ansible.builtin.shell: + cmd: 'cp platformio_override.ini Tasmota/platformio_override.ini' + chdir: /share/docker_data/docker-tasmota/ + when: inventory_hostname in groups['nas'] + - name: Copy user_config_override + ansible.builtin.shell: + cmd: 'cp user_config_override.h Tasmota/tasmota/user_config_override.h' + chdir: /share/docker_data/docker-tasmota/ + when: inventory_hostname in groups['nas'] - name: Build tasmota ansible.builtin.shell: cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run -it --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} -e {{ FWS }}' From e6df3024bbc3f2cda7a5d26c31bc071412138c34 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 14:19:06 +0200 Subject: [PATCH 062/374] bitwarden --- playbooks/build_tasmota_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index 0f6d19b..a9e0666 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -23,7 +23,7 @@ when: inventory_hostname in groups['nas'] - name: Build tasmota ansible.builtin.shell: - cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run -it --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} -e {{ FWS }}' + cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} -e {{ FWS }}' chdir: /share/docker_data/docker-tasmota/ when: inventory_hostname in groups['nas'] From 5f04948e43b684be56adb182ba948b87ae285312 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 14:28:09 +0200 Subject: [PATCH 063/374] bitwarden --- playbooks/build_tasmota_v2.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index a9e0666..da8a257 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -1,9 +1,9 @@ - hosts: nas name: Build tasmota ignore_unreachable: false - vars: - DOCKER_IMAGE: docker-tasmota - FWS: tasmota + # vars: + # DOCKER_IMAGE: docker-tasmota + # FWS: tasmota tasks: - name: Build tasmota ansible.builtin.shell: From 52d34d1afd9499f7d71d6a3a613e1c289382da56 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 14:39:37 +0200 Subject: [PATCH 064/374] bitwarden --- playbooks/build_tasmota_v2.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index da8a257..d7e5abf 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -7,7 +7,7 @@ tasks: - name: Build tasmota ansible.builtin.shell: - cmd: 'git fetch https://github.com/arendst/Tasmota.git development' + cmd: 'git fetch https://github.com/arendst/Tasmota.git {{ BRANCH }}' chdir: /share/docker_data/docker-tasmota/Tasmota when: inventory_hostname in groups['nas'] @@ -25,6 +25,10 @@ ansible.builtin.shell: cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }} -e {{ FWS }}' chdir: /share/docker_data/docker-tasmota/ - when: inventory_hostname in groups['nas'] - + when: FWS != "all" + - name: Build tasmota + ansible.builtin.shell: + cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }}' + chdir: /share/docker_data/docker-tasmota/ + when: FWS == "all" \ No newline at end of file From cd36b32c6fadae8a8be7c3341a4785c54e71b97b Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 14:44:10 +0200 Subject: [PATCH 065/374] bitwarden --- playbooks/build_tasmota_v2.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index d7e5abf..e377c50 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -31,4 +31,12 @@ cmd: '/share/ZFS530_DATA/.qpkg/container-station/bin/docker run --rm -v /share/docker_data/docker-tasmota/Tasmota:/tasmota -u $UID:$GID {{ DOCKER_IMAGE }}' chdir: /share/docker_data/docker-tasmota/ when: FWS == "all" - \ No newline at end of file + - name: Create a directory if it does not exist + ansible.builtin.file: + path: /share/docker_data/webhub/fw/{{ BRANCH }} + state: directory + mode: '0755' + - name: Build tasmota + ansible.builtin.shell: + cmd: 'mv Tasmota/build_output/firmware/* /share/docker_data/webhub/fw/{{ BRANCH }}' + when: inventory_hostname in groups['nas'] \ No newline at end of file From 4a5e3c02036ba21135aebdaff809fd7edefb8f65 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 14:49:20 +0200 Subject: [PATCH 066/374] bitwarden --- playbooks/build_tasmota_v2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index e377c50..0d38565 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -38,5 +38,5 @@ mode: '0755' - name: Build tasmota ansible.builtin.shell: - cmd: 'mv Tasmota/build_output/firmware/* /share/docker_data/webhub/fw/{{ BRANCH }}' + cmd: 'mv /share/docker_data/docker-tasmota/Tasmota/build_output/firmware/* /share/docker_data/webhub/fw/{{ BRANCH }}' when: inventory_hostname in groups['nas'] \ No newline at end of file From f51df9d3a924f0c441e50cfbf5080d3272c6754a Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 23:44:28 +0200 Subject: [PATCH 067/374] bitwarden --- playbooks/test_replace.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 playbooks/test_replace.yml diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml new file mode 100644 index 0000000..e9d3d04 --- /dev/null +++ b/playbooks/test_replace.yml @@ -0,0 +1,6 @@ +- hosts: nas + name: Sync mailu + ignore_unreachable: false + tasks: + - name: Change owner + commalocal: "{{ 'localhost:80' | regex_replace('^(?P.+):(?P\\d+)$', '\\g, \\g') }}" \ No newline at end of file From 97c28be1ca29952544bfed771bbb49aebb451161 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 23:49:46 +0200 Subject: [PATCH 068/374] bitwarden --- playbooks/test_replace.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index e9d3d04..ff13589 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -1,6 +1,9 @@ - hosts: nas name: Sync mailu ignore_unreachable: false + vars: + app_path: "{{ 'localhost:80' | regex_replace('^(?P.+):(?P\\d+)$', '\\g, \\g') }}" tasks: - - name: Change owner - commalocal: "{{ 'localhost:80' | regex_replace('^(?P.+):(?P\\d+)$', '\\g, \\g') }}" \ No newline at end of file + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: var is "{{ app_path }}" \ No newline at end of file From fbe520ecc16a8c4a920c0ef9b75cfbac8701627a Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 23:52:59 +0200 Subject: [PATCH 069/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index ff13589..a7257b8 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ 'localhost:80' | regex_replace('^(?P.+):(?P\\d+)$', '\\g, \\g') }}" + app_path: "{{ 'localhost:80' | regex_replace('^(?P.+):(?P\\d+)$', '\\g111, \\g') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From dcfe2cc1e0d13eaa9beb6c53d1e252da45068627 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 23:54:26 +0200 Subject: [PATCH 070/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index a7257b8..6b57570 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ 'localhost:80' | regex_replace('^(?P.+):(?P\\d+)$', '\\g111, \\g') }}" + app_path: "{{ 'localhost:80' | regex_replace('^(?P.+):(?P\\d+)$', '111, \\g') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From d439401cd61ba3af03edacabf9aa2615245cbeda Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 23:56:41 +0200 Subject: [PATCH 071/374] bitwarden --- playbooks/test_replace.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 6b57570..162fea7 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,8 +2,8 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ 'localhost:80' | regex_replace('^(?P.+):(?P\\d+)$', '111, \\g') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('[0-9,]{1,}>([0-9.]{1,})>[0-9a-zA-Z\s-]{0,}>TCP>', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: var is "{{ app_path }}" \ No newline at end of file + msg: var is {{ app_path }} \ No newline at end of file From fc0a8f9b209b8b66ef916c4dc56a3e936486a3a4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 23:58:15 +0200 Subject: [PATCH 072/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 162fea7..561f79f 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('[0-9,]{1,}>([0-9.]{1,})>[0-9a-zA-Z\s-]{0,}>TCP>', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('MAIL', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 7cd762fe759aacaf0e3f283694c4a0084d4841fa Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 27 May 2024 23:59:42 +0200 Subject: [PATCH 073/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 561f79f..55d2bb6 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('MAIL', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\MAIL_SERVER\>[0-9,]{1,}\>([0-9.]{1,})\>[0-9a-zA-Z\s-]{0,}\>TCP\>', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From d5294b92bfcc0a039966f17dae7c79a437619599 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:00:11 +0200 Subject: [PATCH 074/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 55d2bb6..ad67bcc 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\MAIL_SERVER\>[0-9,]{1,}\>([0-9.]{1,})\>[0-9a-zA-Z\s-]{0,}\>TCP\>', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\[0-9,]{1,}\>([0-9.]{1,})\>[0-9a-zA-Z\s-]{0,}\>TCP\>', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From f2b70225e4fe260bcd2e44ae476fb4dee7f57ffd Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:00:39 +0200 Subject: [PATCH 075/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index ad67bcc..d44cd3b 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\[0-9,]{1,}\>([0-9.]{1,})\>[0-9a-zA-Z\s-]{0,}\>TCP\>', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\>([0-9.]{1,})\>[0-9a-zA-Z\s-]{0,}\>TCP\>', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 13354611d52d52853a234ba9790b59b903cac153 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:01:06 +0200 Subject: [PATCH 076/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index d44cd3b..7ef3e63 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\>([0-9.]{1,})\>[0-9a-zA-Z\s-]{0,}\>TCP\>', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>([0-9.]{1,})\\>[0-9a-zA-Z\s-]{0,}\\>TCP\\>', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 7f25440dc853495e0a5c750cf56a5d362576267b Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:01:44 +0200 Subject: [PATCH 077/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 7ef3e63..79fcf6f 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>([0-9.]{1,})\\>[0-9a-zA-Z\s-]{0,}\\>TCP\\>', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>([0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 19e3caa761738a8d2ff9031dc773ea5e3f7e4a80 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:03:33 +0200 Subject: [PATCH 078/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 79fcf6f..5ffb8f3 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>([0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>(?P[0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From bd07dc68a630196a9d95daa3db9bea633081973e Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:05:28 +0200 Subject: [PATCH 079/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 5ffb8f3..68c4fdc 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>(?P[0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>([0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '\\g111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From ebf5bca0bc029ac7c4645b014cafe4ef557c3ae1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:07:53 +0200 Subject: [PATCH 080/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 68c4fdc..79fcf6f 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>([0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '\\g111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>([0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 492112d22fec38ddea3d4631ac33766624269b42 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:15:10 +0200 Subject: [PATCH 081/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 79fcf6f..384778c 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>([0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>(?P[0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 3d2c0c3e8627a59c6bd80f390bc51cfa5bcb8dae Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:15:53 +0200 Subject: [PATCH 082/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 384778c..ca44097 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>(?P[0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>(?P[0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '\\g111') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 2207d6daf7acdeae9726824a1df2c8b145d4b299 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:16:49 +0200 Subject: [PATCH 083/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index ca44097..d80c5c2 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>(?P[0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '\\g111') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>(?P[0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '\\g) }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 2fcf3c8feba889c914d3de9d0074d4b5df59d78e Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:20:23 +0200 Subject: [PATCH 084/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index d80c5c2..b153c65 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('\\[0-9,]{1,}\\>(?P[0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '\\g) }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '\\1') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 12a61a66c98c3e33be1e7d6b318e9ce659bdb453 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:21:26 +0200 Subject: [PATCH 085/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index b153c65..1114756 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,7 +2,7 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>', '\\1') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From 04a29164a6144e8ee7b38549a4ab2d9ec77636c1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:23:07 +0200 Subject: [PATCH 086/374] bitwarden --- playbooks/test_replace.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 1114756..ae8a08c 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -3,6 +3,7 @@ ignore_unreachable: false vars: app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') }}" + app_path2: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: From f38608b05e3081e942d0752d3d34c566475cc957 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:23:12 +0200 Subject: [PATCH 087/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index ae8a08c..f365ed7 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -7,4 +7,4 @@ tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: var is {{ app_path }} \ No newline at end of file + msg: var is {{ app_path2 }} \ No newline at end of file From 5428ddbf57fbfd63b233acd61ff2deaba67d92d9 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:26:30 +0200 Subject: [PATCH 088/374] bitwarden --- playbooks/test_replace.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index f365ed7..9fbaeb4 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,9 +2,8 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') }}" - app_path2: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}" + app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3')}}" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: var is {{ app_path2 }} \ No newline at end of file + msg: var is {{ app_path }} \ No newline at end of file From 54d2236a0f650541cf7394a203037a28156811fd Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:29:54 +0200 Subject: [PATCH 089/374] bitwarden --- playbooks/test_replace.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 9fbaeb4..f2fe9d0 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,8 +2,11 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: "{{ '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3')}}" + app_path: '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: var is {{ app_path }} \ No newline at end of file + msg: var is {{ app_path }} + - set_fact: + app_path: '{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}' + - debug: app_path \ No newline at end of file From aabc7762f29524a9bbbd611ad1ed23ad88598483 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:31:29 +0200 Subject: [PATCH 090/374] bitwarden --- playbooks/test_replace.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index f2fe9d0..32d6b23 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -2,11 +2,11 @@ name: Sync mailu ignore_unreachable: false vars: - app_path: '25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>' + app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: msg: var is {{ app_path }} - set_fact: - app_path: '{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}' + app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}" - debug: app_path \ No newline at end of file From 54ec265c509e4160c790c73b40a2ab24b4cd0a43 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:32:20 +0200 Subject: [PATCH 091/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 32d6b23..6aaea8e 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -9,4 +9,4 @@ msg: var is {{ app_path }} - set_fact: app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}" - - debug: app_path \ No newline at end of file + - debug: var is {{ app_path }} \ No newline at end of file From 6e52eba729993743883639ef63bb86352fcd3b5c Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:33:22 +0200 Subject: [PATCH 092/374] bitwarden --- playbooks/test_replace.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 6aaea8e..e7243b1 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -6,7 +6,7 @@ tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: var is {{ app_path }} + msg: "var is {{ app_path }}" - set_fact: app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}" - - debug: var is {{ app_path }} \ No newline at end of file + - debug: "var is {{ app_path }}" \ No newline at end of file From 6f04e754520c61ce4deef4cb560cfe5d9d47a466 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:35:57 +0200 Subject: [PATCH 093/374] bitwarden --- playbooks/test_replace.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index e7243b1..439ff83 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -8,5 +8,7 @@ ansible.builtin.debug: msg: "var is {{ app_path }}" - set_fact: - app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}" - - debug: "var is {{ app_path }}" \ No newline at end of file + app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}" + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ app_path }}" \ No newline at end of file From 94df1b930cc307e8fc0c76015321664cf9e0b397 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:37:28 +0200 Subject: [PATCH 094/374] bitwarden --- playbooks/test_replace.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 439ff83..4cac4c0 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -3,12 +3,13 @@ ignore_unreachable: false vars: app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" + NEW_IP: 192.168.77.238 tasks: - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" - set_fact: - app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1ddadada\\3') }}" + app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 3c62fa4b6bca25820578416df68f3290a94850e7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:41:00 +0200 Subject: [PATCH 095/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 883757a..3cbfd53 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -3,6 +3,7 @@ ignore_unreachable: false vars: + NEW_IP: 192.168.77.238 arch_name: docker_mailu2_data containers: - nginx-app-1 @@ -49,13 +50,23 @@ command: nvram get vts_rulelist when: inventory_hostname in groups['router'] register: ruleset - + + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ app_path }}" + - set_fact: + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ app_path }}" + + - name: Pause for 60 seconds ansible.builtin.pause: seconds: 60 - name: Set new ruleset - command: nvram set vts_rulelist="{{ ruleset.stdout | replace('192.168.77.106', '192.168.77.246') }}" + command: nvram set vts_rulelist="{{ app_path }}" when: inventory_hostname in groups['router'] - name: Nvram commit From 68b93e8836267711c74192f66e9e4c5f4573f53c Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:43:07 +0200 Subject: [PATCH 096/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 3cbfd53..40da633 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -44,7 +44,7 @@ command: "docker restart {{ containers | join(' ') }}" become: true ignore_errors: true - when: inventory_hostname in groups['raspberry'] + when: inventory_hostname in groups['raspberrypi5'] - name: Get ruleset command: nvram get vts_rulelist From 77e3872c06a341ae272c41f11f21e653c4772442 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:54:45 +0200 Subject: [PATCH 097/374] bitwarden --- hosts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts.yml b/hosts.yml index ea3f877..b431753 100644 --- a/hosts.yml +++ b/hosts.yml @@ -80,6 +80,8 @@ datacenter: ansible_python_interpreter: /opt/bin/python ansible_user: admin ansible_pass: l4c1!j4yd33?Du5lo + ansible_ssh_user: admin + ansible_ssh_pass: l4c1!j4yd33?Du5lo # raspberry: # hosts: # 192.168.77.246 From c2e9d22bec160919bb480d7962b21d7fc08a5e71 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 00:58:03 +0200 Subject: [PATCH 098/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 40da633..6c9d3db 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -53,7 +53,7 @@ - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: "var is {{ app_path }}" + msg: "var is {{ ruleset }}" - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" - name: Print the gateway for each host when defined From 278089a49d08fe9f036bfa1385e8fb028aa2a07c Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:04:09 +0200 Subject: [PATCH 099/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 6c9d3db..30065b7 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -54,28 +54,31 @@ - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ ruleset }}" + when: inventory_hostname in groups['router'] - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + when: inventory_hostname in groups['router'] - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" + when: inventory_hostname in groups['router'] - - name: Pause for 60 seconds - ansible.builtin.pause: - seconds: 60 + # - name: Pause for 60 seconds + # ansible.builtin.pause: + # seconds: 60 - - name: Set new ruleset - command: nvram set vts_rulelist="{{ app_path }}" - when: inventory_hostname in groups['router'] + # - name: Set new ruleset + # command: nvram set vts_rulelist="{{ app_path }}" + # when: inventory_hostname in groups['router'] - - name: Nvram commit - command: nvram commit - when: inventory_hostname in groups['router'] + # - name: Nvram commit + # command: nvram commit + # when: inventory_hostname in groups['router'] - - name: Restart firewall - command: service restart_firewall - when: inventory_hostname in groups['router'] + # - name: Restart firewall + # command: service restart_firewall + # when: inventory_hostname in groups['router'] From 1d15ea449940c9439d87eaccfdb39b6130b6bf1a Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:09:07 +0200 Subject: [PATCH 100/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 30065b7..b90e117 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -41,7 +41,7 @@ # #- 140 # - 180 - name: Start mailu containers - command: "docker restart {{ containers | join(' ') }}" + command: "docker start {{ containers | join(' ') }}" become: true ignore_errors: true when: inventory_hostname in groups['raspberrypi5'] @@ -53,7 +53,11 @@ - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: "var is {{ ruleset }}" + msg: "var is {{ ruleset.stdout }}" + when: inventory_hostname in groups['router'] + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ NEW_IP }}" when: inventory_hostname in groups['router'] - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" From 68f50e325fff3c2991d46c8b5c7b5d7de134685d Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:12:42 +0200 Subject: [PATCH 101/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index b90e117..1f33e97 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -23,23 +23,6 @@ - HomeAssistant - mosquitto-mosquitto-1 tasks: - # - name: Start mailu rasp - # uri: - # url: "http://192.168.77.106:9000/api/stacks/{{ item }}/start?endpointId=13" - # method: POST - # body_format: form-urlencoded - # return_content: yes - # headers: - # Content-Type: "application/json" - # X-API-Key: "ptr_DfS2M6Fj2P3fVvYpkhE0KJh2UGCzY47ePaFaLqadsjg=" - # timeout: 60 - # ignore_errors: yes - # when: inventory_hostname in groups['nas'] - # loop: - # - 130 - # - 149 - # #- 140 - # - 180 - name: Start mailu containers command: "docker start {{ containers | join(' ') }}" become: true @@ -60,7 +43,10 @@ msg: "var is {{ NEW_IP }}" when: inventory_hostname in groups['router'] - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path2: "{{ ruleset.stdout }}" + when: inventory_hostname in groups['router'] + - set_fact: + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] - name: Print the gateway for each host when defined ansible.builtin.debug: From 139784703e95214972eea61e7881da3cd29933c5 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:14:23 +0200 Subject: [PATCH 102/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 1f33e97..ef27789 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -46,7 +46,7 @@ app_path2: "{{ ruleset.stdout }}" when: inventory_hostname in groups['router'] - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1"NEW_IP\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] - name: Print the gateway for each host when defined ansible.builtin.debug: From 64a74021b5d38a1dad072c8e9e721f682afd56ee Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:14:53 +0200 Subject: [PATCH 103/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index ef27789..12cff6a 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -46,7 +46,7 @@ app_path2: "{{ ruleset.stdout }}" when: inventory_hostname in groups['router'] - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1"NEW_IP\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1NEW_IP\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] - name: Print the gateway for each host when defined ansible.builtin.debug: From e9669c41b29aa5eb7713234c0710efafddcfb3ce Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:16:36 +0200 Subject: [PATCH 104/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 12cff6a..3cefccf 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -46,7 +46,7 @@ app_path2: "{{ ruleset.stdout }}" when: inventory_hostname in groups['router'] - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1NEW_IP\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1\{\{ NEW_IP \}\}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] - name: Print the gateway for each host when defined ansible.builtin.debug: From e31bb46bf1b4b1ee08642f0e8c113a35a4527c8b Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:17:54 +0200 Subject: [PATCH 105/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 3cefccf..41eaead 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -3,6 +3,7 @@ ignore_unreachable: false vars: + app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" NEW_IP: 192.168.77.238 arch_name: docker_mailu2_data containers: @@ -46,7 +47,7 @@ app_path2: "{{ ruleset.stdout }}" when: inventory_hostname in groups['router'] - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1\{\{ NEW_IP \}\}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] - name: Print the gateway for each host when defined ansible.builtin.debug: From b1128baaaa9e36b71294044cae663cbe773cd8b8 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:20:19 +0200 Subject: [PATCH 106/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 41eaead..a5b2537 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -3,7 +3,7 @@ ignore_unreachable: false vars: - app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" + #app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" NEW_IP: 192.168.77.238 arch_name: docker_mailu2_data containers: @@ -47,7 +47,7 @@ app_path2: "{{ ruleset.stdout }}" when: inventory_hostname in groups['router'] - set_fact: - app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] - name: Print the gateway for each host when defined ansible.builtin.debug: From a18e99f8129f449d72fc4dcc0519bd35aa9e85b0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:23:42 +0200 Subject: [PATCH 107/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index a5b2537..9ea35f9 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -44,7 +44,7 @@ msg: "var is {{ NEW_IP }}" when: inventory_hostname in groups['router'] - set_fact: - app_path2: "{{ ruleset.stdout }}" + app_path2: "{{ ruleset.stdout|string }}" when: inventory_hostname in groups['router'] - set_fact: app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" From eb101b86bf5f73506a5a20579a314dcda969b574 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:26:22 +0200 Subject: [PATCH 108/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 9ea35f9..29c1aae 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -3,7 +3,7 @@ ignore_unreachable: false vars: - #app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" + app_path33: "25,143,465,993,995,587>192.168.77.106>>TCP>443,80>192.168.77.106>>TCP>" NEW_IP: 192.168.77.238 arch_name: docker_mailu2_data containers: @@ -46,14 +46,21 @@ - set_fact: app_path2: "{{ ruleset.stdout|string }}" when: inventory_hostname in groups['router'] + + - set_fact: app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] + + - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" when: inventory_hostname in groups['router'] - + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ app_path33 }}" + when: inventory_hostname in groups['router'] # - name: Pause for 60 seconds # ansible.builtin.pause: From 57de1cee741af6252ac3e7064e5f4a0c72587d51 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:30:02 +0200 Subject: [PATCH 109/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 29c1aae..0b24cd9 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -49,7 +49,7 @@ - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', "\\1{{ NEW_IP }}\\3") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] From 10be48e0f733bebe5e339cf55354ec50a3110ee4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:30:28 +0200 Subject: [PATCH 110/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 0b24cd9..92792fe 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -49,7 +49,7 @@ - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', "\\1{{ NEW_IP }}\\3") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \"\\1{{ NEW_IP }}\\3\") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] From fc37c4db4dddc6c18152285507efff31e0adb93a Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:31:36 +0200 Subject: [PATCH 111/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 92792fe..89e3949 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -49,7 +49,7 @@ - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \"\\1{{ NEW_IP }}\\3\") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \"\\1NEW_IP\\3\") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] From aecdf6b281e4d9f9a94854d55af2d6f150cd724e Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:34:52 +0200 Subject: [PATCH 112/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 89e3949..9816665 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -49,7 +49,7 @@ - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \"\\1NEW_IP\\3\") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ ~ NEW_IP ~ }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] From d00a4baa4e891130faf6228a6807fb7d591d01a5 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:36:15 +0200 Subject: [PATCH 113/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 9816665..271992f 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -49,7 +49,7 @@ - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ ~ NEW_IP ~ }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1"'"{{ NEW_IP }}"'"\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] From d29d19f2b0044c614cd014e6e6784ac02aae81bc Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:37:06 +0200 Subject: [PATCH 114/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 271992f..79f4f76 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -49,7 +49,7 @@ - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1"'"{{ NEW_IP }}"'"\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1" NEW_IP "\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] From 7c54ee1e9c6a1543859510f206e214691df0713a Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:37:44 +0200 Subject: [PATCH 115/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 79f4f76..7cee5f4 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -49,7 +49,7 @@ - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1" NEW_IP "\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ app_path2 }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" when: inventory_hostname in groups['router'] From 6cec075966f0507aef18e27a8a7d3e6fb0bc293f Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:40:49 +0200 Subject: [PATCH 116/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 4cac4c0..bd1372f 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -9,7 +9,7 @@ ansible.builtin.debug: msg: "var is {{ app_path }}" - set_fact: - app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1dasdasdsad\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From e5dd4ac8e329153ef79060d19cd4594f384f9bec Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:42:45 +0200 Subject: [PATCH 117/374] bitwarden --- playbooks/test_replace.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index bd1372f..d5f8d8d 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -1,13 +1,17 @@ -- hosts: nas +- hosts: router name: Sync mailu ignore_unreachable: false vars: app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" NEW_IP: 192.168.77.238 tasks: + - name: Get ruleset + command: nvram get vts_rulelist + when: inventory_hostname in groups['router'] + register: ruleset - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: "var is {{ app_path }}" + msg: "var is {{ ruleset.stdout }}" - set_fact: app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" - name: Print the gateway for each host when defined From 4d52a48badbba3bd0229856c4c5d16fddce327ed Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:43:33 +0200 Subject: [PATCH 118/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index d5f8d8d..7027277 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -13,7 +13,7 @@ ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" - set_fact: - app_path: "{{ app_path | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 85f0493a324213b3612e39d85670bcd0f2a51103 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:44:29 +0200 Subject: [PATCH 119/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 7027277..b9686ab 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -13,7 +13,7 @@ ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path| regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From a7b41d956796222f2a6844830971ea006ef3f2a3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:46:12 +0200 Subject: [PATCH 120/374] bitwarden --- playbooks/test_replace.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index b9686ab..b81120b 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -14,6 +14,8 @@ msg: "var is {{ ruleset.stdout }}" - set_fact: app_path: "{{ app_path| regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + vars: + NEW_IP: ",world" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From eb3646901388be59e7d3e69a88c699c8654280c8 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:48:00 +0200 Subject: [PATCH 121/374] bitwarden --- playbooks/test_replace.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index b81120b..7b4239a 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -3,7 +3,7 @@ ignore_unreachable: false vars: app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" - NEW_IP: 192.168.77.238 + NEW_IP: "192.168.77.238" tasks: - name: Get ruleset command: nvram get vts_rulelist @@ -13,7 +13,7 @@ ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" - set_fact: - app_path: "{{ app_path| regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" vars: NEW_IP: ",world" - name: Print the gateway for each host when defined From 29205b7c33d030740cf49c5da91037fafcdce077 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:49:18 +0200 Subject: [PATCH 122/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 7b4239a..bad7211 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -13,7 +13,7 @@ ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ '{{' }} NEW_IP {{ '}}' }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" vars: NEW_IP: ",world" - name: Print the gateway for each host when defined From cc308f5eab26664fb94292dd471ded5d070e5585 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:53:23 +0200 Subject: [PATCH 123/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index bad7211..f8027b8 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -13,7 +13,7 @@ ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ '{{' }} NEW_IP {{ '}}' }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" vars: NEW_IP: ",world" - name: Print the gateway for each host when defined From 8c4de73871190baa2d7e8042506d39d59b85d24d Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:54:52 +0200 Subject: [PATCH 124/374] bitwarden --- playbooks/test_replace.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index f8027b8..3a27cef 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -3,7 +3,7 @@ ignore_unreachable: false vars: app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" - NEW_IP: "192.168.77.238" + new_ip_dest: "192.168.77.238" tasks: - name: Get ruleset command: nvram get vts_rulelist @@ -13,7 +13,7 @@ ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" vars: NEW_IP: ",world" - name: Print the gateway for each host when defined From ca3ad317d0eb56a0d7550a84bd97cc0ad9575dc1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 01:55:48 +0200 Subject: [PATCH 125/374] bitwarden --- playbooks/test_replace.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 3a27cef..93be70b 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -13,9 +13,9 @@ ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1 {{ new_ip_dest }} \\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" vars: - NEW_IP: ",world" + new_ip_dest: ",world" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From d9cea86334c38a1b150c9120a48b4495b3e93aef Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:03:35 +0200 Subject: [PATCH 126/374] bitwarden --- playbooks/test_replace.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 93be70b..69dba91 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -12,10 +12,12 @@ - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" + - name: initialize variables + set_fact: + new_ip_dest: asdasd + - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1 {{ new_ip_dest }} \\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - vars: - new_ip_dest: ",world" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From d4088d7835d23f28cb48a1b59fb15bb11dc8ddc5 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:05:18 +0200 Subject: [PATCH 127/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 69dba91..a960b4f 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1 {{ new_ip_dest }} \\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \\1{{ new_ip_dest }}\\3) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 1c4e6baa2cdb5aca6a886b219db9e3765a6fcb54 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:06:10 +0200 Subject: [PATCH 128/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index a960b4f..eafc3a1 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \\1{{ new_ip_dest }}\\3) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \1{{ new_ip_dest }}\3) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 9a6e7541f3871be19d855132ae169907601dc1a4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:08:05 +0200 Subject: [PATCH 129/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index eafc3a1..54b7f44 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \1{{ new_ip_dest }}\3) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 0dc7a555c6f263099ffbe8990474e952ed6c627b Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:09:55 +0200 Subject: [PATCH 130/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 54b7f44..ca8e6b1 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', new_ip_dest) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From bf8f1804e5ed1fc4692fa51d3e58a98196a59f09 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:10:44 +0200 Subject: [PATCH 131/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index ca8e6b1..e59836a 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', new_ip_dest) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', "\\1new_ip_dest") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 7f2ec5bc5c502a0be9feb6340425cb92096950e3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:10:52 +0200 Subject: [PATCH 132/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index e59836a..7142130 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', "\\1new_ip_dest") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \\"\\1new_ip_dest\\") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 56b11e0f489881f6fafcc1af1861fab08f52f4ab Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:11:23 +0200 Subject: [PATCH 133/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 7142130..117eebd 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \\"\\1new_ip_dest\\") | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \\1new_ip_dest) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From cba3e3ffc1c800b0821d3fe222bf4af792f5416c Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:12:26 +0200 Subject: [PATCH 134/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 117eebd..6fc66fd 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', \\1new_ip_dest) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1new_ip_dest') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 957bb8d995029bbc35e3fb40092bd3f7c0e66404 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:13:52 +0200 Subject: [PATCH 135/374] bitwarden --- playbooks/test_replace.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 6fc66fd..bb2fe6b 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -15,9 +15,11 @@ - name: initialize variables set_fact: new_ip_dest: asdasd - + - name: initialize variables + set_fact: + regexp: '\\1new_ip_dest') - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1new_ip_dest') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 867d7382d498341a24ca9dd55da97788675a6490 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:14:17 +0200 Subject: [PATCH 136/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index bb2fe6b..0878ba5 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - name: initialize variables set_fact: - regexp: '\\1new_ip_dest') + regexp: '\\1new_ip_dest' - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined From d4e093804c7599f24c3ed504d8aef984e9e9a709 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:15:11 +0200 Subject: [PATCH 137/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 0878ba5..5549969 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - name: initialize variables set_fact: - regexp: '\\1new_ip_dest' + regexp: "{{ \\1new_ip_dest }}" - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined From 7ab11d34441d3451422c410a9f31a8fb18fe2e1c Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:16:29 +0200 Subject: [PATCH 138/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 5549969..dda016f 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - name: initialize variables set_fact: - regexp: "{{ \\1new_ip_dest }}" + regexp: "\\1{{ new_ip_dest }}" - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" - name: Print the gateway for each host when defined From 59bb8b562a79ff5d6da7bbbe3a9528771ddf4fdf Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:17:32 +0200 Subject: [PATCH 139/374] bitwarden --- playbooks/test_replace.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index dda016f..105cdbd 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,9 +17,9 @@ new_ip_dest: asdasd - name: initialize variables set_fact: - regexp: "\\1{{ new_ip_dest }}" + regexp: "\\1{{ new_ip_dest }}\3" - set_fact: - app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ new_ip_dest }}\\3') }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ app_path }}" \ No newline at end of file From 603facf60cbc29e432ff0a520640652a9e7eb572 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:18:07 +0200 Subject: [PATCH 140/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 105cdbd..b505044 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -17,7 +17,7 @@ new_ip_dest: asdasd - name: initialize variables set_fact: - regexp: "\\1{{ new_ip_dest }}\3" + regexp: "\\1{{ new_ip_dest }}\\3" - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" - name: Print the gateway for each host when defined From 233b2541e48aa4dcd3aa9eb54b3cf46ea5307d61 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:18:40 +0200 Subject: [PATCH 141/374] bitwarden --- playbooks/test_replace.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index b505044..b824a40 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -12,9 +12,6 @@ - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" - - name: initialize variables - set_fact: - new_ip_dest: asdasd - name: initialize variables set_fact: regexp: "\\1{{ new_ip_dest }}\\3" From 17106891b3f27ab2695db395c8174fe1e6da760a Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:20:15 +0200 Subject: [PATCH 142/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index b824a40..ba9f920 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -3,7 +3,7 @@ ignore_unreachable: false vars: app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" - new_ip_dest: "192.168.77.238" + new_ip_dest: "n192.168.77.238" tasks: - name: Get ruleset command: nvram get vts_rulelist From 0dc4a68dc901c7314c7c8babb9a955ba3ce51423 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:22:11 +0200 Subject: [PATCH 143/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index ba9f920..97239e5 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -14,7 +14,7 @@ msg: "var is {{ ruleset.stdout }}" - name: initialize variables set_fact: - regexp: "\\1{{ new_ip_dest }}\\3" + regexp: "\\<1>{{ new_ip_dest }}\\3" - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" - name: Print the gateway for each host when defined From ee98a584f09dd25b6f8797fc8bb6f9705c0e4490 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:22:29 +0200 Subject: [PATCH 144/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 97239e5..59b1dbe 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -14,7 +14,7 @@ msg: "var is {{ ruleset.stdout }}" - name: initialize variables set_fact: - regexp: "\\<1>{{ new_ip_dest }}\\3" + regexp: "\\g<1>{{ new_ip_dest }}\\3" - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" - name: Print the gateway for each host when defined From 516a05651d58bc36257d3fd1398a91d38bc2e126 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 02:23:00 +0200 Subject: [PATCH 145/374] bitwarden --- playbooks/test_replace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 59b1dbe..83cd8da 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -3,7 +3,7 @@ ignore_unreachable: false vars: app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" - new_ip_dest: "n192.168.77.238" + new_ip_dest: "192.168.77.238" tasks: - name: Get ruleset command: nvram get vts_rulelist From 183520d19a0af620eadb5440512441c71976623f Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 08:41:40 +0200 Subject: [PATCH 146/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 7cee5f4..56828b9 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -3,7 +3,6 @@ ignore_unreachable: false vars: - app_path33: "25,143,465,993,995,587>192.168.77.106>>TCP>443,80>192.168.77.106>>TCP>" NEW_IP: 192.168.77.238 arch_name: docker_mailu2_data containers: @@ -39,17 +38,26 @@ ansible.builtin.debug: msg: "var is {{ ruleset.stdout }}" when: inventory_hostname in groups['router'] + + - name: Print the gateway for each host when defined ansible.builtin.debug: msg: "var is {{ NEW_IP }}" when: inventory_hostname in groups['router'] + + - set_fact: - app_path2: "{{ ruleset.stdout|string }}" + app_path2: "{{ ruleset.stdout }}" when: inventory_hostname in groups['router'] + - name: initialize variables + set_fact: + regexp: "\\g<1>{{ NEW_IP }}\\3" + when: inventory_hostname in groups['router'] + - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ app_path2 }}\\3') | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', '\\1{{ NEW_IP }}\\3') }}" + app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" when: inventory_hostname in groups['router'] @@ -57,10 +65,7 @@ ansible.builtin.debug: msg: "var is {{ app_path }}" when: inventory_hostname in groups['router'] - - name: Print the gateway for each host when defined - ansible.builtin.debug: - msg: "var is {{ app_path33 }}" - when: inventory_hostname in groups['router'] + # - name: Pause for 60 seconds # ansible.builtin.pause: From f73bd7e46ead382194db060280886b1b973395b8 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 08:43:21 +0200 Subject: [PATCH 147/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 56828b9..2b50d0d 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -45,19 +45,13 @@ msg: "var is {{ NEW_IP }}" when: inventory_hostname in groups['router'] - - - set_fact: - app_path2: "{{ ruleset.stdout }}" - when: inventory_hostname in groups['router'] - - - name: initialize variables set_fact: regexp: "\\g<1>{{ NEW_IP }}\\3" when: inventory_hostname in groups['router'] - set_fact: - app_path: "{{ app_path2 | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" when: inventory_hostname in groups['router'] From d884e7706bc1cf86f003afa8b2b12b3879693c5a Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 28 May 2024 08:47:39 +0200 Subject: [PATCH 148/374] bitwarden --- playbooks/mailu_switch_to_second.yaml | 29 +++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/playbooks/mailu_switch_to_second.yaml b/playbooks/mailu_switch_to_second.yaml index 2b50d0d..ceb9e12 100644 --- a/playbooks/mailu_switch_to_second.yaml +++ b/playbooks/mailu_switch_to_second.yaml @@ -3,7 +3,6 @@ ignore_unreachable: false vars: - NEW_IP: 192.168.77.238 arch_name: docker_mailu2_data containers: - nginx-app-1 @@ -42,12 +41,12 @@ - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: "var is {{ NEW_IP }}" + msg: "var is {{ destination }}" when: inventory_hostname in groups['router'] - name: initialize variables set_fact: - regexp: "\\g<1>{{ NEW_IP }}\\3" + regexp: "\\g<1>{{ destination }}\\3" when: inventory_hostname in groups['router'] - set_fact: @@ -61,21 +60,21 @@ when: inventory_hostname in groups['router'] - # - name: Pause for 60 seconds - # ansible.builtin.pause: - # seconds: 60 + - name: Pause for 60 seconds + ansible.builtin.pause: + seconds: 60 - # - name: Set new ruleset - # command: nvram set vts_rulelist="{{ app_path }}" - # when: inventory_hostname in groups['router'] + - name: Set new ruleset + command: nvram set vts_rulelist="{{ app_path }}" + when: inventory_hostname in groups['router'] - # - name: Nvram commit - # command: nvram commit - # when: inventory_hostname in groups['router'] + - name: Nvram commit + command: nvram commit + when: inventory_hostname in groups['router'] - # - name: Restart firewall - # command: service restart_firewall - # when: inventory_hostname in groups['router'] + - name: Restart firewall + command: service restart_firewall + when: inventory_hostname in groups['router'] From 6e7ccbd3a9aaf07a9dcda34a523b2e548dd65434 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 20:59:21 +0200 Subject: [PATCH 149/374] bitwarden --- playbooks/sync_container_data.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 757923a..ecca0e7 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -3,7 +3,7 @@ become: true when: inventory_hostname in groups['raspberrypi5'] - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{authentik,mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] \ No newline at end of file From 3a5a96333af644d5e7f2daf22f2e284bdcc222b4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 21:02:26 +0200 Subject: [PATCH 150/374] bitwarden --- playbooks/sync_all.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index f74a0f6..c1e0937 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -24,7 +24,7 @@ - semaphore.sectorq.eu when: inventory_hostname in groups['raspberrypi5'] - name: Get relevant configs - ansible.builtin.shell: 'egrep -l "# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' + ansible.builtin.shell: 'egrep -l "# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' ignore_errors: yes become: yes register: result From 03613503d8b8e303d2672e5b0e02d5b44dc0ca2b Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 21:12:54 +0200 Subject: [PATCH 151/374] bitwarden --- playbooks/sync_all.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index c1e0937..d895947 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -50,6 +50,7 @@ - Nginx Proxy Manager - Portainer - Roundcube + - Authentik when: inventory_hostname in groups['raspberrypi5'] - name: Changing heimdall background ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" From b2c3f55e02e51caee873024d40cde900a0af6973 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 22:32:26 +0200 Subject: [PATCH 152/374] bitwarden --- playbooks/apt_upgrade.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/apt_upgrade.yml b/playbooks/apt_upgrade.yml index 44fab94..0415a69 100644 --- a/playbooks/apt_upgrade.yml +++ b/playbooks/apt_upgrade.yml @@ -1,6 +1,7 @@ - hosts: datacenter name: Apt udate become: true + ignore_unreachable: true tasks: - name: Upgrade the OS ansible.builtin.apt: From 9cbec713adb89e106e23048018533eb314669df9 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 22:38:35 +0200 Subject: [PATCH 153/374] bitwarden --- hosts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts.yml b/hosts.yml index b431753..69555cf 100644 --- a/hosts.yml +++ b/hosts.yml @@ -57,8 +57,8 @@ datacenter: hosts: 192.168.77.16[6:7] vars: - ansible_user: admin - ansible_ssh_pass: l4c1j4yd33Du5lo + ansible_user: jd + ansible_ssh_pass: q ansible_become_password: l4c1j4yd33Du5lo windows: hosts: From f2f6328a142f35c4a5df6fb31b2981ddd883a439 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 23:19:34 +0200 Subject: [PATCH 154/374] bitwarden --- playbooks/distrib_ssh_keys.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 playbooks/distrib_ssh_keys.yml diff --git a/playbooks/distrib_ssh_keys.yml b/playbooks/distrib_ssh_keys.yml new file mode 100644 index 0000000..01c3573 --- /dev/null +++ b/playbooks/distrib_ssh_keys.yml @@ -0,0 +1,23 @@ +- hosts: "{{ hosts }}" + + become: yes + tasks: + + # Deploy SSH Key + # -- + - name: install public keys + ansible.posix.authorized_key: + user: "{{ user }}" + state: present + key: "{{ lookup('file', new_ssh_key_file) }}" + + + # Set all sudoers to no password + # -- + - name: change sudoers file + lineinfile: + path: /etc/sudoers + state: present + regexp: '^%sudo' + line: '%sudo ALL=(ALL) NOPASSWD: ALL' + validate: /usr/sbin/visudo -cf %s \ No newline at end of file From f768c973f8331680f15bc3d224ad56ef84e71c16 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 23:36:08 +0200 Subject: [PATCH 155/374] bitwarden --- playbooks/modify_tasmotas.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 playbooks/modify_tasmotas.yml diff --git a/playbooks/modify_tasmotas.yml b/playbooks/modify_tasmotas.yml new file mode 100644 index 0000000..bdab38a --- /dev/null +++ b/playbooks/modify_tasmotas.yml @@ -0,0 +1,9 @@ +- hosts: nas + name: Reconfigure tasmotas + ignore_unreachable: false + tasks: + - name: Check that you can connect (GET) to a page and it returns a status 200 + ansible.builtin.uri: + url: http://{{ item }}/cm?cmnd=Backlog%20MqttHost%20{{ MQTT_BROKER }}%3BMqttUser%20{{ MQTT_USER }}%3BMqttPassword%20{{ MQTT_PASS }} + with_items: + - 192.168.77.160 \ No newline at end of file From 671b4299c5c68da790096371d7d24c365b015deb Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 23:39:05 +0200 Subject: [PATCH 156/374] bitwarden --- playbooks/modify_tasmotas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/modify_tasmotas.yml b/playbooks/modify_tasmotas.yml index bdab38a..8bc9710 100644 --- a/playbooks/modify_tasmotas.yml +++ b/playbooks/modify_tasmotas.yml @@ -6,4 +6,4 @@ ansible.builtin.uri: url: http://{{ item }}/cm?cmnd=Backlog%20MqttHost%20{{ MQTT_BROKER }}%3BMqttUser%20{{ MQTT_USER }}%3BMqttPassword%20{{ MQTT_PASS }} with_items: - - 192.168.77.160 \ No newline at end of file + - 192.168.77.188 \ No newline at end of file From 8cebd5c3e306474a7a1192e940f1f0aab8ec654a Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 23:42:46 +0200 Subject: [PATCH 157/374] bitwarden --- playbooks/modify_tasmotas.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/playbooks/modify_tasmotas.yml b/playbooks/modify_tasmotas.yml index 8bc9710..acfbe31 100644 --- a/playbooks/modify_tasmotas.yml +++ b/playbooks/modify_tasmotas.yml @@ -6,4 +6,12 @@ ansible.builtin.uri: url: http://{{ item }}/cm?cmnd=Backlog%20MqttHost%20{{ MQTT_BROKER }}%3BMqttUser%20{{ MQTT_USER }}%3BMqttPassword%20{{ MQTT_PASS }} with_items: + - 192.168.77.180 + - 192.168.77.181 + - 192.168.77.182 + - 192.168.77.183 + - 192.168.77.184 + - 192.168.77.185 + - 192.168.77.186 + - 192.168.77.187 - 192.168.77.188 \ No newline at end of file From b59294e30b75d9edbf6c905ede112e493acb7b4d Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 2 Jun 2024 23:44:58 +0200 Subject: [PATCH 158/374] bitwarden --- playbooks/modify_tasmotas.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/modify_tasmotas.yml b/playbooks/modify_tasmotas.yml index acfbe31..2ea0b79 100644 --- a/playbooks/modify_tasmotas.yml +++ b/playbooks/modify_tasmotas.yml @@ -5,6 +5,7 @@ - name: Check that you can connect (GET) to a page and it returns a status 200 ansible.builtin.uri: url: http://{{ item }}/cm?cmnd=Backlog%20MqttHost%20{{ MQTT_BROKER }}%3BMqttUser%20{{ MQTT_USER }}%3BMqttPassword%20{{ MQTT_PASS }} + ignore_errors: true with_items: - 192.168.77.180 - 192.168.77.181 From c2d7ccc4cbc9821f4c043d03aebea222da95a8a4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:07:22 +0200 Subject: [PATCH 159/374] bitwarden --- playbooks/modify_espresense.yml | 89 +++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 playbooks/modify_espresense.yml diff --git a/playbooks/modify_espresense.yml b/playbooks/modify_espresense.yml new file mode 100644 index 0000000..42d861d --- /dev/null +++ b/playbooks/modify_espresense.yml @@ -0,0 +1,89 @@ +- hosts: nas + name: Reconfigure espresense + ignore_unreachable: false + tasks: + - name: Check that you can connect (GET) to a page and it returns a status 200 + ansible.builtin.uri: + url: http://192.168.77.150 + + method: POST + body_format: form-urlencoded + body: + language: en + room: + wifi_timeout: + portal_timeout: + mqtt_host: + mqtt_port: + mqtt_user: jaydee + mqtt_pass: jaydee1 + discovery: 1 + discovery_prefix: + pub_tele: 1 + pub_rooms: 1 + pub_devices: 1 + update: + known_macs: + known_irks: + query: + count_ids: + count_enter: + count_exit: + count_ms: + include: "mifit:fd2375de188a" + exclude: + max_dist: 3 + skip_dist: + skip_ms: + ref_rssi: + rx_adj_rssi: + absorption: + forget_ms: + tx_ref_rssi: + led_1_pin: -1 + led_1_cnt: + led_2_pin: -1 + led_2_cnt: + led_3_pin: + led_3_cnt: + pir_type: 0 + pir_pin: 16 + pir_timeout: + radar_pin: + radar_timeout: + switch_1_pin: + switch_1_timeout: + switch_2_pin: + switch_2_timeout: + button_1_pin: + button_1_timeout: + button_2_pin: + button_2_timeout: + dht11_pin: + dht22_pin: + dhtTemp_offset: + I2C_Bus_1_SDA: 22 + I2C_Bus_1_SCL: 21 + I2C_Bus_2_SDA: + I2C_Bus_2_SCL: + AHTX0_I2c_Bus: + AHTX0_I2c: + BH1750_I2c_Bus: + BH1750_I2c: + BME280_I2c_Bus: 1 + BME280_I2c: "0x76" + BMP180_I2c_Bus: + BMP180_I2c: + BMP280_I2c_Bus: + BMP280_I2c: + SHT_I2c_Bus: + TSL2561_I2c_Bus: + TSL2561_I2c: + TSL2561_I2c_Gain: + SGP30_I2c_Bus: + SGP30_I2c: + HX711_sckPin: + HX711_doutPin: + ds18b20_pin: + dsTemp_offset: + ignore_errors: true From 64fde0fff95083557622ebb226aeda1fe552f054 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:08:01 +0200 Subject: [PATCH 160/374] bitwarden --- playbooks/modify_espresense.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/modify_espresense.yml b/playbooks/modify_espresense.yml index 42d861d..5839450 100644 --- a/playbooks/modify_espresense.yml +++ b/playbooks/modify_espresense.yml @@ -13,8 +13,8 @@ room: wifi_timeout: portal_timeout: - mqtt_host: - mqtt_port: + mqtt_host: 192.168.77.106 + mqtt_port: 1883 mqtt_user: jaydee mqtt_pass: jaydee1 discovery: 1 From 4f9bd9f9df488a70756683ca40b575f15265bbe3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:17:14 +0200 Subject: [PATCH 161/374] bitwarden --- playbooks/modify_espresense.yml | 148 ++++++++++++++++---------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/playbooks/modify_espresense.yml b/playbooks/modify_espresense.yml index 5839450..076c9a1 100644 --- a/playbooks/modify_espresense.yml +++ b/playbooks/modify_espresense.yml @@ -10,80 +10,80 @@ body_format: form-urlencoded body: language: en - room: - wifi_timeout: - portal_timeout: - mqtt_host: 192.168.77.106 - mqtt_port: 1883 - mqtt_user: jaydee - mqtt_pass: jaydee1 - discovery: 1 - discovery_prefix: - pub_tele: 1 - pub_rooms: 1 - pub_devices: 1 - update: - known_macs: - known_irks: - query: - count_ids: - count_enter: - count_exit: - count_ms: + room: "worker" + wifi_timeout: "" + portal_timeout: "" + mqtt_host: "192.168.77.106" + mqtt_port: "1883" + mqtt_user: "jaydee" + mqtt_pass: "jaydee1" + discovery: "1" + discovery_prefix: "" + pub_tele: "1" + pub_rooms: "1" + pub_devices: "1" + update: "" + known_macs: "" + known_irks: "" + query: "" + count_ids: "" + count_enter: "" + count_exit: "" + count_ms: "" include: "mifit:fd2375de188a" - exclude: - max_dist: 3 - skip_dist: - skip_ms: - ref_rssi: - rx_adj_rssi: - absorption: - forget_ms: - tx_ref_rssi: - led_1_pin: -1 - led_1_cnt: - led_2_pin: -1 - led_2_cnt: - led_3_pin: - led_3_cnt: - pir_type: 0 - pir_pin: 16 - pir_timeout: - radar_pin: - radar_timeout: - switch_1_pin: - switch_1_timeout: - switch_2_pin: - switch_2_timeout: - button_1_pin: - button_1_timeout: - button_2_pin: - button_2_timeout: - dht11_pin: - dht22_pin: - dhtTemp_offset: - I2C_Bus_1_SDA: 22 - I2C_Bus_1_SCL: 21 - I2C_Bus_2_SDA: - I2C_Bus_2_SCL: - AHTX0_I2c_Bus: - AHTX0_I2c: - BH1750_I2c_Bus: - BH1750_I2c: - BME280_I2c_Bus: 1 + exclude: "" + max_dist: "3" + skip_dist: "" + skip_ms: "" + ref_rssi: "" + rx_adj_rssi: "" + absorption: "" + forget_ms: "" + tx_ref_rssi: "" + led_1_pin: "-1" + led_1_cnt: "" + led_2_pin: "-1" + led_2_cnt: "" + led_3_pin: "" + led_3_cnt: "" + pir_type: "0" + pir_pin: "16" + pir_timeout: "" + radar_pin: "" + radar_timeout: "" + switch_1_pin: "" + switch_1_timeout: "" + switch_2_pin: "" + switch_2_timeout: "" + button_1_pin: "" + button_1_timeout: "" + button_2_pin: "" + button_2_timeout: "" + dht11_pin: "" + dht22_pin: "" + dhtTemp_offset: "" + I2C_Bus_1_SDA: "22" + I2C_Bus_1_SCL: "21" + I2C_Bus_2_SDA: "" + I2C_Bus_2_SCL: "" + AHTX0_I2c_Bus: "" + AHTX0_I2c: "" + BH1750_I2c_Bus: "" + BH1750_I2c: "" + BME280_I2c_Bus: "1" BME280_I2c: "0x76" - BMP180_I2c_Bus: - BMP180_I2c: - BMP280_I2c_Bus: - BMP280_I2c: - SHT_I2c_Bus: - TSL2561_I2c_Bus: - TSL2561_I2c: - TSL2561_I2c_Gain: - SGP30_I2c_Bus: - SGP30_I2c: - HX711_sckPin: - HX711_doutPin: - ds18b20_pin: - dsTemp_offset: + BMP180_I2c_Bus: "" + BMP180_I2c: "" + BMP280_I2c_Bus: "" + BMP280_I2c: "" + SHT_I2c_Bus: "" + TSL2561_I2c_Bus: "" + TSL2561_I2c: "" + TSL2561_I2c_Gain: "" + SGP30_I2c_Bus: "" + SGP30_I2c: "" + HX711_sckPin: "" + HX711_doutPin: "" + ds18b20_pin: "" + dsTemp_offset: "" ignore_errors: true From 29a49f422ed72b43ee4d9dca8802e2926d616260 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:21:49 +0200 Subject: [PATCH 162/374] bitwarden --- playbooks/modify_espresense copy.yml | 89 ++++++++++++++++++++++++++++ playbooks/modify_espresense.yml | 67 +-------------------- 2 files changed, 91 insertions(+), 65 deletions(-) create mode 100644 playbooks/modify_espresense copy.yml diff --git a/playbooks/modify_espresense copy.yml b/playbooks/modify_espresense copy.yml new file mode 100644 index 0000000..bb04647 --- /dev/null +++ b/playbooks/modify_espresense copy.yml @@ -0,0 +1,89 @@ +- hosts: nas + name: Reconfigure espresense + ignore_unreachable: false + tasks: + - name: Check that you can connect (GET) to a page and it returns a status 200 + ansible.builtin.uri: + url: http://192.168.77.150 + + method: POST + body_format: form-urlencoded + body: + language: "en" + room: "worker1" + wifi_timeout: "" + portal_timeout: "" + mqtt_host: "192.168.77.106" + mqtt_port: "1883" + mqtt_user: "jaydee" + mqtt_pass: "jaydee1" + discovery: "1" + discovery_prefix: "" + pub_tele: "1" + pub_rooms: "1" + pub_devices: "1" + update: "" + known_macs: "" + known_irks: "" + query: "" + count_ids: "" + count_enter: "" + count_exit: "" + count_ms: "" + include: "mifit:fd2375de188a" + exclude: "" + max_dist: "3" + skip_dist: "" + skip_ms: "" + ref_rssi: "" + rx_adj_rssi: "" + absorption: "" + forget_ms: "" + tx_ref_rssi: "" + led_1_pin: "-1" + led_1_cnt: "" + led_2_pin: "-1" + led_2_cnt: "" + led_3_pin: "" + led_3_cnt: "" + pir_type: "0" + pir_pin: "16" + pir_timeout: "" + radar_pin: "" + radar_timeout: "" + switch_1_pin: "" + switch_1_timeout: "" + switch_2_pin: "" + switch_2_timeout: "" + button_1_pin: "" + button_1_timeout: "" + button_2_pin: "" + button_2_timeout: "" + dht11_pin: "" + dht22_pin: "" + dhtTemp_offset: "" + I2C_Bus_1_SDA: "22" + I2C_Bus_1_SCL: "21" + I2C_Bus_2_SDA: "" + I2C_Bus_2_SCL: "" + AHTX0_I2c_Bus: "" + AHTX0_I2c: "" + BH1750_I2c_Bus: "" + BH1750_I2c: "" + BME280_I2c_Bus: "1" + BME280_I2c: "0x76" + BMP180_I2c_Bus: "" + BMP180_I2c: "" + BMP280_I2c_Bus: "" + BMP280_I2c: "" + SHT_I2c_Bus: "" + TSL2561_I2c_Bus: "" + TSL2561_I2c: "" + TSL2561_I2c_Gain: "" + SGP30_I2c_Bus: "" + SGP30_I2c: "" + HX711_sckPin: "" + HX711_doutPin: "" + ds18b20_pin: "" + dsTemp_offset: "" + ignore_errors: true diff --git a/playbooks/modify_espresense.yml b/playbooks/modify_espresense.yml index 076c9a1..83cbe99 100644 --- a/playbooks/modify_espresense.yml +++ b/playbooks/modify_espresense.yml @@ -9,8 +9,8 @@ method: POST body_format: form-urlencoded body: - language: en - room: "worker" + language: "en" + room: "worker1" wifi_timeout: "" portal_timeout: "" mqtt_host: "192.168.77.106" @@ -23,67 +23,4 @@ pub_rooms: "1" pub_devices: "1" update: "" - known_macs: "" - known_irks: "" - query: "" - count_ids: "" - count_enter: "" - count_exit: "" - count_ms: "" - include: "mifit:fd2375de188a" - exclude: "" - max_dist: "3" - skip_dist: "" - skip_ms: "" - ref_rssi: "" - rx_adj_rssi: "" - absorption: "" - forget_ms: "" - tx_ref_rssi: "" - led_1_pin: "-1" - led_1_cnt: "" - led_2_pin: "-1" - led_2_cnt: "" - led_3_pin: "" - led_3_cnt: "" - pir_type: "0" - pir_pin: "16" - pir_timeout: "" - radar_pin: "" - radar_timeout: "" - switch_1_pin: "" - switch_1_timeout: "" - switch_2_pin: "" - switch_2_timeout: "" - button_1_pin: "" - button_1_timeout: "" - button_2_pin: "" - button_2_timeout: "" - dht11_pin: "" - dht22_pin: "" - dhtTemp_offset: "" - I2C_Bus_1_SDA: "22" - I2C_Bus_1_SCL: "21" - I2C_Bus_2_SDA: "" - I2C_Bus_2_SCL: "" - AHTX0_I2c_Bus: "" - AHTX0_I2c: "" - BH1750_I2c_Bus: "" - BH1750_I2c: "" - BME280_I2c_Bus: "1" - BME280_I2c: "0x76" - BMP180_I2c_Bus: "" - BMP180_I2c: "" - BMP280_I2c_Bus: "" - BMP280_I2c: "" - SHT_I2c_Bus: "" - TSL2561_I2c_Bus: "" - TSL2561_I2c: "" - TSL2561_I2c_Gain: "" - SGP30_I2c_Bus: "" - SGP30_I2c: "" - HX711_sckPin: "" - HX711_doutPin: "" - ds18b20_pin: "" - dsTemp_offset: "" ignore_errors: true From 5e8089649392802cec508f944d8ba43e738819ee Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:22:58 +0200 Subject: [PATCH 163/374] bitwarden --- playbooks/modify_espresense.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/playbooks/modify_espresense.yml b/playbooks/modify_espresense.yml index 83cbe99..ce40708 100644 --- a/playbooks/modify_espresense.yml +++ b/playbooks/modify_espresense.yml @@ -24,3 +24,10 @@ pub_devices: "1" update: "" ignore_errors: true + - name: Check that you can connect (GET) to a page and it returns a status 200 + ansible.builtin.uri: + url: http://192.168.77.150/restart + + method: POST + + ignore_errors: true \ No newline at end of file From 01b9e06d51151348d0e66480b207bc8b713ff95b Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:26:18 +0200 Subject: [PATCH 164/374] bitwarden --- playbooks/modify_espresense.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/modify_espresense.yml b/playbooks/modify_espresense.yml index ce40708..c89eb72 100644 --- a/playbooks/modify_espresense.yml +++ b/playbooks/modify_espresense.yml @@ -10,13 +10,13 @@ body_format: form-urlencoded body: language: "en" - room: "worker1" + room: "worker" wifi_timeout: "" portal_timeout: "" - mqtt_host: "192.168.77.106" + mqtt_host: "{{ MQTT_BROKER }}" mqtt_port: "1883" - mqtt_user: "jaydee" - mqtt_pass: "jaydee1" + mqtt_user: "{{ MQTT_USER }}" + mqtt_pass: "{{ MQTT_PASS }}" discovery: "1" discovery_prefix: "" pub_tele: "1" From 9f56d13aad46f10989b1302c1f8ec43b8561b749 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:38:40 +0200 Subject: [PATCH 165/374] bitwarden --- playbooks/test_replace.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index 83cd8da..be3d73e 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -1,9 +1,6 @@ - hosts: router - name: Sync mailu + name: Switch destination ignore_unreachable: false - vars: - app_path: "25,143,465,993,995,587>192.168.77.106>dsadsad dsad dasdas-ddasd>TCP>443,80>192.168.77.106>>TCP>" - new_ip_dest: "192.168.77.238" tasks: - name: Get ruleset command: nvram get vts_rulelist @@ -14,7 +11,7 @@ msg: "var is {{ ruleset.stdout }}" - name: initialize variables set_fact: - regexp: "\\g<1>{{ new_ip_dest }}\\3" + regexp: "\\g<1>{{ DESTINATION }}\\3" - set_fact: app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" - name: Print the gateway for each host when defined From ef6e673d84d6a92e2dffc5f632272260fe829538 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:41:48 +0200 Subject: [PATCH 166/374] bitwarden --- playbooks/test_replace.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index be3d73e..c7b726c 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -16,4 +16,7 @@ app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" - name: Print the gateway for each host when defined ansible.builtin.debug: - msg: "var is {{ app_path }}" \ No newline at end of file + msg: "var is {{ app_path }}" + - name: Set ruleset + command: nvram set vts_rulelist={{ app_path }} + when: inventory_hostname in groups['router'] \ No newline at end of file From 01101885b0c17c8b8d522f46b1e0db8105db8923 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:44:37 +0200 Subject: [PATCH 167/374] bitwarden --- playbooks/test_replace.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/playbooks/test_replace.yml b/playbooks/test_replace.yml index c7b726c..cc7db9f 100644 --- a/playbooks/test_replace.yml +++ b/playbooks/test_replace.yml @@ -19,4 +19,11 @@ msg: "var is {{ app_path }}" - name: Set ruleset command: nvram set vts_rulelist={{ app_path }} - when: inventory_hostname in groups['router'] \ No newline at end of file + when: inventory_hostname in groups['router'] + + - name: Commit ruleset + command: nvram commit + when: inventory_hostname in groups['router'] + - name: Commit ruleset + command: service restart_firewall + when: inventory_hostname in groups['router'] From 4c6618de34511b8a9b8d845689db5830d404c56d Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 00:51:49 +0200 Subject: [PATCH 168/374] bitwarden --- playbooks/reconfigure_router.yml | 29 +++++++++++++++++++++++++++++ playbooks/sync_all.yaml | 4 +++- playbooks/sync_container_data.yaml | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 playbooks/reconfigure_router.yml diff --git a/playbooks/reconfigure_router.yml b/playbooks/reconfigure_router.yml new file mode 100644 index 0000000..cc7db9f --- /dev/null +++ b/playbooks/reconfigure_router.yml @@ -0,0 +1,29 @@ +- hosts: router + name: Switch destination + ignore_unreachable: false + tasks: + - name: Get ruleset + command: nvram get vts_rulelist + when: inventory_hostname in groups['router'] + register: ruleset + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ ruleset.stdout }}" + - name: initialize variables + set_fact: + regexp: "\\g<1>{{ DESTINATION }}\\3" + - set_fact: + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ app_path }}" + - name: Set ruleset + command: nvram set vts_rulelist={{ app_path }} + when: inventory_hostname in groups['router'] + + - name: Commit ruleset + command: nvram commit + when: inventory_hostname in groups['router'] + - name: Commit ruleset + command: service restart_firewall + when: inventory_hostname in groups['router'] diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index d895947..82b677f 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -22,9 +22,10 @@ - mail.sectorq.eu - pw.sectorq.eu - semaphore.sectorq.eu + - kestra.sectorq.eu when: inventory_hostname in groups['raspberrypi5'] - name: Get relevant configs - ansible.builtin.shell: 'egrep -l "# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' + ansible.builtin.shell: 'egrep -l "# kestra.sectorq.eu|# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' ignore_errors: yes become: yes register: result @@ -51,6 +52,7 @@ - Portainer - Roundcube - Authentik + - Kestra when: inventory_hostname in groups['raspberrypi5'] - name: Changing heimdall background ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index ecca0e7..7909973 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -3,7 +3,7 @@ become: true when: inventory_hostname in groups['raspberrypi5'] - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{authentik,mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{kestra,authentik,mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] \ No newline at end of file From 89ab1d84463982213a55096c0ac93840b84ef405 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 01:05:41 +0200 Subject: [PATCH 169/374] bitwarden --- playbooks/switch_destination.yaml | 86 +++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 playbooks/switch_destination.yaml diff --git a/playbooks/switch_destination.yaml b/playbooks/switch_destination.yaml new file mode 100644 index 0000000..22ac520 --- /dev/null +++ b/playbooks/switch_destination.yaml @@ -0,0 +1,86 @@ +- hosts: containers + name: Switch mailu to second + + ignore_unreachable: false + vars: + arch_name: docker_mailu2_data + containers: + - nginx-app-1 + - heimdall + - mailu2-admin-1 + - mailu2-antispam-1 + - mailu2-antivirus-1 + - mailu2-fetchmail-1 + - mailu2-front-1 + - mailu2-imap-1 + - mailu2-oletools-1 + - mailu2-redis-1 + - mailu2-resolver-1 + - mailu2-smtp-1 + - mailu2-webdav-1 + - mailu2-webmail-1 + - HomeAssistant + - mosquitto-mosquitto-1 + - gitlab + - watchtower-watchtower-1 + - kestra-kestra-1 + - kestra-postgres-1 + tasks: + - name: Start mailu containers + command: "docker start {{ containers | join(' ') }}" + become: true + ignore_errors: true + when: inventory_hostname in groups['raspberrypi5'] + + - name: Get ruleset + command: nvram get vts_rulelist + when: inventory_hostname in groups['router'] + register: ruleset + + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ ruleset.stdout }}" + when: inventory_hostname in groups['router'] + + + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ destination }}" + when: inventory_hostname in groups['router'] + + - name: initialize variables + set_fact: + regexp: "\\g<1>{{ destination }}\\3" + when: inventory_hostname in groups['router'] + + - set_fact: + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" + when: inventory_hostname in groups['router'] + + + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ app_path }}" + when: inventory_hostname in groups['router'] + + + - name: Pause for 60 seconds + ansible.builtin.pause: + seconds: 60 + + - name: Set new ruleset + command: nvram set vts_rulelist="{{ app_path }}" + when: inventory_hostname in groups['router'] + + - name: Nvram commit + command: nvram commit + when: inventory_hostname in groups['router'] + + - name: Restart firewall + command: service restart_firewall + when: inventory_hostname in groups['router'] + + + + + \ No newline at end of file From 92c2c58dff68f034c5ef54dfdc404e1758755a89 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 01:07:25 +0200 Subject: [PATCH 170/374] bitwarden --- playbooks/switch_destination.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playbooks/switch_destination.yaml b/playbooks/switch_destination.yaml index 22ac520..445ff03 100644 --- a/playbooks/switch_destination.yaml +++ b/playbooks/switch_destination.yaml @@ -25,6 +25,10 @@ - watchtower-watchtower-1 - kestra-kestra-1 - kestra-postgres-1 + - authentik-worker-1 + - authentik-server-1 + - authentik-redis-1 + - authentik-postgresql-1 tasks: - name: Start mailu containers command: "docker start {{ containers | join(' ') }}" From 1085f494aea2149ed433bf1c3cc585d787e3a46d Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 01:12:06 +0200 Subject: [PATCH 171/374] bitwarden --- playbooks/sync_all.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 82b677f..b9a18a4 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -23,6 +23,7 @@ - pw.sectorq.eu - semaphore.sectorq.eu - kestra.sectorq.eu + - auth.sectorq.eu when: inventory_hostname in groups['raspberrypi5'] - name: Get relevant configs ansible.builtin.shell: 'egrep -l "# kestra.sectorq.eu|# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' From a8bd71d2c94aa877dc2ae495f24c5988aa0b38a6 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 01:14:36 +0200 Subject: [PATCH 172/374] bitwarden --- playbooks/switch_destination copy.yaml | 90 ++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 playbooks/switch_destination copy.yaml diff --git a/playbooks/switch_destination copy.yaml b/playbooks/switch_destination copy.yaml new file mode 100644 index 0000000..445ff03 --- /dev/null +++ b/playbooks/switch_destination copy.yaml @@ -0,0 +1,90 @@ +- hosts: containers + name: Switch mailu to second + + ignore_unreachable: false + vars: + arch_name: docker_mailu2_data + containers: + - nginx-app-1 + - heimdall + - mailu2-admin-1 + - mailu2-antispam-1 + - mailu2-antivirus-1 + - mailu2-fetchmail-1 + - mailu2-front-1 + - mailu2-imap-1 + - mailu2-oletools-1 + - mailu2-redis-1 + - mailu2-resolver-1 + - mailu2-smtp-1 + - mailu2-webdav-1 + - mailu2-webmail-1 + - HomeAssistant + - mosquitto-mosquitto-1 + - gitlab + - watchtower-watchtower-1 + - kestra-kestra-1 + - kestra-postgres-1 + - authentik-worker-1 + - authentik-server-1 + - authentik-redis-1 + - authentik-postgresql-1 + tasks: + - name: Start mailu containers + command: "docker start {{ containers | join(' ') }}" + become: true + ignore_errors: true + when: inventory_hostname in groups['raspberrypi5'] + + - name: Get ruleset + command: nvram get vts_rulelist + when: inventory_hostname in groups['router'] + register: ruleset + + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ ruleset.stdout }}" + when: inventory_hostname in groups['router'] + + + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ destination }}" + when: inventory_hostname in groups['router'] + + - name: initialize variables + set_fact: + regexp: "\\g<1>{{ destination }}\\3" + when: inventory_hostname in groups['router'] + + - set_fact: + app_path: "{{ ruleset.stdout | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) | regex_replace('(\\[0-9,]{1,}\\>)([0-9.]{1,})(\\>[0-9a-zA-Z\\s-]{0,}\\>TCP\\>)', regexp) }}" + when: inventory_hostname in groups['router'] + + + - name: Print the gateway for each host when defined + ansible.builtin.debug: + msg: "var is {{ app_path }}" + when: inventory_hostname in groups['router'] + + + - name: Pause for 60 seconds + ansible.builtin.pause: + seconds: 60 + + - name: Set new ruleset + command: nvram set vts_rulelist="{{ app_path }}" + when: inventory_hostname in groups['router'] + + - name: Nvram commit + command: nvram commit + when: inventory_hostname in groups['router'] + + - name: Restart firewall + command: service restart_firewall + when: inventory_hostname in groups['router'] + + + + + \ No newline at end of file From 9ff1d5a14e5471bfb36f8350337ec7dfac0e1da5 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Jun 2024 01:24:05 +0200 Subject: [PATCH 173/374] bitwarden --- playbooks/stop_containers.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index ba9b93a..831b719 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -1,5 +1,5 @@ --- - name: Stop mailu containers - command: "docker stop gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1" + command: "docker stop kestra-kestra-1 kestra-postgres-1 authentik-postgresql-1 authentik-worker-1 authentik-server-1 authentik-redis-1 gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1" become: true ignore_errors: true \ No newline at end of file From 59c13bb689aa792e9316b9088123556b496f7f2d Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 4 Jun 2024 00:52:33 +0200 Subject: [PATCH 174/374] bitwarden --- playbooks/build_tasmota_v2.yml | 13 +++++++++++++ playbooks/start_containers.yaml | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index 0d38565..7344d5d 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -10,6 +10,19 @@ cmd: 'git fetch https://github.com/arendst/Tasmota.git {{ BRANCH }}' chdir: /share/docker_data/docker-tasmota/Tasmota when: inventory_hostname in groups['nas'] + - name: Build tasmota + ansible.builtin.shell: + cmd: 'git checkout --force {{ BRANCH }}' + chdir: /share/docker_data/docker-tasmota/Tasmota + when: inventory_hostname in groups['nas'] + + - name: Build tasmota + ansible.builtin.shell: + cmd: 'git pull' + chdir: /share/docker_data/docker-tasmota/Tasmota + when: inventory_hostname in groups['nas'] + + - name: Copy platformio_override ansible.builtin.shell: diff --git a/playbooks/start_containers.yaml b/playbooks/start_containers.yaml index e843b01..c0b5e19 100644 --- a/playbooks/start_containers.yaml +++ b/playbooks/start_containers.yaml @@ -1,5 +1,5 @@ --- -- name: Start mailu containers - command: "docker start gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1" +- name: Stop mailu containers + command: "docker start kestra-kestra-1 kestra-postgres-1 authentik-postgresql-1 authentik-worker-1 authentik-server-1 authentik-redis-1 gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1" become: true ignore_errors: true \ No newline at end of file From 73abfaa6f1d98195dd748f3a9ab4f24467be0c48 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 4 Jun 2024 00:54:11 +0200 Subject: [PATCH 175/374] bitwarden --- playbooks/build_tasmota_v2.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/build_tasmota_v2.yml b/playbooks/build_tasmota_v2.yml index 7344d5d..4d02fab 100644 --- a/playbooks/build_tasmota_v2.yml +++ b/playbooks/build_tasmota_v2.yml @@ -5,18 +5,18 @@ # DOCKER_IMAGE: docker-tasmota # FWS: tasmota tasks: - - name: Build tasmota + - name: Fetch tasmota ansible.builtin.shell: cmd: 'git fetch https://github.com/arendst/Tasmota.git {{ BRANCH }}' chdir: /share/docker_data/docker-tasmota/Tasmota when: inventory_hostname in groups['nas'] - - name: Build tasmota + - name: Checkout tasmota branch ansible.builtin.shell: cmd: 'git checkout --force {{ BRANCH }}' chdir: /share/docker_data/docker-tasmota/Tasmota when: inventory_hostname in groups['nas'] - - name: Build tasmota + - name: Pull tasmota ansible.builtin.shell: cmd: 'git pull' chdir: /share/docker_data/docker-tasmota/Tasmota From 34278b2748066d46828f49678e587378fb5b9ba1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 22:23:49 +0200 Subject: [PATCH 176/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 1167 +++++++++++++++++++++ playbooks/files/services/mqtt_srv.service | 15 + playbooks/install_mqtt_srv.yml | 13 + 3 files changed, 1195 insertions(+) create mode 100644 playbooks/files/scripts/mqtt_srv.py create mode 100644 playbooks/files/services/mqtt_srv.service create mode 100644 playbooks/install_mqtt_srv.yml diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py new file mode 100644 index 0000000..a430b0a --- /dev/null +++ b/playbooks/files/scripts/mqtt_srv.py @@ -0,0 +1,1167 @@ +#!/usr/bin/env python3 + +from asyncio.log import logger +import paho.mqtt.client as mqtt +from getmac import get_mac_address +import platform +import socket +import re +import subprocess +import os +import json +import sys +import time +import json +import datetime +import ctypes +import getopt +import random +import requests +#import psutil +stats = {} +VERSION = "1.0.23" +curos = platform.system() +host = platform.node().lower() +print(host) +if curos == "Windows": + import winreg +def uptime(): + + try: + f = open( "/proc/uptime" ) + contents = f.read().split() + f.close() + except: + return "Cannot open uptime file: /proc/uptime" + + total_seconds = float(contents[0]) + + # Helper vars: + MINUTE = 60 + HOUR = MINUTE * 60 + DAY = HOUR * 24 + + # Get the days, hours, etc: + days = int( total_seconds / DAY ) + hours = int( ( total_seconds % DAY ) / HOUR ) + minutes = int( ( total_seconds % HOUR ) / MINUTE ) + seconds = int( total_seconds % MINUTE ) + + # Build up the pretty string (like this: "N days, N hours, N minutes, N seconds") + string = "" + # if days > 0: + # string += str(days) + " " + (days == 1 and "d" or "d" ) + ", " + # if len(string) > 0 or hours > 0: + # string += str(hours) + " " + (hours == 1 and "h" or "h" ) + ", " + # if len(string) > 0 or minutes > 0: + # string += str(minutes) + " " + (minutes == 1 and "m" or "m" ) + ", " + if days > 0: + string += str(days) + " " + (days == 1 and "d" or "d" ) + ", " + if len(string) > 0 or hours > 0: + string += str(hours) + ":" + if len(string) > 0 or minutes > 0: + string += str(minutes) + ":" + string += str(seconds) + + return string; + +def writeLog(msg, svr="INFO"): + ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + if curos == "Windows": + log_path = "c:\Program Files\jaydee\jaydee.log" + else: + log_path = "/tmp/mqtt_srv.log" + f = open(log_path, "a") + f.write(ts + " | " + svr + " | " + str(msg) + "\n") + f.close() + +def check_router(): + stats["uptime"] = uptime() + stats["version"] = VERSION + cmnd = "crontab -l" + status, output = subprocess.getstatusoutput(cmnd) + + if "#Skynet_banmalware#" in output: + stats["skynet"] = "on" + else: + stats["skynet"] = "off" + if "#Diversion_CountAds#" in output: + stats["diversion"] = "on" + else: + stats["diversion"] = "off" + + + cmnd = "nvram get vpn_client1_state" + status, output = subprocess.getstatusoutput(cmnd) + writeLog("Openvpn1 Status : " + str(output)) + stats["vpnclient1"] = output + cmnd = "nvram get vpn_client2_state" + status, output = subprocess.getstatusoutput(cmnd) + writeLog("Openvpn2 Status : " + str(output)) + stats["vpnclient2"] = output + cmnd = "ncat -z 192.168.77.106 25" + status, output = subprocess.getstatusoutput(cmnd) + if status == 0: + stats["mail_nas"] = "available" + else: + stats["mail_nas"] = "unavailable" + cmnd = "ncat -z 192.168.77.246 25" + status, output = subprocess.getstatusoutput(cmnd) + if status == 0: + stats["mail_rasp"] = "available" + else: + stats["mail_rasp"] = "unavailable" + cmnd = "nvram get vts_rulelist" + status, output = subprocess.getstatusoutput(cmnd) + rule_data = output.split("<") + serv_d = {} + for l in rule_data: + rul = l.split(">") + if len(rul) > 3: + if rul[0] == "HTTPS": + serv_d[rul[0]] = {"src_port":rul[1],"dest_ip":rul[2],"dest_port":rul[3],"prot":rul[4]} + stats["serv_dest"] = rul[2] + break + #stats["serv_dest"] = json.dumps(serv_d) + #stats["serv_dest"] = json.dumps(serv_d) + #out = subprocess.Popen(cmnd.split()) + #status, output = subprocess.getstatusoutput(cmnd) + + + ''' + + + print("Getting fw info") + cmnd = "/root/router_cmd.sh -t firewall -n TOSHIBA-WIFI -m get" + #out = subprocess.Popen(cmnd.split()) + status, output = subprocess.getstatusoutput(cmnd) + print(output) + stats["fw"] = output + #client.publish("sectorq/systems/router/fw", payload=str(output), qos=0, retain=True) + print("Getting wifi info") + cmnd = "/root/router_cmd.sh -t wireless -m get" + #out = subprocess.Popen(cmnd.split()) + status, output = subprocess.getstatusoutput(cmnd) + print(output) + if output != 'allow': + output = 'off' + stats["macfilter"] = output + # if output == "allow":\ + writeLog("Payload : " + str(json.dumps(stats))) + ''' + client.publish("home-assistant/router/hwstats", json.dumps(stats), qos=0, retain=True) + #client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=True) + #else: + # client.publish("sectorq/systems/router/macfilter", payload=0, qos=0, retain=True) + +if host != "router" and host != "nas": + import psutil + + processes = list(p.name() for p in psutil.process_iter()) + # print(processes) + count = processes.count("mqtt_srv.exe") + if int(count) >= 3: + writeLog("script exist") + sys.exit() +else: + cmnd = "ps |grep mqtt_srv.py|grep -v grep |wc -l" + status, output = subprocess.getstatusoutput(cmnd) + count = output + if int(count) >= 2: + writeLog("script exist") + sys.exit() +# Stops duplicate instance from running + +writeLog(count) + +writeLog("Starting : " + str(VERSION)) +writeLog("Getting running proccesses", "DEBUG") + + +writeLog("done", "DEBUG") + +FILE_TIMESTAMP = os.path.getmtime(sys.argv[0]) +def get_sys_env(name): + key = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, r"System\CurrentControlSet\Control\Session Manager\Environment") + return winreg.QueryValueEx(key, name)[0] + +def get_user_env(name): + key = winreg.CreateKey(winreg.HKEY_CURRENT_USER, r"Environment") + return winreg.QueryValueEx(key, name)[0] + + +_PUBLISH = _SETVAR = False +try: + opts, args = getopt.getopt(sys.argv[1:], "Sspmt:", ["command=", "help", "output="]) +except getopt.GetoptError as err: + # print help information and exit: + print(str(err)) # will print something like "option -a not recognized" + #usage() + sys.exit(2) +output = None +# QJ : getopts + +for o, a in opts: + if o == "-d": + _ACTION = True + elif o in ("-p", "--publish"): + _PUBLISH = True + elif o in ("-m", "--publish"): + _MESSAGE = a + elif o in ("-t", "--publish"): + _TOPIC = a + elif o in ("-S", "--setvar"): + _SETVAR = True + _THR_NAME = sys.argv[2] + _THR_VAL = sys.argv[3] + else: + _WIZZARD = True +MQTT_HOST = "192.168.77.106" +MQTT_PORT = 1883 + +if _PUBLISH: + # generate client ID with pub prefix randomly + #client_id = f'python-mqtt-{random.randint(0, 1000)}' + client_id = 'python-mqtt-1004' + username = 'jaydee' + password = 'jaydee1' + + def connect_mqtt(): + def on_connect(client, userdata, flags, rc): + if rc == 0: + print("Connected to MQTT Broker!") + else: + print("Failed to connect, return code %d\n", rc) + + client = mqtt.Client(client_id) + client.username_pw_set(username, password) + client.on_connect = on_connect + client.connect(MQTT_HOST, MQTT_PORT) + return client + + + def publish(client): + result = client.publish(_TOPIC, _MESSAGE) + # result: [0, 1] + status = result[0] + if status == 0: + print(f"Send `{_MESSAGE}` to topic `{_TOPIC}`") + else: + print(f"Failed to send message to topic {_TOPIC}") + + client = connect_mqtt() + publish(client) + sys.exit() + +if _SETVAR: + #myCmd = "setx " + _THR_NAME + " " + _THR_VAL + " -m" + myCmd = "setx " + _THR_NAME + " " + _THR_VAL + subprocess.Popen(myCmd.split(), shell=True) + sys.exit() + +from ping3 import ping, verbose_ping + + + + +''' +curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py +python get-pip.py +pip3 install getmac +pip3 install paho.mqttdasdas +""" + +''' + +writeLog("Starting daemon in versin : " + VERSION) + +VERS = '1.3' +''' +print("pinging") +lala = ping(MQTT_HOST) + +connected = 0 +while connected == 0: + if type(lala) == float: + print("Oleee connected") + writeLog("Mqtt connected", "INFO") + connected = 1 + else: + print("blaaah not connected, waiting...(5)") + writeLog("blaaah not connected, waiting...(5)") + time.sleep(5) + lala = ping(MQTT_HOST) +''' + +# Function to display hostname and +# IP address +def get_ip(): + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + try: + # doesn't even have to be reachable + s.connect(('192.168.77.1', 1)) + IP = s.getsockname()[0] + except ValueError: + IP = '127.0.0.1' + finally: + s.close() + return IP + + +IP = get_ip() + + +print("OS : " + curos) +writeLog("OS : " + curos) +if curos != "Windows": + import autorandr +else: + import winreg + + +if host == "raspberrypi": + mac = str(get_mac_address("eth0")) +elif host == "SERVER": + mac = str(get_mac_address("enp2s0")) +elif host == "ASUS" and curos != "Windows": + mac = str(get_mac_address("enp3s0f1")) +else: + mac = str(get_mac_address("Ethernet")) + + +print("MAC : " + mac) +writeLog("MAC : " + mac) +print("SYSTEM : " + host) +writeLog("SYSTEM : " + host) +print("IP : " + IP) +writeLog("IP : " + IP) + +flag_connected = 0 +# The callback for when the client receives a CONNACK response from the server. +def on_connect(client, userdata, flags, rc): + print("Connected with result code " + str(rc)) + writeLog("Connected with result code " + str(rc)) + global flag_connected + flag_connected = 1 + # Subscribing in on_connect() means that if we lose the connection and + # reconnect then subscriptions will be renewed. + topic = "sectorq/systems/" + host.lower() + print(topic) + writeLog(topic) + time.sleep(1) + client.publish("sectorq/status", payload="{'action':'connect', 'system':'" + host.lower() + "', 'ip': '" + IP + "', 'mac':'" + mac + "', 'ver':'" + VERS + "'}", qos=0, retain=False) + client.publish("sectorq/systems/" + host.lower() + "/stat", payload="on", qos=0, retain=True) + if host.lower() == "router": + check_router() + + if host.lower() == "nas": + print("Getting VM info") + + cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh list --all" + print(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + l = 1 + lines = output.splitlines() + VMS = {} + for i in lines: + l = l + 1 + if l < 4: + continue + line = re.split(r" {2,}", i) + print(str(line[0].strip()) + " " + str(line[1].strip()) + " " + str(line[2].strip())) + VMS[str(line[1].strip())] = str(line[2].strip()) + + + + for m in VMS: + + cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + m + #out = subprocess.Popen(cmnd.split()) + print(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + print(output) + if output.strip() == "running": + client.publish("sectorq/systems/nas/" + m, payload=1, qos=0, retain=True) + else: + client.publish("sectorq/systems/nas/" + m, payload=0, qos=0, retain=True) + + + client.subscribe(topic) + +def on_disconnect(client, userdata, rc): + print("disconnecting reason " +str(rc)) + writeLog("disconnecting reason " +str(rc)) + client.connected_flag=False + client.disconnect_flag=True + global flag_connected + flag_connected = 0 + + +# The callback for when a PUBLISH message is received from the server. +def on_message(client, userdata, msg): + print(msg.topic) + print(msg.payload) + myObj = msg.payload.decode('utf-8') + # command = re.sub(r"^b\'|\'$", "", str(msg.payload)) + # command = json.loads(msg.payload.decode("utf-8")) + try: + myObj = json.loads(msg.payload) + try: + writeLog(myObj["action"]) + print(myObj["action"]) + except: + print("Action not set") + writeLog("Action not set", "WARNING") + + try: + print(myObj["cmd"]) + writeLog(myObj["cmd"]) + except: + print("Cmd not set") + writeLog("Cmd not set", "WARNING") + + try: + print(myObj["target"]) + writeLog(myObj["target"]) + except: + print("Target Not Set") + writeLog("Target Not Set", "WARNING") + try: + print(myObj["status"]) + writeLog(myObj["status"]) + except: + print("Status Not Set") + writeLog("Status Not Set") + + try: + print(myObj["command"]) + writeLog(myObj["command"]) + except: + print("Command Not Set") + writeLog("Command Not Set") + + try: + print(myObj["cmd_line"]) + writeLog(myObj["cmd_line"]) + except: + print("Cmd_line Not Set") + writeLog("Cmd_line Not Set") + + + if myObj["cmd"] == "command": + + print("Executing " + myObj["cmd_line"]) + writeLog("Executing " + myObj["cmd_line"]) + #os.system('start /b "' + myObj["cmd_line"] + '"') + try: + subprocess.Popen(myObj["cmd_line"].split(), shell=True) + #subprocess.Popen(myObj["cmd_line"].split()) + # ctypes.windll.user32.MessageBoxW(0, myObj["cmd_line"], "Executed", 64) + except: + ctypes.windll.user32.MessageBoxW(0, "Your text", "Your title", 16) + print("Executed " + myObj["cmd_line"]) + writeLog("Executed " + myObj["cmd_line"]) + + if myObj["cmd"] == "nas_cmd": + print("Executing NAS") + cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + str(myObj["target"]) + print(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + print(output) + cmd_type = myObj["command"] + if myObj["command"] == "start": + if output.strip() == "paused": + print("System suspended") + cmd_type = "resume" + else: + print("System Off") + cmd_type = "start" + if myObj["command"] == "suspend": + cmd_type = "shutdown" + + + cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh " + cmd_type + " " + str(myObj["target"]) + subprocess.Popen(cmnd.split()) + print(cmnd) + if myObj["command"] == "start": + try: + print("sending") + client.publish("sectorq/systems/nas/" + str(myObj["target"]), payload=1, qos=0, retain=False) + except: + print("failed to execute!") + client.publish("sectorq/systems/nas/" + str(myObj["target"]), payload="failed", qos=0, retain=False) + else: + try: + print("sending") + client.publish("sectorq/systems/nas/" + str(myObj["target"]), payload=0, qos=0, retain=False) + except: + print("failed to execute!") + client.publish("sectorq/systems/nas/" + str(myObj["target"]), payload="failed", qos=0, retain=False) + + + if myObj["cmd"] == "distrib": + print("distributin313g") + # os.startfile(sys.argv[0]) + #sys.exit() + subprocess.Popen(['/bin/systemctl', 'restart', 'mqtt']) + + if myObj["cmd"] == "uci": + print("uci1") + print("Executing " + myObj["cmd_line"]) + writeLog("Executing " + myObj["cmd_line"]) + + if myObj["cmd_line"] == "wireless1": + cmnd = "/root/router_cmd.sh -t wireless -v 1 -m set" + try: + subprocess.Popen(cmnd.split()) + print("sending") + stats["macfilter"] = "allow" + client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=False) + writeLog("Payload : " + json.dumps(stats)) + except: + print("failed to execute!") + client.publish("sectorq/systems/router/stats", payload="failed", qos=0, retain=False) + + elif myObj["cmd_line"] == "wireless0": + cmnd = "/root/router_cmd.sh -t wireless -v 0 -m set" + try: + subprocess.Popen(cmnd.split()) + print("sending") + stats["macfilter"] = "off" + client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=False) + writeLog("Payload : " + json.dumps(stats)) + except: + print("failed to execute!") + client.publish("sectorq/systems/router/stats", payload="failed", qos=0, retain=False) + elif myObj["cmd_line"] == "fw0": + cmnd = "/root/router_cmd.sh -t firewall -n TOSHIBA-WIFI -p enabled -v 0 -m set" + try: + subprocess.Popen(cmnd.split()) + print("sending") + stats["fw"] = 0 + client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=False) + writeLog("Payload : " + json.dumps(stats)) + except: + print("failed to execute!") + client.publish("sectorq/systems/router/stats", payload="failed", qos=0, retain=False) + elif myObj["cmd_line"] == "fw1": + cmnd = "/root/router_cmd.sh -t firewall -n TOSHIBA-WIFI -p enabled -v 1 -m set" + try: + #subprocess.Popen(myObj["cmd_line"].split(), shell=True) + subprocess.Popen(cmnd.split()) + # ctypes.windll.user32.MessageBoxW(0, myObj["cmd_line"], "Executed", 64) + print("sending") + stats["fw"] = 1 + client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=False) + writeLog("Payload : " + json.dumps(stats)) + except: + print("failed to execute!") + client.publish("sectorq/systems/router/stats", payload="failed", qos=0, retain=False) + elif myObj["cmd_line"] == "openvpn": + cmnd = "service {}".format(myObj["target"]) + print(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + + elif myObj["cmd_line"] == "serv_dest": + writeLog("Payload111111 : " + myObj["target"].lower()) + + cmnd = "nvram get vts_rulelist" + status, output = subprocess.getstatusoutput(cmnd) + rule_data = output.split("<") + serv_d = {} + writeLog("Payload111112") + for l in rule_data: + rul = l.split(">") + if len(rul) > 3: + serv_d[rul[0]] = {"src_port":rul[1],"dest_ip":rul[2],"dest_port":rul[3],"prot":rul[4]} + stats["serv_dest"] = rul[2] + writeLog("Payload111113") + rules = {"HTTPS":{"dest_ip":"192.168.77.106","src_port":443,"dest_port":443,"prot":"TCP"}, + "HTTP":{"dest_ip":"192.168.77.106","src_port":80,"dest_port":80,"prot":"TCP"}, + "EMAIL_25":{"dest_ip":"192.168.77.106","src_port":25,"dest_port":25,"prot":"TCP"}, + "EMAIL_465":{"dest_ip":"192.168.77.106","src_port":465,"dest_port":465,"prot":"TCP"}, + "EMAIL_993":{"dest_ip":"192.168.77.106","src_port":993,"dest_port":993,"prot":"TCP"}, + "EMAIL_995":{"dest_ip":"192.168.77.106","src_port":995,"dest_port":995,"prot":"TCP"}, + "EMAIL_587":{"dest_ip":"192.168.77.106","src_port":587,"dest_port":587,"prot":"TCP"}, + "EMAIL_143":{"dest_ip":"192.168.77.106","src_port":143,"dest_port":143,"prot":"TCP"}} + writeLog("Payload1111135") + print(json.dumps(serv_d)) + for r in rules: + print(r) + try: + serv_d[r]["dest_ip"] = myObj["target"] + except: + serv_d[r] = rules[r] + + lala = [] + for sr in serv_d: + lala.append("{}>{}>{}>{}>{}>".format(sr,serv_d[sr]["src_port"],serv_d[sr]["dest_ip"],serv_d[sr]["dest_port"],serv_d[sr]["prot"])) + la = "<".join(lala) + la = "<{}".format(la) + print(la) + cmnd = "nvram set vts_rulelist=\"{}\"".format(la) + print(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + cmnd = "nvram commit" + status, output = subprocess.getstatusoutput(cmnd) + cmnd = "service restart_firewall" + status, output = subprocess.getstatusoutput(cmnd) + writeLog("Payload111114") + writeLog(output) + print(json.dumps(serv_d)) + ''' + if myObj["target"].lower() == "192.168.77.246": + dest_ip = "192.168.77.246" + elif myObj["target"].lower() == "192.168.77.106": + dest_ip = "192.168.77.106" + + + + + RULES = ["EMAIL993", "EMAIL995", "EMAIL143", "EMAIL25", "EMAIL993", "EMAIL465", "HTTPS", "HTTP"] + for i in RULES: + cmnd = "uci set firewall.{}.dest_ip={}".format(i,dest_ip) + writeLog(cmnd) + subprocess.Popen(cmnd.split()) + + #cmnd = "uci set dhcp.@dnsmasq[0].address=/mqtt_broker/" + dest_ip + #writeLog(cmnd) + #subprocess.Popen(cmnd.split()) + time.sleep(1) + cmnd = "uci commit" + + subprocess.Popen(cmnd.split()) + + writeLog("Starting " + myObj["target"].lower()) + if myObj["target"].lower() == "192.168.77.246": + dest_ip = "192.168.77.246" + + + cmnd = "ssh root@192.168.77.246 'docker start mailu_resolver_1 mailu_redis_1 mailu_front_1 mailu_antispam_1 mailu_imap_1 mailu_admin_1 mailu_smtp_1 mailu_webmail_1 watchtower_watchtower_1 nginx-proxy-manager_db_1 nginx-proxy-manager_app_1 HomeAssistant webhub_client_1 dockermon_docker_mon_1 mosquitto_mosquitto_1 node-red_node-red_1 nextcloud_db_1 nextcloud_app_1'" + status, output = subprocess.getstatusoutput(cmnd) + elif myObj["target"].lower() == "192.168.77.106": + dest_ip = "192.168.77.106" + cmnd = "ssh root@192.168.77.246 'docker stop mailu_resolver_1 mailu_redis_1 mailu_front_1 mailu_antispam_1 mailu_imap_1 mailu_admin_1 mailu_smtp_1 mailu_webmail_1 watchtower_watchtower_1 nginx-proxy-manager_db_1 nginx-proxy-manager_app_1 HomeAssistant webhub_client_1 dockermon_docker_mon_1 mosquitto_mosquitto_1 node-red_node-red_1 nextcloud_db_1 nextcloud_app_1'" + status, output = subprocess.getstatusoutput(cmnd) + time.sleep(1) + cmnd = "/etc/init.d/firewall restart" + subprocess.Popen(cmnd.split()) + #cmnd = "/etc/init.d/dnsmasq restart" + #subprocess.Popen(cmnd.split()) + writeLog("reconfigure iot") + MQTT_BROKER = dest_ip + MQTT_USER = "jaydee" + MQTT_PASS = "jaydee1" + + cmnd = "nmap -sP 192.168.77.*|grep \"Nmap scan report\"|egrep -o \"[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\"" + #print(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + + # print(output) + + ips = output.splitlines() + tasm_data = {} + for sys_ip in ips: + # print("Thsis is ip : " + sys_ip) + cmnd = "nmap " + sys_ip + " -p80|grep \"80/tcp open http\"" + status, output = subprocess.getstatusoutput(cmnd) + # print("status of 80 : " + str(status)) + if status == 0: + try: + # url = "http://" + sys_ip + "/cm?user=admin&password=l4c1j4yd33Du5l0&cmnd=STATUS+5" + + url = "http://" + sys_ip + "/cm?cmnd=Backlog%20MqttHost%20" + MQTT_BROKER + "%3BMqttUser%20" + MQTT_USER + "%3BMqttPassword%20" + MQTT_PASS + print(url) + requests.get(url) + + except: + #print(sys_ip + " : Not a tasmota!") + pass + else: + #print(sys_ip + " : Not a listening") + pass + + + + time.sleep(1) + cmnd = "sed -i 's/^MQTT_HOST = .*/MQTT_HOST = \"" + dest_ip + "\"/' /root/mqtt_srv.py" + writeLog(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + #for i in ;do uci set firewall.${i}.dest_ip=192.168.77.246;done;uci set firewall.HTTPS.dest_port='443';uci set firewall.HTTP.dest_port='80' ;uci commit;/etc/init.d/firewall restart + else: + pass + #cmnd = "/root/router_cmd.sh -t wireless -v 0" + + + print("Executed " + cmnd) + writeLog("Executed " + cmnd) + ''' + + + if myObj["cmd"] == "banip": + if myObj["status"] == "ban": + cmnd = "echo " + str(myObj["target"]) + " >> /etc/banip/banip.blacklist; /etc/init.d/banip refresh" + elif myObj["status"] == "enable": + cmnd = "/etc/init.d/banip resume" + stats["banip"] = "enabled" + elif myObj["status"] == "disable": + cmnd = "/etc/init.d/banip suspend" + stats["banip"] = "paused" + writeLog(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + + client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=True) + + if myObj["cmd"] == "vnc": + print(myObj["target"]) + writeLog(myObj["target"]) + + # os.startfile(sys.argv[0]) + #sys.exit() + myCmd = 'c:\\Program Files\\RealVNC\\VNC Viewer\\vncviewer.exe C:\\Users\\jaydee\\' + myObj["target"].upper() + '.vnc' + print(myCmd) + writeLog(myCmd) + subprocess.Popen(myCmd.split()) + if myObj["cmd"] == "getstats": + print("lalaa1") + try: + client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":" + get_user_env('mb_temp') + ",\"mem_usage\":" + get_user_env('mem_usage') + ",\"cpu_temp\":" + get_user_env('cpu_temp') + ",\"cpu_usage\":" + get_user_env('cpu_usage') + ",\"gpu_temp\":" + get_user_env('gpu_temp') + ",\"gpu_usage\":" + get_user_env('gpu_usage') + "}", qos=0, retain=False) + print("ok") + except: + print("failed") + client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False) + + print("lalaa2") + + if myObj["cmd"] == "display": + if curos == "Windows1": + # os.startfile(sys.argv[0]) + #sys.exit() + #print("reconfigure") + myCmd = 'MonitorSwitcher.exe -load:' + myObj["target"] + '.xml' + writeLog(myCmd) + #writeLog(os.path.realpath(__file__)) + print("lalaa2") + #subprocess.Popen(r'"{}"'.format(myCmd), shell=True) + print("lalaa3") + subprocess.Popen(myCmd.split(), shell=True,cwd=r'c:\Progra~1\jaydee') + else: + ''' + myCmd = "" + if myObj["target"] == "mid": + myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --off --output HDMI-1 --off --output eDP-1 --off" + elif myObj["target"] == "all": + myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --auto --above HDMI-2 --mode 1920x1080 --output HDMI-1 --auto --left-of HDMI-2 --mode 1920x1080 --output eDP-1 --auto --right-of HDMI-2 --mode 1920x1080" + elif myObj["target"] == "midleft": + myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --off --output HDMI-1 --auto --left-of HDMI-2 --mode 1920x1080 --output eDP-1 --off" + elif myObj["target"] == "midtop": + myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --auto --above HDMI-2 --mode 1920x1080 --output HDMI-1 --off --output eDP-1 --off" + elif myObj["target"] == "midleftbuild": + myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --off --output HDMI-1 --auto --left-of HDMI-2 --mode 1920x1080 --output eDP-1 --auto --right-of HDMI-2 --mode 1920x1080" + elif myObj["target"] == "midbuild": + myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --off --output HDMI-1 --off --output eDP-1 --auto --right-of HDMI-2 --mode 1920x1080" + elif myObj["target"] == "midlefttop": + myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --auto --above HDMI-2 --mode 1920x1080 --output HDMI-1 --auto --left-of HDMI-2 --mode 1920x1080 --output eDP-1 --off" + else: + pass + + if myCmd != "": + print(myCmd) + subprocess.Popen(myCmd.split()) + ''' + myCmd = "" + writeLog(myObj["target"]) + if curos == "Windows": + + myCmd = "DisplayFusionCommand.exe -monitorloadprofile {}".format(myObj["target"]) + + else: + ''' + mon1 = "HDMI-1-1" + mon2 = "HDMI-1-2" + mon3 = "DVI-I-2-1" + mon4 = "eDP-1-1" + ''' + mon1 = "HDMI-1" + mon2 = "HDMI-2" + mon3 = "DVI-I-1-1" + mon4 = "eDP-1" + writeLog(mon3) + if myObj["target"] == "mid": + myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " +mon1 + " --off --output " + mon4 + " --off" + elif myObj["target"] == "left": + myCmd = "xrandr --output " + mon1 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " +mon2 + " --off --output " + mon4 + " --off" + + elif myObj["target"] == "all": + myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --auto --right-of " + mon2 + " --mode 1920x1080 --output " + mon1 + " --auto --left-of " + mon2 + " --mode 1920x1080 --output " + mon4 + " --auto --right-of " + mon2 + " --mode 1920x1080" + elif myObj["target"] == "midleft": + myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " + mon1 + " --auto --left-of " + mon2 + " --mode 1920x1080 --output " + mon4 + " --off" + elif myObj["target"] == "midtop": + myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --auto --right-of " + mon2 + " --mode 1920x1080 --output " + mon1 + " --off --output " + mon4 + " --off" + elif myObj["target"] == "midleftbuild": + myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " + mon1 + " --auto --left-of " + mon2 + " --mode 1920x1080 --output " + mon4 + " --auto --right-of " + mon2 + " --mode 1920x1080" + elif myObj["target"] == "midbuild": + myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " + mon1 + " --off --output " + mon4 + " --auto --right-of " + mon2 + " --mode 1920x1080" + elif myObj["target"] == "midlefttop": + myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --auto --right-of " + mon2 + " --mode 1920x1080 --output " + mon1 + " --auto --left-of " + mon2 + " --mode 1920x1080 --output " + mon4 + " --off" + elif myObj["target"] == "build": + myCmd = "xrandr --output " + mon2 + " --off --output " + mon3 + " --off --output " + mon1 + " --off --output " + mon4 + " --auto --mode 1920x1080" + else: + pass + + writeLog(myCmd) + if myCmd != "": + print(myCmd) + writeLog("Executing") + #subprocess.Popen(myCmd.split()) + status, output = subprocess.getstatusoutput(myCmd) + writeLog(output) + writeLog(status) + if myObj["cmd"] == "display2": + # os.startfile(sys.argv[0]) + #sys.exit() + #print("reconfigure") + subprocess.Popen(['MultiMonitorTool.exe', '/SaveConfig', 'c:\\Program Files\\jaydee\\switcher.cfg']) + myCmd = "powershell switcher.ps1 " + str(myObj["target"]) + " " + str(myObj["status"]) + writeLog(myCmd) + subprocess.Popen(myCmd.split()) + time.sleep(1) + subprocess.Popen(['MultiMonitorTool.exe', '/LoadConfig', 'c:\\Program Files\\jaydee\\switcher.cfg']) + client.publish("sectorq/feedback", payload='{"action":"resp", "source":"ASUS", "dev":{"display' + str(myObj["target"]) + '":'+ str(myObj["status"]) +'} }' , qos=0, retain=False) + if myObj["cmd"] == "displ": + print("Display") + # os.startfile(sys.argv[0]) + #sys.exit() + subprocess.Popen(['/usr/bin/xrandr', '--output', 'HDMI-1-1', '--off']) + + if myObj["cmd"] == "xrandr": + if curos == "Windows": + subprocess.Popen(['MultiMonitorTool.exe', '/LoadConfig', 'c:\\Program Files\\jaydee\\all_on.cfg']) + else: + print("Display") + # os.startfile(sys.argv[0]) + #sys.exit() + os.system("export DISPLAY=:0") + subprocess.Popen(['/usr/bin/xrandr']) + + if myObj["cmd"] == "suspend": + print("suspending") + if curos == "Windows": + if host == "amd" or host == "amd1": + os.system("shutdown /s /t 1") + else: + os.system("rundll32.exe powrprof.dll,SetSuspendState 0,1,0") + #cmnd = "psshutdown -d -t 1" + writeLog(cmnd) + #status, output = subprocess.getstatusoutput(cmnd) + #subprocess.Popen(["psshutdown", "-d", "-t", "1"]) + #writeLog(output) + else: + if host == "nas" or host == "octopi": + subprocess.Popen(["/sbin/poweroff"]) + elif host == "openmediavault" or host == "omv": + subprocess.Popen(["poweroff"]) + else: + #subprocess.Popen(["/bin/systemctl", "suspend", "-i"]) + #subprocess.Popen(["sudo", "pm-suspend"]) + cmnd = "pm-suspend" + status, output = subprocess.getstatusoutput(cmnd) + print(output) + print(status) + if myObj["cmd"] == "stats": + grep = subprocess.Popen(['grep', 'cpu', '/proc/stat'], + stdout=subprocess.PIPE, + ) + + awk = subprocess.Popen(['awk', '{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}'], + stdin=grep.stdout, + stdout=subprocess.PIPE, + ) + + # cat <(grep 'cpu ' /proc/stat) <(sleep 1 && grep 'cpu ' /proc/stat) | awk -v RS="" '{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}' + + end_of_pipe = awk.stdout + + for line in end_of_pipe: + # print(line.strip()) + # usage = re.sub(r"^b\'|\'$", "", (line.strip())) + cpu = round(float(line.strip().decode("utf-8"))) + free = subprocess.Popen(['free'], + stdout=subprocess.PIPE, + ) + + grep = subprocess.Popen(['grep', 'Mem'], + stdout=subprocess.PIPE, + stdin=free.stdout, + ) + + awk = subprocess.Popen(['awk', '{print $3/$2 * 100.0}'], + stdin=grep.stdout, + stdout=subprocess.PIPE, + ) + + end_of_pipe = awk.stdout + + for line in end_of_pipe: + # print(line.strip()) + # mem = re.sub(r"^b\'|\'$", "", (line.strip())) + mem = round(float(line.strip().decode("utf-8"))) + # mem = re.sub(r"^b\'|\'$", "", mem) + # cpu = re.sub(r"^b\'|\'$", "", cpu) + # print(mem) + jn = {"cpu": cpu, "mem": mem} + jn = json.dumps(jn) + client.publish("sectorq/status/" + host, payload=jn, qos=0, retain=False) + except: + print("not a json!") + +client = mqtt.Client() +payload = "off" +client.username_pw_set("jaydee", password="jaydee1") +client.will_set("sectorq/systems/" + host.lower() + "/stat", payload=payload, qos=0, retain=True) +client.on_connect = on_connect +client.on_message = on_message +writeLog(MQTT_HOST) +client.connect(MQTT_HOST, MQTT_PORT, 25) + +# client.publish("sectorq/status", payload="{'action':'connect', 'system':'" + host + "', 'ip': '" + IP + "', 'mac':'" + mac + "', 'ver':'?'}", qos=0, retain=False) + + +# Blocking call that processes network traffic, dispatches callbacks and +# handles reconnecting. +# Other loop*() functions are available that give a threaded interface and a +# manual interface. + +def checkIfProcessRunning(processName): + ''' + Check if there is any running process that contains the given name processName. + ''' + #Iterate over the all the running process + for proc in psutil.process_iter(): + try: + # Check if process name contains the given name string. + if processName.lower() in proc.name().lower(): + return True + except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): + pass + return False; + + + +if curos == "Windows": + print("WINDOWS") + #client.loop_forever() + client.loop_start() + NEXT_CHECK = 0 + while True: + print("Version: {}".format(VERSION)) + time.sleep(5) + try: + mtime = os.path.getmtime(sys.argv[0]) + except OSError: + mtime = 0 + print(mtime) + if NEXT_CHECK < int(time.time()): + NEXT_CHECK = int(time.time()) + 10 + writeLog("Blalala : Next : " + str(NEXT_CHECK)) + if curos == "Windows": + if checkIfProcessRunning("aida64.exe"): + aide_refs = { + 'TPCHDIO':"MB_TEMP", + 'TCPU':'CPU_TEMP', + 'SMEMUTI': 'MEM_UTIL', + 'SVIRTMEMUTI': 'VMEM_UTIL', + 'SCPUUTI': 'CPU_UTIL', + 'FCPU': 'FAN_CPU', + 'TGPU1DIO': 'GPU_TEMP', + 'SGPU1BIUTI': 'GPU_UTIL', + 'TMOBO':'MB_TEMP' + } + #ks = ["TCPU", "TPCHDIO", "SMEMUTI", "SVIRTMEMUTI", "SCPUUTI", "FCPU", "TGPU1DIO", "SGPU1BIUTI"] + + + + + path = winreg.HKEY_CURRENT_USER + try: + key = winreg.OpenKeyEx(path, r"SOFTWARE\\FinalWire\\AIDA64\\SensorValues") + results = {} + for k in aide_refs: + k2 = "Value." + str(k) + try: + value = winreg.QueryValueEx(key,k2) + print("{} : {}".format(k, value[0])) + results[aide_refs[k]] = value[0] + except: + pass + except: + print("aida initializing...") + results = {"status":"init"} + + + else: + print("CPU Cnt : {}".format(psutil.cpu_count())) + print(psutil.virtual_memory()) + cpu_usage = psutil.cpu_percent(interval=None) + swap_data = psutil.swap_memory() + print("CPU : {}".format(cpu_usage)) + mem_data = psutil.virtual_memory() + print(mem_data) + print(swap_data) + print("MEM : {}".format(mem_data.percent)) + print(psutil.getloadavg()) + try: + print(psutil.sensors_temperatures()) + except: + pass + try: + print(psutil.sensors_fans()) + except: + pass + results = {"status":"on","version":VERSION,"MB_TEMP":"NA", "MEM_UTIL":str(mem_data.percent), "CPU_TEMP":"NA", "FAN_CPU":"NA", "VMEM_UTIL":swap_data.percent, "CPU_UTIL":cpu_usage, "GPU_TEMP":"NA", "GPU_UTIL":"NA"} + print(json.dumps(results)) + r = json.dumps(results) + #client.publish("home-assistant/" + host + "/hwstats", payload='{"TPCHDIO":"' + str(results["TPCHDIO"]) + '", "SMEMUTI":"' + str(results["SMEMUTI"]) + '", "TCPU":"' + str(results["TCPU"]) + '", "TGPU1DIO":"' + str(results["TGPU1DIO"]) + '", "SGPU1BIUTI":"' + str(results["SGPU1BIUTI"]) + '", "FCPU":"' + str(results["FCPU"]) + '", "SVIRTMEMUTI":"' + str(results["SVIRTMEMUTI"]) + '", "SCPUUTI":"' + str(results["SCPUUTI"]) + '"}', qos=0, retain=False) + client.publish("home-assistant/" + host + "/hwstats", payload=r, qos=0, retain=False) + client.publish("sectorq/systems/" + host.lower() + "/stat", payload="on", qos=0, retain=True) + #print(json.dumps(stats)) + #writeLog(json.dumps(stats)) +else: + print("Linux") + client.loop_start() + + NEXT_CHECK = 0 + while True: + print(VERSION) + time.sleep(5) + try: + mtime = os.path.getmtime(sys.argv[0]) + except OSError: + mtime = 0 + print(mtime) + if NEXT_CHECK < int(time.time()): + NEXT_CHECK = int(time.time()) + 20 + writeLog("Blalala : Next : " + str(NEXT_CHECK)) + + if host.lower() == "asus": + print(psutil.sensors_temperatures()) + #print(psutil.sensors_fans()) + sences = psutil.sensors_temperatures() + cpu_data = sences["coretemp"][0] + mb_data = sences["acpitz"][0] + fan_data = psutil.sensors_fans()["asus"][0] + mem_data = psutil.virtual_memory() + swap_data = psutil.swap_memory() + #cpu_usage = psutil.cpu_percent(interval=1) + load1, load5, load15 = psutil.getloadavg() + cpu_usage = round((load1/os.cpu_count()) * 100, 1) + + print(mem_data) + print(mem_data.percent) + print(psutil.disk_usage('/')) + #print(psutil.virtual_memory()) + #print(dict(psutil.virtual_memory()._asdict())) + #cmnd = "sensors -j|grep -v \"Can't read\"" + #status, output = subprocess.getstatusoutput(cmnd) + #print(output) + #print(type(output)) + #jn1 = json.loads(output) + + #print(str(jn1["coretemp-isa-0000"]["Package id 0"]["temp1_input"])) + #print(str(jn1["asus-isa-0000"]["cpu_fan"]["fan1_input"])) + #client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False) + client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on", "version":"' + VERSION + '","MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":' + str(fan_data.current) + ', "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) + client.publish("sectorq/systems/" + host.lower() + "/stat", payload="on", qos=0, retain=True) + elif host.lower() == "openmediavault" or host.lower() == "omv": + #print(psutil.sensors_temperatures()) + #print(psutil.sensors_fans()) + sences = psutil.sensors_temperatures() + #print(sences) + cpu_data = sences["coretemp"][0] + mb_data = sences["acpitz"][0] + mem_data = psutil.virtual_memory() + swap_data = psutil.swap_memory() + #cpu_usage = psutil.cpu_percent(interval=1) + load1, load5, load15 = psutil.getloadavg() + cpu_usage = round((load1/os.cpu_count()) * 100, 1) + print(psutil.getloadavg()) + print("CPU Util : {}".format(cpu_usage)) + print(mem_data) + print(mem_data.percent) + raid_data = psutil.disk_usage('/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee') + #print(psutil.virtual_memory()) + #print(dict(psutil.virtual_memory()._asdict())) + #cmnd = "sensors -j|grep -v \"Can't read\"" + #status, output = subprocess.getstatusoutput(cmnd) + #print(output) + #print(type(output)) + #jn1 = json.loads(output) + stat_rsync = subprocess.call(["systemctl", "is-active", "--quiet", "rsync"]) + if(stat_rsync == 0): # if 0 (active), print "Active" + stat_rsync = "on" + else: + stat_rsync = "off" + #sdiskusage = psutil.disk_partitions() + disk_usage = raid_data[3] + print(disk_usage) + sys_uptime = str(datetime.timedelta(seconds=round(time.time() - psutil.boot_time(), 0))) + reboot_pending = False + if os.path.exists("/var/run/reboot-required"): + reboot_pending = True + #str(datetime.timedelta(seconds=666)) + #print(str(jn1["coretemp-isa-0000"]["Package id 0"]["temp1_input"])) + #print(str(jn1["asus-isa-0000"]["cpu_fan"]["fan1_input"])) + #client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False) + client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on","version":"' + VERSION + '","reboot":"' + str(reboot_pending) + '", "uptime":"' + str(sys_uptime) + '", "raid_usage": ' + str(disk_usage) + ',"rsync":"' + str(stat_rsync) +'", "MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":0, "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) + elif host.lower() == "router": + check_router() + elif host.lower() == "nas": + print("Getting VM info") + + cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh list --all" + writeLog(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + l = 1 + lines = output.splitlines() + VMS = {} + for i in lines: + l = l + 1 + if l < 4: + continue + line = re.split(r" {2,}", i) + print(str(line[0].strip()) + " " + str(line[1].strip()) + " " + str(line[2].strip())) + VMS[str(line[1].strip())] = str(line[2].strip()) + + + + for m in VMS: + + cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + m + #out = subprocess.Popen(cmnd.split()) + writeLog(cmnd) + status, output = subprocess.getstatusoutput(cmnd) + writeLog(output) + if output.strip() == "running": + client.publish("sectorq/systems/nas/" + m, payload=1, qos=0, retain=True) + else: + client.publish("sectorq/systems/nas/" + m, payload=0, qos=0, retain=True) + + + if FILE_TIMESTAMP != mtime: + writeLog("Script updated ! restarting...") + #os.execv(sys.executable, ['python'] + sys.argv) + #os.system("/share/ZFS530_DATA/.qpkg/QPython39/bin/python3 mqtt_srv.py") + + if host.lower() == "nas": + sys.stdout.flush() + os.execv("/share/ZFS530_DATA/.qpkg/QPython39/bin/python3", sys.argv) + if host.lower() == "router" or host.lower() == "omv": + #sys.stdout.flush() + #os.execv(sys.argv, "") + print("argv was",sys.argv) + print("sys.executable was", sys.executable) + print("restart now") + + os.execv(sys.executable, ['python3'] + sys.argv) + #os.startfile(sys.argv[0]) + sys.exit() diff --git a/playbooks/files/services/mqtt_srv.service b/playbooks/files/services/mqtt_srv.service new file mode 100644 index 0000000..b9f8e0a --- /dev/null +++ b/playbooks/files/services/mqtt_srv.service @@ -0,0 +1,15 @@ +[Unit] +Description=ROT13 demo service +Wants=network-online.target +After=network.target network-online.target + +[Service] +Type=simple +User=root +Environment=XAUTHORITY=/home/jd/.Xauthority +Environment=DISPLAY=:0 +#ExecStartPre=/bin/sleep 30 +ExecStart=/usr/bin/mqtt_srv + +[Install] +WantedBy=multi-user.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml new file mode 100644 index 0000000..7af0fe9 --- /dev/null +++ b/playbooks/install_mqtt_srv.yml @@ -0,0 +1,13 @@ +- hosts: datacenter + name: Install mqtt_srv + ignore_unreachable: false + tasks: + - name: Upload service config + ansible.builtin.copy: + src: services/mqtt_srv.service + dest: /etc/systemd/system/ + + - name: Upload service script + ansible.builtin.copy: + src: scripts/mqtt_srv.py + dest: /usr/bin/ From 5837981384333a01e2d95dc94b2f419ddeb74c5f Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 22:29:12 +0200 Subject: [PATCH 177/374] bitwarden --- playbooks/install_mqtt_srv.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 7af0fe9..255db9d 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -1,6 +1,7 @@ - hosts: datacenter name: Install mqtt_srv ignore_unreachable: false + become: True tasks: - name: Upload service config ansible.builtin.copy: From 58a14539d8ae7ea5203d7005dedb2eaf4aaf3ef0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 22:31:52 +0200 Subject: [PATCH 178/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 255db9d..1bce5d6 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -12,3 +12,5 @@ ansible.builtin.copy: src: scripts/mqtt_srv.py dest: /usr/bin/ + mode: '755' + owner: root \ No newline at end of file From b58e41a31faca33cae2300d077c203edef1797ad Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 22:34:41 +0200 Subject: [PATCH 179/374] bitwarden --- playbooks/files/services/mqtt_srv.service | 2 +- playbooks/install_mqtt_srv.yml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/playbooks/files/services/mqtt_srv.service b/playbooks/files/services/mqtt_srv.service index b9f8e0a..0a24a74 100644 --- a/playbooks/files/services/mqtt_srv.service +++ b/playbooks/files/services/mqtt_srv.service @@ -9,7 +9,7 @@ User=root Environment=XAUTHORITY=/home/jd/.Xauthority Environment=DISPLAY=:0 #ExecStartPre=/bin/sleep 30 -ExecStart=/usr/bin/mqtt_srv +ExecStart=python3 /usr/bin/mqtt_srv.py [Install] WantedBy=multi-user.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 1bce5d6..bccb201 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -13,4 +13,10 @@ src: scripts/mqtt_srv.py dest: /usr/bin/ mode: '755' - owner: root \ No newline at end of file + owner: root + - name: Install bottle python package + ansible.builtin.pip: + name: + - paho-mqtt + - getmac + - ping3 \ No newline at end of file From b17548226c4ba192310e8c408255d56fe01cca09 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 22:52:55 +0200 Subject: [PATCH 180/374] bitwarden --- playbooks/install_mqtt_srv.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index bccb201..20f0b42 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -19,4 +19,5 @@ name: - paho-mqtt - getmac - - ping3 \ No newline at end of file + - ping3 + - psutil \ No newline at end of file From d8bd9bc98f2d83f6b9bf7bbdab7a50fda78b048a Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 22:55:26 +0200 Subject: [PATCH 181/374] bitwarden --- playbooks/install_mqtt_srv.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 20f0b42..17b00a3 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -20,4 +20,5 @@ - paho-mqtt - getmac - ping3 - - psutil \ No newline at end of file + - psutil + - autorandr \ No newline at end of file From ec3f4fc309793f70224659f339600ac5dc7192a9 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 23:05:03 +0200 Subject: [PATCH 182/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index a430b0a..3b76384 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -2,6 +2,11 @@ from asyncio.log import logger import paho.mqtt.client as mqtt +try: + client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1) +except: + client = mqtt.Client() + from getmac import get_mac_address import platform import socket From 4956f7d28bb3c681fb6c5103810b1ba4ad9f16f3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 23:21:58 +0200 Subject: [PATCH 183/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index 3b76384..8dee2fa 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -1,10 +1,11 @@ #!/usr/bin/env python3 from asyncio.log import logger +import paho.mqtt import paho.mqtt.client as mqtt -try: +if paho.mqtt.__version__[0] > '1': client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1) -except: +else: client = mqtt.Client() from getmac import get_mac_address From 524faaf09ac38044a90a42cccdf3996047a99fd6 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 23:24:50 +0200 Subject: [PATCH 184/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index 8dee2fa..6479a1c 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -2,11 +2,11 @@ from asyncio.log import logger import paho.mqtt -import paho.mqtt.client as mqtt +import paho.mqtt.client as mqttClient if paho.mqtt.__version__[0] > '1': - client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1) + client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) else: - client = mqtt.Client() + client = mqttClient.Client() from getmac import get_mac_address import platform @@ -239,7 +239,7 @@ if _PUBLISH: else: print("Failed to connect, return code %d\n", rc) - client = mqtt.Client(client_id) + client = mqttClient.Client(client_id) client.username_pw_set(username, password) client.on_connect = on_connect client.connect(MQTT_HOST, MQTT_PORT) From 99f052e8b1f3a5614a2c7f2d397f797d76224667 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 23:32:48 +0200 Subject: [PATCH 185/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index 6479a1c..eab29ea 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -238,8 +238,11 @@ if _PUBLISH: print("Connected to MQTT Broker!") else: print("Failed to connect, return code %d\n", rc) + if paho.mqtt.__version__[0] > '1': + client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) + else: + client = mqttClient.Client(client_id) - client = mqttClient.Client(client_id) client.username_pw_set(username, password) client.on_connect = on_connect client.connect(MQTT_HOST, MQTT_PORT) From 5eb1eae04f09302e18d8a426e87480fe1c0ebb2e Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 23:34:18 +0200 Subject: [PATCH 186/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index eab29ea..d126652 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -924,7 +924,10 @@ def on_message(client, userdata, msg): except: print("not a json!") -client = mqtt.Client() +try: + client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) +except: + client = mqttClient.Client() payload = "off" client.username_pw_set("jaydee", password="jaydee1") client.will_set("sectorq/systems/" + host.lower() + "/stat", payload=payload, qos=0, retain=True) From 25e8a4c92b0df7207e0d95fc74652119789d109d Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 23:37:48 +0200 Subject: [PATCH 187/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 133 +++++++++++++++++----------- 1 file changed, 83 insertions(+), 50 deletions(-) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index d126652..114dfb7 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -7,7 +7,6 @@ if paho.mqtt.__version__[0] > '1': client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) else: client = mqttClient.Client() - from getmac import get_mac_address import platform import socket @@ -25,7 +24,7 @@ import random import requests #import psutil stats = {} -VERSION = "1.0.23" +VERSION = "1.0.26" curos = platform.system() host = platform.node().lower() print(host) @@ -84,27 +83,32 @@ def writeLog(msg, svr="INFO"): def check_router(): stats["uptime"] = uptime() stats["version"] = VERSION + stats["status"] = "on" cmnd = "crontab -l" status, output = subprocess.getstatusoutput(cmnd) if "#Skynet_banmalware#" in output: - stats["skynet"] = "on" + stats["skynet"] = "On" else: - stats["skynet"] = "off" + stats["skynet"] = "Off" if "#Diversion_CountAds#" in output: - stats["diversion"] = "on" + stats["diversion"] = "On" else: - stats["diversion"] = "off" + stats["diversion"] = "Off" cmnd = "nvram get vpn_client1_state" status, output = subprocess.getstatusoutput(cmnd) - writeLog("Openvpn1 Status : " + str(output)) - stats["vpnclient1"] = output + writeLog("VpnClient1 Status : " + str(output)) + stats["vpnclient1"] = "On" if output == "2" else "Off" cmnd = "nvram get vpn_client2_state" status, output = subprocess.getstatusoutput(cmnd) - writeLog("Openvpn2 Status : " + str(output)) - stats["vpnclient2"] = output + writeLog("VpnClient2 Status : " + str(output)) + stats["vpnclient2"] = "On" if output == "2" else "Off" + cmnd = "nvram get vpn_server1_state" + status, output = subprocess.getstatusoutput(cmnd) + writeLog("VpnServer1 Status : " + str(output)) + stats["vpnserver1"] = "On" if output == "2" else "Off" cmnd = "ncat -z 192.168.77.106 25" status, output = subprocess.getstatusoutput(cmnd) if status == 0: @@ -238,11 +242,11 @@ if _PUBLISH: print("Connected to MQTT Broker!") else: print("Failed to connect, return code %d\n", rc) + if paho.mqtt.__version__[0] > '1': client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) else: - client = mqttClient.Client(client_id) - + client = mqttClient.Client() client.username_pw_set(username, password) client.on_connect = on_connect client.connect(MQTT_HOST, MQTT_PORT) @@ -334,6 +338,8 @@ elif host == "SERVER": mac = str(get_mac_address("enp2s0")) elif host == "ASUS" and curos != "Windows": mac = str(get_mac_address("enp3s0f1")) +elif host == "morefine" and curos != "Windows": + mac = str(get_mac_address("eno1")) else: mac = str(get_mac_address("Ethernet")) @@ -366,7 +372,7 @@ def on_connect(client, userdata, flags, rc): if host.lower() == "nas": print("Getting VM info") - cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh list --all" + cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh list --all" print(cmnd) status, output = subprocess.getstatusoutput(cmnd) l = 1 @@ -384,7 +390,7 @@ def on_connect(client, userdata, flags, rc): for m in VMS: - cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + m + cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + m #out = subprocess.Popen(cmnd.split()) print(cmnd) status, output = subprocess.getstatusoutput(cmnd) @@ -473,7 +479,8 @@ def on_message(client, userdata, msg): if myObj["cmd"] == "nas_cmd": print("Executing NAS") - cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + str(myObj["target"]) + #cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + str(myObj["target"]) + cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + str(myObj["target"]) print(cmnd) status, output = subprocess.getstatusoutput(cmnd) print(output) @@ -489,7 +496,7 @@ def on_message(client, userdata, msg): cmd_type = "shutdown" - cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh " + cmd_type + " " + str(myObj["target"]) + cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh " + cmd_type + " " + str(myObj["target"]) subprocess.Popen(cmnd.split()) print(cmnd) if myObj["command"] == "start": @@ -791,37 +798,38 @@ def on_message(client, userdata, msg): mon3 = "DVI-I-2-1" mon4 = "eDP-1-1" ''' - mon1 = "HDMI-1" - mon2 = "HDMI-2" - mon3 = "DVI-I-1-1" - mon4 = "eDP-1" - writeLog(mon3) - if myObj["target"] == "mid": - myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " +mon1 + " --off --output " + mon4 + " --off" - elif myObj["target"] == "left": - myCmd = "xrandr --output " + mon1 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " +mon2 + " --off --output " + mon4 + " --off" + right = ["HDMI-A-0", "1920x1080"] + tleft = ["HDMI-A-0", "1920x1080"] + tright = ["DVI-I-1-1", "1920x1080"] + left = ["DisplayPort-0", "2560x1440"] + mid = ["DisplayPort-1", "3440x1440"] - elif myObj["target"] == "all": - myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --auto --right-of " + mon2 + " --mode 1920x1080 --output " + mon1 + " --auto --left-of " + mon2 + " --mode 1920x1080 --output " + mon4 + " --auto --right-of " + mon2 + " --mode 1920x1080" + #xrandr --output DisplayPort-1 --primary --auto --mode 3440x1440 --output HDMI-A-0 --auto --left-of DVI-I-1-1 --mode 1920x1080 --output DisplayPort-0 --auto --left-of DisplayPort-1 --mode 2560x1440 --output DVI-I-1-1 --above DisplayPort-1 --mode 1920x1080 + if myObj["target"] == "mid": + myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --output {left[0]} --off --output {tleft[0]} --off --output {tright[0]} --off" + elif myObj["target"] == "left": + myCmd = f"xrandr --output {left[0]} --primary --auto --mode {left[1]} --output {mid[0]} --off --output {tleft[0]} --off --output {tright[0]} --off" + elif myObj["target"] == "all": + myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --pos 0x0 --output {tleft[0]} --auto --pos -1920x-1080 --mode {tleft[1]} --output {left[0]} --auto --left-of {mid[0]} --mode {left[1]} --output {tright[0]} --above {mid[0]} --mode {tright[1]}" + #myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --output {right[0]} --auto --right-of {mid[0]} --mode {right[1]} --output {left[0]} --auto --left-of {mid[0]} --mode {left[1]}" elif myObj["target"] == "midleft": - myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " + mon1 + " --auto --left-of " + mon2 + " --mode 1920x1080 --output " + mon4 + " --off" + myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --output {tleft[0]} --off --output {left[0]} --auto --left-of {mid[0]} --mode {left[1]} --output {tright[0]} --off" elif myObj["target"] == "midtop": - myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --auto --right-of " + mon2 + " --mode 1920x1080 --output " + mon1 + " --off --output " + mon4 + " --off" - elif myObj["target"] == "midleftbuild": - myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " + mon1 + " --auto --left-of " + mon2 + " --mode 1920x1080 --output " + mon4 + " --auto --right-of " + mon2 + " --mode 1920x1080" - elif myObj["target"] == "midbuild": - myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --off --output " + mon1 + " --off --output " + mon4 + " --auto --right-of " + mon2 + " --mode 1920x1080" - elif myObj["target"] == "midlefttop": - myCmd = "xrandr --output " + mon2 + " --primary --auto --mode 1920x1080 --output " + mon3 + " --auto --right-of " + mon2 + " --mode 1920x1080 --output " + mon1 + " --auto --left-of " + mon2 + " --mode 1920x1080 --output " + mon4 + " --off" - elif myObj["target"] == "build": - myCmd = "xrandr --output " + mon2 + " --off --output " + mon3 + " --off --output " + mon1 + " --off --output " + mon4 + " --auto --mode 1920x1080" + myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --output {tright[0]} --auto --above {mid[0]} --mode {tright[1]} --output {left[0]} --off --output {tleft[0]} --off" + elif myObj["target"] == "midlefttleft": + myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --pos 0x0 --output {tright[0]} --off --output {left[0]} --auto --left-of {mid[0]} --mode {left[1]} --output {tleft[0]} --auto --pos -1920x-1080 --mode {tleft[1]}" + elif myObj["target"] == "lefttlefttright": + myCmd = f"xrandr --output {mid[0]} --off --output {tleft[0]} --auto --pos 640x-1080 --mode {tright[1]} --output {left[0]} --primary --auto --mode {left[1]} --pos 0x0 --output {tright[0]} --right-of {tleft[0]} --mode {tright[1]}" + elif myObj["target"] == "lefttleft": + myCmd = f"xrandr --output {mid[0]} --off --output {tleft[0]} --auto --pos 640x-1080 --mode {tright[1]} --output {left[0]} --primary --auto --mode {left[1]} --pos 0x0 --output {tright[0]} --off" + else: pass writeLog(myCmd) if myCmd != "": print(myCmd) - writeLog("Executing") + writeLog("Executing : {myCmd}") #subprocess.Popen(myCmd.split()) status, output = subprocess.getstatusoutput(myCmd) writeLog(output) @@ -924,13 +932,13 @@ def on_message(client, userdata, msg): except: print("not a json!") -try: +if paho.mqtt.__version__[0] > '1': client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) -except: +else: client = mqttClient.Client() -payload = "off" +payload = '{"status": "off"}' client.username_pw_set("jaydee", password="jaydee1") -client.will_set("sectorq/systems/" + host.lower() + "/stat", payload=payload, qos=0, retain=True) +client.will_set("home-assistant/" + host.lower() + "/hwstats", payload=payload, qos=0, retain=True) client.on_connect = on_connect client.on_message = on_message writeLog(MQTT_HOST) @@ -998,6 +1006,7 @@ if curos == "Windows": try: key = winreg.OpenKeyEx(path, r"SOFTWARE\\FinalWire\\AIDA64\\SensorValues") results = {} + results["status"] = "on" for k in aide_refs: k2 = "Value." + str(k) try: @@ -1022,6 +1031,7 @@ if curos == "Windows": print(swap_data) print("MEM : {}".format(mem_data.percent)) print(psutil.getloadavg()) + #lodctr /R try: print(psutil.sensors_temperatures()) except: @@ -1044,24 +1054,47 @@ else: NEXT_CHECK = 0 while True: - print(VERSION) + #print(VERSION) time.sleep(5) try: mtime = os.path.getmtime(sys.argv[0]) except OSError: mtime = 0 - print(mtime) + #print(mtime) if NEXT_CHECK < int(time.time()): NEXT_CHECK = int(time.time()) + 20 writeLog("Blalala : Next : " + str(NEXT_CHECK)) - if host.lower() == "asus": + if host.lower() == "asus" or host.lower() == "morefine": print(psutil.sensors_temperatures()) #print(psutil.sensors_fans()) sences = psutil.sensors_temperatures() - cpu_data = sences["coretemp"][0] + print("SENCES") + print(sences) + print("#"*40) + try: + cpu_data = sences["coretemp"][0] + except: + try: + cpu_data = sences["k10temp"][0] + except: + cpu_data = "None" + print("CPUDATA") + print(cpu_data) + print("#"*40) + + mb_data = sences["acpitz"][0] - fan_data = psutil.sensors_fans()["asus"][0] + print("MBDATA") + print(mb_data) + print(mb_data.current) + print("#"*40) + + + try: + fan_data = psutil.sensors_fans()["asus"][0].current + except: + fan_data = "None" mem_data = psutil.virtual_memory() swap_data = psutil.swap_memory() #cpu_usage = psutil.cpu_percent(interval=1) @@ -1082,7 +1115,7 @@ else: #print(str(jn1["coretemp-isa-0000"]["Package id 0"]["temp1_input"])) #print(str(jn1["asus-isa-0000"]["cpu_fan"]["fan1_input"])) #client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False) - client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on", "version":"' + VERSION + '","MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":' + str(fan_data.current) + ', "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) + client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on", "version":"' + VERSION + '","TCPU":"NA", "MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":"' + str(fan_data) + '", "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) client.publish("sectorq/systems/" + host.lower() + "/stat", payload="on", qos=0, retain=True) elif host.lower() == "openmediavault" or host.lower() == "omv": #print(psutil.sensors_temperatures()) @@ -1124,7 +1157,7 @@ else: #print(str(jn1["coretemp-isa-0000"]["Package id 0"]["temp1_input"])) #print(str(jn1["asus-isa-0000"]["cpu_fan"]["fan1_input"])) #client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False) - client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on","version":"' + VERSION + '","reboot":"' + str(reboot_pending) + '", "uptime":"' + str(sys_uptime) + '", "raid_usage": ' + str(disk_usage) + ',"rsync":"' + str(stat_rsync) +'", "MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":0, "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) + client.publish("home-assistant/" + host + "/hwstats", payload='{"version":"' + VERSION + '","reboot":"' + str(reboot_pending) + '", "uptime":"' + str(sys_uptime) + '", "raid_usage": ' + str(disk_usage) + ',"rsync":"' + str(stat_rsync) +'", "MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":0, "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) elif host.lower() == "router": check_router() elif host.lower() == "nas": @@ -1176,4 +1209,4 @@ else: os.execv(sys.executable, ['python3'] + sys.argv) #os.startfile(sys.argv[0]) - sys.exit() + sys.exit() \ No newline at end of file From b173c2c07a6d41ac15c77d95e080cd91140cd489 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 23:47:29 +0200 Subject: [PATCH 188/374] bitwarden --- playbooks/install_mqtt_srv.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 17b00a3..8d890e9 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -21,4 +21,11 @@ - getmac - ping3 - psutil - - autorandr \ No newline at end of file + - autorandr + - name: Just force systemd to reread configs (2.4 and above) + ansible.builtin.systemd: + daemon_reload: true + - name: Restart mqtt_srv service + ansible.builtin.service: + name: mqtt_srv.service + state: restarted \ No newline at end of file From a9e6489298fb7ae656af288e917115589436a479 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 9 Jun 2024 00:08:59 +0200 Subject: [PATCH 189/374] bitwarden --- playbooks/files/conf/router/dnsmasq.conf.add | 12 ++++++++++++ playbooks/router_setup.yml | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 playbooks/files/conf/router/dnsmasq.conf.add create mode 100644 playbooks/router_setup.yml diff --git a/playbooks/files/conf/router/dnsmasq.conf.add b/playbooks/files/conf/router/dnsmasq.conf.add new file mode 100644 index 0000000..095f756 --- /dev/null +++ b/playbooks/files/conf/router/dnsmasq.conf.add @@ -0,0 +1,12 @@ +enable-tftp +dhcp-match=set:bios,60,PXEClient:Arch:00000 +#dhcp-boot=tag:bios,undionly.kpxe,,192.168.77.108 +dhcp-boot=tag:bios,ipxe.pxe,,192.168.77.108 +dhcp-match=set:efibc,60,PXEClient:Arch:00007 +dhcp-boot=tag:efibc,ipxe.efi,,192.168.77.108 +address=/ldap-server.loc/nas.loc/192.168.77.106 +address=/mqtt.loc/mqtt.lan/192.168.77.106 +address=/lalalal.loc/192.168.77.106 + +ipset=/iplists.firehol.org/ipdeny.com/ipapi.co/api.db-ip.com/api.bgpview.io/asn.ipinfo.app/speedguide.net/otx.alienvault.com/github.com/raw.githubusercontent.com/astrill.com/strongpath.net/snbforums.com/bin.entware.net/nwsrv-ns1.asus.com/pool.ntp.org/1drv.ms/asuswrt-merlin.net/asuswrt.lostrealm.ca/big.oisd.nl/Skynet-WhitelistDomains # Skynet +ipset=/codeload.github.com/diversion.ch/entware.diversion.ch/entware.net/fwupdate.asuswrt-merlin.net/localhost.localdomain/maurerr.github.io/mirrors.bfsu.edu.cn/oisd.nl/onedrive.live.com/pgl.yoyo.org/pkg.entware.net/small.oisd.nl/someonewhocares.org/sourceforge.net/urlhaus.abuse.ch/Skynet-WhitelistDomains # Skynet diff --git a/playbooks/router_setup.yml b/playbooks/router_setup.yml new file mode 100644 index 0000000..6acdf02 --- /dev/null +++ b/playbooks/router_setup.yml @@ -0,0 +1,10 @@ +- hosts: router + name: Setup router + ignore_unreachable: false + become: True + tasks: + - name: Upload service config + ansible.builtin.copy: + src: config/dnsmasq.conf.add + dest: /jffs/configs/ + From d7b6379b854622d9db816a147554be5ee3c04e9a Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 9 Jun 2024 00:11:32 +0200 Subject: [PATCH 190/374] bitwarden --- playbooks/router_setup.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/playbooks/router_setup.yml b/playbooks/router_setup.yml index 6acdf02..0397b8a 100644 --- a/playbooks/router_setup.yml +++ b/playbooks/router_setup.yml @@ -1,7 +1,6 @@ - hosts: router name: Setup router ignore_unreachable: false - become: True tasks: - name: Upload service config ansible.builtin.copy: From 5822e160ad6035fce8d6be53d9e275ec89b68717 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 9 Jun 2024 00:12:25 +0200 Subject: [PATCH 191/374] bitwarden --- playbooks/router_setup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/router_setup.yml b/playbooks/router_setup.yml index 0397b8a..2baf7fa 100644 --- a/playbooks/router_setup.yml +++ b/playbooks/router_setup.yml @@ -4,6 +4,6 @@ tasks: - name: Upload service config ansible.builtin.copy: - src: config/dnsmasq.conf.add + src: conf/router/dnsmasq.conf.add dest: /jffs/configs/ From 35ae2cf0b63baae053f6353b1ed1203a1a8d7116 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 9 Jun 2024 00:14:25 +0200 Subject: [PATCH 192/374] bitwarden --- playbooks/router_setup.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/router_setup.yml b/playbooks/router_setup.yml index 2baf7fa..3efa28b 100644 --- a/playbooks/router_setup.yml +++ b/playbooks/router_setup.yml @@ -6,4 +6,5 @@ ansible.builtin.copy: src: conf/router/dnsmasq.conf.add dest: /jffs/configs/ - + - name: Restart dnsmasq + ansible.builtin.shell: service restart_dnsmasq From 0acc5967de91ac76b1ba2f50e4d5689fff1a2927 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 12 Jun 2024 22:18:47 +0200 Subject: [PATCH 193/374] bitwarden --- hosts.yml | 36 ++++++++++++-- playbooks/00_install_zabbix_agent.yml | 72 ++++++++++++++++++++++----- 2 files changed, 92 insertions(+), 16 deletions(-) diff --git a/hosts.yml b/hosts.yml index 69555cf..f01d613 100644 --- a/hosts.yml +++ b/hosts.yml @@ -33,6 +33,16 @@ datacenter: ansible_password: q ansible_become_user: root ansible_become_password: q + ryzen: + hosts: + 192.168.77.15: + vars: + ansible_python_interpreter: auto_silent + ansible_ssh_user: root + ansible_ssh_pass: lacijaydee + ansible_password: lacijaydee + ansible_become_user: root + ansible_become_password: lacijaydee omv: hosts: 192.168.77.189: @@ -105,7 +115,25 @@ datacenter: 192.168.77.106: vars: ansible_ssh_user: admin - ansible_ssh_pass: l4c1!j4yd33?Du5lo - ansible_user: admin - ansible_pass: l4c1!j4yd33?Du5lo - ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 \ No newline at end of file + ansible_ssh_pass: l4c1!j4yd33?Du5lo1 + become_method: su + become_user: admin + # ansible_user: admin + # ansible_pass: l4c1!j4yd33?Du5lo1 + ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 + fog: + hosts: + 192.168.77.108: + vars: + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_become_user: root + ansible_become_password: q + zabbix: + hosts: + 192.168.77.216: + vars: + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_become_user: root + ansible_become_password: q \ No newline at end of file diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index 3d1368b..0054418 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -1,7 +1,23 @@ - hosts: datacenter name: Install zabbix agent - become: true + vars: + ZABBIX_SERVER_IP: "192.168.77.216" tasks: + + - name: Combine list1 and list2 into a merged_list var + ansible.builtin.set_fact: + zabbix_agent_cfg: "/etc/zabbix/zabbix_agent2.conf" + when: inventory_hostname not in groups['nas'] + + - name: Combine list1 and list2 into a merged_list var + ansible.builtin.set_fact: + zabbix_agent_cfg: "/opt/ZabbixAgent/etc/zabbix_agentd.conf" + when: inventory_hostname in groups['nas'] + + - name: Print all available facts + ansible.builtin.debug: + msg: "{{ false if inventory_hostname not in groups['nas'] else true }}" + - name: Print all available facts ansible.builtin.debug: var: ansible_facts.architecture @@ -14,8 +30,8 @@ deb: https://repo.zabbix.com/zabbix/6.4/ubuntu-arm64/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb when: - ansible_facts.architecture != "armv7l" and ansible_distribution == "Ubuntu" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Install a .deb package from the internet ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/raspbian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb @@ -24,15 +40,20 @@ when: - ansible_facts.architecture == "armv7l" ignore_errors: true + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install a .deb package from the internet ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb + when: - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "11" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + - name: Install a .deb package from the internet ansible.builtin.apt: - deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb + #deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb + deb: https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian12_all.deb when: - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "12" @@ -47,46 +68,73 @@ - zabbix-agent2 - zabbix-agent2-plugin-* update_cache: yes + when: inventory_hostname not in groups['nas'] + + - name: Reconfigure zabbix agent Server ansible.builtin.lineinfile: - path: /etc/zabbix/zabbix_agent2.conf + path: "{{ zabbix_agent_cfg }}" regexp: "^Server=.*" insertafter: '^# Server=' - line: "Server=192.168.77.106" + line: "Server=192.168.77.0/24" + become: "{{ false if inventory_hostname in groups['nas'] else true }}" - name: Reconfigure zabbix agent ServerActive ansible.builtin.lineinfile: - path: /etc/zabbix/zabbix_agent2.conf + path: "{{ zabbix_agent_cfg }}" regexp: "^ServerActive=.*" - line: "ServerActive=192.168.77.106" + line: "ServerActive={{ ZABBIX_SERVER_IP }}" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + - name: Reconfigure zabbix agent ListenPort ansible.builtin.lineinfile: - path: /etc/zabbix/zabbix_agent2.conf + path: "{{ zabbix_agent_cfg }}" regexp: "^ListenPort=.*" line: "ListenPort=10050" # - name: Reconfigure zabbix agent ListenIP # ansible.builtin.lineinfile: - # path: /etc/zabbix/zabbix_agent2.conf + # path: /"{{ zabbix_agent_cfg }}" # regexp: "^ListenIP=.*" # line: "ListenIP=0.0.0.0" - name: Reconfigure zabbix-agent2 hostname ansible.builtin.lineinfile: - path: /etc/zabbix/zabbix_agent2.conf + path: "{{ zabbix_agent_cfg }}" regexp: "^Hostname=.*" line: "Hostname={{ansible_hostname}}" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + - name: Reconfigure zabbix-agent2 hostname ansible.builtin.lineinfile: - path: /etc/zabbix/zabbix_agent2.conf + path: "{{ zabbix_agent_cfg }}" regexp: "^UserParameter=.*" insertafter: '^# UserParameter=' line: "UserParameter=system.temperature,vcgencmd measure_temp" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Reconfigure zabbix-agent2 hostname + ansible.builtin.lineinfile: + path: "{{ zabbix_agent_cfg }}" + regexp: "^HostMetadata=.*" + insertafter: '^# HostMetadata=' + line: "HostMetadata=linux;jaydee" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + - name: Add the user 'james' with a bash shell, appending the group 'admins' and 'developers' to the user's groups ansible.builtin.user: name: zabbix groups: video append: yes + when: inventory_hostname not in groups['nas'] + + - name: Restart zabbix-agent2 service ansible.builtin.service: name: zabbix-agent2.service state: restarted - enabled: true \ No newline at end of file + enabled: true + become: true + when: inventory_hostname not in groups['nas'] + + - name: Restart agent + ansible.builtin.shell: /etc/init.d/ZabbixAgent.sh restart + when: inventory_hostname in groups['nas'] \ No newline at end of file From 4d19b05594578b33d7406f80294a97ecefe32c99 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 12 Jun 2024 22:28:53 +0200 Subject: [PATCH 194/374] bitwarden --- playbooks/00_install_zabbix_server.yml | 115 ++++++++++++++++++++ playbooks/00_install_zabbix_server_cert.yml | 16 +++ playbooks/setup_fog_nfs.yml | 48 ++++++++ 3 files changed, 179 insertions(+) create mode 100644 playbooks/00_install_zabbix_server.yml create mode 100644 playbooks/00_install_zabbix_server_cert.yml create mode 100644 playbooks/setup_fog_nfs.yml diff --git a/playbooks/00_install_zabbix_server.yml b/playbooks/00_install_zabbix_server.yml new file mode 100644 index 0000000..d943da7 --- /dev/null +++ b/playbooks/00_install_zabbix_server.yml @@ -0,0 +1,115 @@ +- hosts: datacenter + name: Install zabbix agent + become: true + vars: + ZABBIX_SERVER_IP: "192.168.77.216" + ZABBIX_DB_PASSWORD: "zabbix" + tasks: + - name: Print all available facts + ansible.builtin.debug: + var: ansible_facts.architecture + # - name: Upload zabbix package + # ansible.builtin.copy: + # src: packages/zabbix-release_6.4-1+ubuntu22.04_all.deb + # dest: /tmp/ + + - name: Install a .deb package from the internet + ansible.builtin.apt: + #deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb + deb: https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian12_all.deb + when: + - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "12" + + + + # - name: Install a .deb package localy + # ansible.builtin.apt: + # deb: /tmp/zabbix-release_6.4-1+ubuntu22.04_all.deb + - name: Install zabbix packages + ansible.builtin.apt: + name: + - zabbix-agent2 + - zabbix-agent2-plugin-* + - zabbix-server-pgsql + - zabbix-frontend-php + - php8.2-pgsql + - zabbix-nginx-conf + - zabbix-sql-scripts + - postgresql + - postgresql-client + update_cache: yes + + - name: Apt exclude linux-dtb-current-meson64 + ansible.builtin.shell: echo "CREATE USER zabbix password 'zabbix';" | su -c /usr/bin/psql postgres + - name: Apt exclude linux-dtb-current-meson64 + ansible.builtin.shell: sudo -u postgres createdb -O zabbix zabbix + - name: Apt exclude linux-dtb-current-meson64 + ansible.builtin.shell: zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix + + - name: Reconfigure zabbix agent Server + ansible.builtin.lineinfile: + path: /etc/zabbix/zabbix_server.conf + regexp: "^DBPassword=.*" + insertafter: '^# DBPassword=' + line: "DBPassword={{ ZABBIX_DB_PASSWORD }}" + - name: Reconfigure zabbix agent Server + ansible.builtin.lineinfile: + path: /etc/nginx/conf.d/zabbix.conf + regexp: "^# listen.*" + line: " listen 8080;" + - name: Reconfigure zabbix agent Server + ansible.builtin.lineinfile: + path: /etc/nginx/conf.d/zabbix.conf + regexp: "^# server_name.*" + line: " server_name zabbix.sectorq.eu;" + + + - name: Reconfigure zabbix agent Server + ansible.builtin.lineinfile: + path: /etc/zabbix/zabbix_agent2.conf + regexp: "^Server=.*" + insertafter: '^# Server=' + line: "Server=192.168.77.0/24" + + - name: Reconfigure zabbix agent ServerActive + ansible.builtin.lineinfile: + path: /etc/zabbix/zabbix_agent2.conf + regexp: "^ServerActive=.*" + line: "ServerActive={{ ZABBIX_SERVER_IP }}" + - name: Reconfigure zabbix agent ListenPort + ansible.builtin.lineinfile: + path: /etc/zabbix/zabbix_agent2.conf + regexp: "^ListenPort=.*" + line: "ListenPort=10050" + # - name: Reconfigure zabbix agent ListenIP + # ansible.builtin.lineinfile: + # path: /etc/zabbix/zabbix_agent2.conf + # regexp: "^ListenIP=.*" + # line: "ListenIP=0.0.0.0" + - name: Reconfigure zabbix-agent2 hostname + ansible.builtin.lineinfile: + path: /etc/zabbix/zabbix_agent2.conf + regexp: "^Hostname=.*" + line: "Hostname={{ansible_hostname}}" + - name: Reconfigure zabbix-agent2 hostname + ansible.builtin.lineinfile: + path: /etc/zabbix/zabbix_agent2.conf + regexp: "^UserParameter=.*" + insertafter: '^# UserParameter=' + line: "UserParameter=system.temperature,vcgencmd measure_temp" + - name: Reconfigure zabbix-agent2 hostname + ansible.builtin.lineinfile: + path: /etc/zabbix/zabbix_agent2.conf + regexp: "^HostMetadata=.*" + insertafter: '^# HostMetadata=' + line: "HostMetadata=linux;jaydee" + + - name: Restart zabbix-server service + ansible.builtin.service: + name: "{{ item }}" + state: restarted + enabled: true + loop: + - zabbix-server.service + - zabbix-agent2.service + - nginx.service \ No newline at end of file diff --git a/playbooks/00_install_zabbix_server_cert.yml b/playbooks/00_install_zabbix_server_cert.yml new file mode 100644 index 0000000..0568616 --- /dev/null +++ b/playbooks/00_install_zabbix_server_cert.yml @@ -0,0 +1,16 @@ +- hosts: datacenter + name: Install zabbix agent + become: true + tasks: + - name: Creating a file with content + copy: + dest: "/usr/share/zabbix/conf/certs/idp.crt" + content: "{{ ZABBIX_IDP_CERT }}" + - name: Creating a file with content + copy: + dest: "/usr/share/zabbix/conf/certs/sp.key" + content: "{{ ZABBIX_AUTH_KEY }}" + - name: Creating a file with content + copy: + dest: "/usr/share/zabbix/conf/certs/sp.crt" + content: "{{ ZABBIX_AUTH_CERT }}" \ No newline at end of file diff --git a/playbooks/setup_fog_nfs.yml b/playbooks/setup_fog_nfs.yml new file mode 100644 index 0000000..78f30ac --- /dev/null +++ b/playbooks/setup_fog_nfs.yml @@ -0,0 +1,48 @@ +- hosts: datacenter + name: Setup nfs + gather_facts: false + tasks: + - name: Install nfs + ansible.builtin.apt: + name: nfs-kernel-server + state: present + when: inventory_hostname in groups['fog'] + + + - name: Reconfigure common-session + ansible.builtin.lineinfile: + path: /etc/exports + regexp: "/images .*" + line: "/images *(rw,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=0)" + become: true + when: inventory_hostname in groups['fog'] + - name: Restart autofs service + ansible.builtin.service: + name: nfs-kernel-server.service + state: restarted + become: true + when: inventory_hostname in groups['fog'] + - name: Creating a file with content wol service + ansible.builtin.copy: + dest: "/etc/auto.fog" + content: | + fog-images -fstype=nfs 192.168.77.108:/images + become: true + when: inventory_hostname in groups['morefine'] + + - name: Restart autofs service + ansible.builtin.service: + name: autofs.service + state: restarted + become: true + when: inventory_hostname in groups['morefine'] + + # - name: Creating script to fetch ldap info + # ansible.builtin.copy: + # dest: "/usr/local/bin/fetchSSHKeysFromLDAP" + # content: | + # #!/bin/bash + # ldapsearch -b "dc=sectorq,dc=eu" -H ldap://192.168.77.106:389 -x '(&(objectClass=ldapPublicKey)(cn='"$1"'))' 'sshPublicKey' | sed -n '/^ /{H;d};/sshPublicKey:/x;$g;s/\n *//g;s/sshPublicKey: //gp' + # owner: admin + # mode: '0744' + # when: inventory_hostname in groups['nas'] From 6e3ad23eec8dc9881f8fa0d4ffc1b574948481fc Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 27 Jun 2024 00:19:16 +0200 Subject: [PATCH 195/374] bitwarden --- hosts.yml | 2 +- playbooks/00_install_zabbix_agent.yml | 4 ++- playbooks/files/scripts/mqtt_srv.py | 46 +++++++++++++-------------- playbooks/install_mqtt_srv.yml | 22 +++++++++---- playbooks/sync_all.yaml | 10 +++--- playbooks/wol_enable.yml | 8 +++-- 6 files changed, 53 insertions(+), 39 deletions(-) diff --git a/hosts.yml b/hosts.yml index f01d613..fdcf4a9 100644 --- a/hosts.yml +++ b/hosts.yml @@ -53,7 +53,7 @@ datacenter: ansible_ssh_pass: lacijaydee ansible_become_user: root ansible_become_password: lacijaydee - proxmox: + amd: hosts: 192.168.77.4: vars: diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index 0054418..50cbdb6 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -34,7 +34,8 @@ - name: Install a .deb package from the internet ansible.builtin.apt: - deb: https://repo.zabbix.com/zabbix/6.4/raspbian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb + #deb: https://repo.zabbix.com/zabbix/6.4/raspbian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb + deb: https://repo.zabbix.com/zabbix/7.0/raspbian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian11_all.deb retries: 5 delay: 5 when: @@ -69,6 +70,7 @@ - zabbix-agent2-plugin-* update_cache: yes when: inventory_hostname not in groups['nas'] + become: "{{ false if inventory_hostname in groups['nas'] else true }}" - name: Reconfigure zabbix agent Server diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index 114dfb7..73c04b3 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -1,12 +1,7 @@ #!/usr/bin/env python3 from asyncio.log import logger -import paho.mqtt -import paho.mqtt.client as mqttClient -if paho.mqtt.__version__[0] > '1': - client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) -else: - client = mqttClient.Client() +import paho.mqtt.client as mqtt from getmac import get_mac_address import platform import socket @@ -24,7 +19,7 @@ import random import requests #import psutil stats = {} -VERSION = "1.0.26" +VERSION = "1.0.27" curos = platform.system() host = platform.node().lower() print(host) @@ -243,10 +238,7 @@ if _PUBLISH: else: print("Failed to connect, return code %d\n", rc) - if paho.mqtt.__version__[0] > '1': - client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) - else: - client = mqttClient.Client() + client = mqtt.Client(client_id) client.username_pw_set(username, password) client.on_connect = on_connect client.connect(MQTT_HOST, MQTT_PORT) @@ -876,8 +868,11 @@ def on_message(client, userdata, msg): else: if host == "nas" or host == "octopi": subprocess.Popen(["/sbin/poweroff"]) - elif host == "openmediavault" or host == "omv": + elif host == "openmediavault" or host == "omv" or host == "amd" or host == "ryzen": subprocess.Popen(["poweroff"]) + elif host == "amd" or host == "ryzen": + subprocess.Popen(["systemctl suspend"]) + else: #subprocess.Popen(["/bin/systemctl", "suspend", "-i"]) #subprocess.Popen(["sudo", "pm-suspend"]) @@ -932,10 +927,7 @@ def on_message(client, userdata, msg): except: print("not a json!") -if paho.mqtt.__version__[0] > '1': - client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) -else: - client = mqttClient.Client() +client = mqtt.Client() payload = '{"status": "off"}' client.username_pw_set("jaydee", password="jaydee1") client.will_set("home-assistant/" + host.lower() + "/hwstats", payload=payload, qos=0, retain=True) @@ -1065,7 +1057,8 @@ else: NEXT_CHECK = int(time.time()) + 20 writeLog("Blalala : Next : " + str(NEXT_CHECK)) - if host.lower() == "asus" or host.lower() == "morefine": + if host.lower() == "asus" or host.lower() == "morefine" or host.lower() == "ryzen": + writeLog("Blalala : AAA") print(psutil.sensors_temperatures()) #print(psutil.sensors_fans()) sences = psutil.sensors_temperatures() @@ -1079,19 +1072,25 @@ else: cpu_data = sences["k10temp"][0] except: cpu_data = "None" + writeLog(cpu_data) print("CPUDATA") print(cpu_data) print("#"*40) - - - mb_data = sences["acpitz"][0] print("MBDATA") - print(mb_data) - print(mb_data.current) + try: + mb_data = sences["acpitz"][0] + print(mb_data) + print(mb_data.current) + mb_data = mb_data.current + except: + mb_data = 0 + + print("#"*40) try: + print(psutil.sensors_fans()) fan_data = psutil.sensors_fans()["asus"][0].current except: fan_data = "None" @@ -1115,7 +1114,8 @@ else: #print(str(jn1["coretemp-isa-0000"]["Package id 0"]["temp1_input"])) #print(str(jn1["asus-isa-0000"]["cpu_fan"]["fan1_input"])) #client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False) - client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on", "version":"' + VERSION + '","TCPU":"NA", "MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":"' + str(fan_data) + '", "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) + writeLog('{"status":"on", "version":"' + VERSION + '","TCPU":"NA", "MB_TEMP":' + str(mb_data) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":"' + str(fan_data) + '", "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}') + client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on", "version":"' + VERSION + '","TCPU":"NA", "MB_TEMP":' + str(mb_data) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":"' + str(fan_data) + '", "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) client.publish("sectorq/systems/" + host.lower() + "/stat", payload="on", qos=0, retain=True) elif host.lower() == "openmediavault" or host.lower() == "omv": #print(psutil.sensors_temperatures()) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 8d890e9..ef2be21 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -3,6 +3,14 @@ ignore_unreachable: false become: True tasks: + - name: Install bottle python package + ansible.builtin.apt: + name: + - python3-pip + - python3-pip + - python3-pip + - python3-pip + - python3-pip - name: Upload service config ansible.builtin.copy: src: services/mqtt_srv.service @@ -15,13 +23,13 @@ mode: '755' owner: root - name: Install bottle python package - ansible.builtin.pip: - name: - - paho-mqtt - - getmac - - ping3 - - psutil - - autorandr + ansible.builtin.shell: pip install {{ item }} --break-system-packages + loop: + - paho-mqtt + - getmac + - ping3 + - psutil + - autorandr - name: Just force systemd to reread configs (2.4 and above) ansible.builtin.systemd: daemon_reload: true diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index b9a18a4..9af402b 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -27,8 +27,8 @@ when: inventory_hostname in groups['raspberrypi5'] - name: Get relevant configs ansible.builtin.shell: 'egrep -l "# kestra.sectorq.eu|# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' - ignore_errors: yes - become: yes + ignore_errors: true + become: true register: result when: inventory_hostname in groups['raspberrypi5'] @@ -40,7 +40,7 @@ path: "{{ item }}" regexp: '^\s+set \$server\s+\"\w+.\w+.\w+.\w+\";' line: " set $server \"192.168.77.238\";" - become: yes + become: true with_items: - "{{ result.stdout_lines }}" when: inventory_hostname in groups['raspberrypi5'] @@ -67,8 +67,8 @@ # seconds: 10 - name: Update gitlab perms ansible.builtin.shell: 'docker exec -t gitlab update-permissions' - ignore_errors: yes - become: yes + ignore_errors: true + become: true register: result when: inventory_hostname in groups['raspberrypi5'] # - name: Get relevant configs diff --git a/playbooks/wol_enable.yml b/playbooks/wol_enable.yml index e5ef6b5..d94ae69 100644 --- a/playbooks/wol_enable.yml +++ b/playbooks/wol_enable.yml @@ -1,7 +1,11 @@ -- hosts: omv +- hosts: datacenter name: Enable WOL become: true tasks: + - name: Install ethtool + ansible.builtin.apt: + name: ethtool + state: present - name: Display all interfaces name debug: var: ansible_facts.interfaces @@ -12,7 +16,7 @@ when: 'item.startswith("en")' - name: Creating config - become: yes + become: true ansible.builtin.copy: dest: "/etc/systemd/system/wol.service" From 8f4af6a6c7e3ec99a6281bf04a935095ffe4c3e5 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 27 Jun 2024 10:30:10 +0200 Subject: [PATCH 196/374] bitwarden --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index fdcf4a9..9044058 100644 --- a/hosts.yml +++ b/hosts.yml @@ -115,7 +115,7 @@ datacenter: 192.168.77.106: vars: ansible_ssh_user: admin - ansible_ssh_pass: l4c1!j4yd33?Du5lo1 + ansible_ssh_pass: l4c1!j4yd33?Du5lo become_method: su become_user: admin # ansible_user: admin From 95da8cecb4296edeb785cb6e1ab0a162320dcb36 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 19:59:44 +0200 Subject: [PATCH 197/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index 73c04b3..3aa8eaf 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -19,7 +19,7 @@ import random import requests #import psutil stats = {} -VERSION = "1.0.27" +VERSION = "1.0.28" curos = platform.system() host = platform.node().lower() print(host) @@ -221,7 +221,7 @@ for o, a in opts: _THR_VAL = sys.argv[3] else: _WIZZARD = True -MQTT_HOST = "192.168.77.106" +MQTT_HOST = "192.168.77.107" MQTT_PORT = 1883 if _PUBLISH: From 3da6cefe8d229e0187eabdcf4fe55848e212becc Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 20:10:54 +0200 Subject: [PATCH 198/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index 3aa8eaf..6071cb3 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -934,7 +934,15 @@ client.will_set("home-assistant/" + host.lower() + "/hwstats", payload=payload, client.on_connect = on_connect client.on_message = on_message writeLog(MQTT_HOST) -client.connect(MQTT_HOST, MQTT_PORT, 25) +connected = False +while not connected: + try: + client.connect(MQTT_HOST, MQTT_PORT, 25) + connected = True + except: + writeLog("Failed to connect repeating...") + time.sleep(10) + # client.publish("sectorq/status", payload="{'action':'connect', 'system':'" + host + "', 'ip': '" + IP + "', 'mac':'" + mac + "', 'ver':'?'}", qos=0, retain=False) From 79eedf51ccb5c5360816eb0b9ad39fa63ab468a5 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 20:13:47 +0200 Subject: [PATCH 199/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index 6071cb3..5fd1907 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -221,7 +221,7 @@ for o, a in opts: _THR_VAL = sys.argv[3] else: _WIZZARD = True -MQTT_HOST = "192.168.77.107" +MQTT_HOST = "192.168.77.106" MQTT_PORT = 1883 if _PUBLISH: From 31729c3a00345e318d9dda98c98dfe951b85846a Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:14:11 +0200 Subject: [PATCH 200/374] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 1220 --------------------------- 1 file changed, 1220 deletions(-) delete mode 100644 playbooks/files/scripts/mqtt_srv.py diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py deleted file mode 100644 index 5fd1907..0000000 --- a/playbooks/files/scripts/mqtt_srv.py +++ /dev/null @@ -1,1220 +0,0 @@ -#!/usr/bin/env python3 - -from asyncio.log import logger -import paho.mqtt.client as mqtt -from getmac import get_mac_address -import platform -import socket -import re -import subprocess -import os -import json -import sys -import time -import json -import datetime -import ctypes -import getopt -import random -import requests -#import psutil -stats = {} -VERSION = "1.0.28" -curos = platform.system() -host = platform.node().lower() -print(host) -if curos == "Windows": - import winreg -def uptime(): - - try: - f = open( "/proc/uptime" ) - contents = f.read().split() - f.close() - except: - return "Cannot open uptime file: /proc/uptime" - - total_seconds = float(contents[0]) - - # Helper vars: - MINUTE = 60 - HOUR = MINUTE * 60 - DAY = HOUR * 24 - - # Get the days, hours, etc: - days = int( total_seconds / DAY ) - hours = int( ( total_seconds % DAY ) / HOUR ) - minutes = int( ( total_seconds % HOUR ) / MINUTE ) - seconds = int( total_seconds % MINUTE ) - - # Build up the pretty string (like this: "N days, N hours, N minutes, N seconds") - string = "" - # if days > 0: - # string += str(days) + " " + (days == 1 and "d" or "d" ) + ", " - # if len(string) > 0 or hours > 0: - # string += str(hours) + " " + (hours == 1 and "h" or "h" ) + ", " - # if len(string) > 0 or minutes > 0: - # string += str(minutes) + " " + (minutes == 1 and "m" or "m" ) + ", " - if days > 0: - string += str(days) + " " + (days == 1 and "d" or "d" ) + ", " - if len(string) > 0 or hours > 0: - string += str(hours) + ":" - if len(string) > 0 or minutes > 0: - string += str(minutes) + ":" - string += str(seconds) - - return string; - -def writeLog(msg, svr="INFO"): - ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") - if curos == "Windows": - log_path = "c:\Program Files\jaydee\jaydee.log" - else: - log_path = "/tmp/mqtt_srv.log" - f = open(log_path, "a") - f.write(ts + " | " + svr + " | " + str(msg) + "\n") - f.close() - -def check_router(): - stats["uptime"] = uptime() - stats["version"] = VERSION - stats["status"] = "on" - cmnd = "crontab -l" - status, output = subprocess.getstatusoutput(cmnd) - - if "#Skynet_banmalware#" in output: - stats["skynet"] = "On" - else: - stats["skynet"] = "Off" - if "#Diversion_CountAds#" in output: - stats["diversion"] = "On" - else: - stats["diversion"] = "Off" - - - cmnd = "nvram get vpn_client1_state" - status, output = subprocess.getstatusoutput(cmnd) - writeLog("VpnClient1 Status : " + str(output)) - stats["vpnclient1"] = "On" if output == "2" else "Off" - cmnd = "nvram get vpn_client2_state" - status, output = subprocess.getstatusoutput(cmnd) - writeLog("VpnClient2 Status : " + str(output)) - stats["vpnclient2"] = "On" if output == "2" else "Off" - cmnd = "nvram get vpn_server1_state" - status, output = subprocess.getstatusoutput(cmnd) - writeLog("VpnServer1 Status : " + str(output)) - stats["vpnserver1"] = "On" if output == "2" else "Off" - cmnd = "ncat -z 192.168.77.106 25" - status, output = subprocess.getstatusoutput(cmnd) - if status == 0: - stats["mail_nas"] = "available" - else: - stats["mail_nas"] = "unavailable" - cmnd = "ncat -z 192.168.77.246 25" - status, output = subprocess.getstatusoutput(cmnd) - if status == 0: - stats["mail_rasp"] = "available" - else: - stats["mail_rasp"] = "unavailable" - cmnd = "nvram get vts_rulelist" - status, output = subprocess.getstatusoutput(cmnd) - rule_data = output.split("<") - serv_d = {} - for l in rule_data: - rul = l.split(">") - if len(rul) > 3: - if rul[0] == "HTTPS": - serv_d[rul[0]] = {"src_port":rul[1],"dest_ip":rul[2],"dest_port":rul[3],"prot":rul[4]} - stats["serv_dest"] = rul[2] - break - #stats["serv_dest"] = json.dumps(serv_d) - #stats["serv_dest"] = json.dumps(serv_d) - #out = subprocess.Popen(cmnd.split()) - #status, output = subprocess.getstatusoutput(cmnd) - - - ''' - - - print("Getting fw info") - cmnd = "/root/router_cmd.sh -t firewall -n TOSHIBA-WIFI -m get" - #out = subprocess.Popen(cmnd.split()) - status, output = subprocess.getstatusoutput(cmnd) - print(output) - stats["fw"] = output - #client.publish("sectorq/systems/router/fw", payload=str(output), qos=0, retain=True) - print("Getting wifi info") - cmnd = "/root/router_cmd.sh -t wireless -m get" - #out = subprocess.Popen(cmnd.split()) - status, output = subprocess.getstatusoutput(cmnd) - print(output) - if output != 'allow': - output = 'off' - stats["macfilter"] = output - # if output == "allow":\ - writeLog("Payload : " + str(json.dumps(stats))) - ''' - client.publish("home-assistant/router/hwstats", json.dumps(stats), qos=0, retain=True) - #client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=True) - #else: - # client.publish("sectorq/systems/router/macfilter", payload=0, qos=0, retain=True) - -if host != "router" and host != "nas": - import psutil - - processes = list(p.name() for p in psutil.process_iter()) - # print(processes) - count = processes.count("mqtt_srv.exe") - if int(count) >= 3: - writeLog("script exist") - sys.exit() -else: - cmnd = "ps |grep mqtt_srv.py|grep -v grep |wc -l" - status, output = subprocess.getstatusoutput(cmnd) - count = output - if int(count) >= 2: - writeLog("script exist") - sys.exit() -# Stops duplicate instance from running - -writeLog(count) - -writeLog("Starting : " + str(VERSION)) -writeLog("Getting running proccesses", "DEBUG") - - -writeLog("done", "DEBUG") - -FILE_TIMESTAMP = os.path.getmtime(sys.argv[0]) -def get_sys_env(name): - key = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, r"System\CurrentControlSet\Control\Session Manager\Environment") - return winreg.QueryValueEx(key, name)[0] - -def get_user_env(name): - key = winreg.CreateKey(winreg.HKEY_CURRENT_USER, r"Environment") - return winreg.QueryValueEx(key, name)[0] - - -_PUBLISH = _SETVAR = False -try: - opts, args = getopt.getopt(sys.argv[1:], "Sspmt:", ["command=", "help", "output="]) -except getopt.GetoptError as err: - # print help information and exit: - print(str(err)) # will print something like "option -a not recognized" - #usage() - sys.exit(2) -output = None -# QJ : getopts - -for o, a in opts: - if o == "-d": - _ACTION = True - elif o in ("-p", "--publish"): - _PUBLISH = True - elif o in ("-m", "--publish"): - _MESSAGE = a - elif o in ("-t", "--publish"): - _TOPIC = a - elif o in ("-S", "--setvar"): - _SETVAR = True - _THR_NAME = sys.argv[2] - _THR_VAL = sys.argv[3] - else: - _WIZZARD = True -MQTT_HOST = "192.168.77.106" -MQTT_PORT = 1883 - -if _PUBLISH: - # generate client ID with pub prefix randomly - #client_id = f'python-mqtt-{random.randint(0, 1000)}' - client_id = 'python-mqtt-1004' - username = 'jaydee' - password = 'jaydee1' - - def connect_mqtt(): - def on_connect(client, userdata, flags, rc): - if rc == 0: - print("Connected to MQTT Broker!") - else: - print("Failed to connect, return code %d\n", rc) - - client = mqtt.Client(client_id) - client.username_pw_set(username, password) - client.on_connect = on_connect - client.connect(MQTT_HOST, MQTT_PORT) - return client - - - def publish(client): - result = client.publish(_TOPIC, _MESSAGE) - # result: [0, 1] - status = result[0] - if status == 0: - print(f"Send `{_MESSAGE}` to topic `{_TOPIC}`") - else: - print(f"Failed to send message to topic {_TOPIC}") - - client = connect_mqtt() - publish(client) - sys.exit() - -if _SETVAR: - #myCmd = "setx " + _THR_NAME + " " + _THR_VAL + " -m" - myCmd = "setx " + _THR_NAME + " " + _THR_VAL - subprocess.Popen(myCmd.split(), shell=True) - sys.exit() - -from ping3 import ping, verbose_ping - - - - -''' -curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -python get-pip.py -pip3 install getmac -pip3 install paho.mqttdasdas -""" - -''' - -writeLog("Starting daemon in versin : " + VERSION) - -VERS = '1.3' -''' -print("pinging") -lala = ping(MQTT_HOST) - -connected = 0 -while connected == 0: - if type(lala) == float: - print("Oleee connected") - writeLog("Mqtt connected", "INFO") - connected = 1 - else: - print("blaaah not connected, waiting...(5)") - writeLog("blaaah not connected, waiting...(5)") - time.sleep(5) - lala = ping(MQTT_HOST) -''' - -# Function to display hostname and -# IP address -def get_ip(): - s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - try: - # doesn't even have to be reachable - s.connect(('192.168.77.1', 1)) - IP = s.getsockname()[0] - except ValueError: - IP = '127.0.0.1' - finally: - s.close() - return IP - - -IP = get_ip() - - -print("OS : " + curos) -writeLog("OS : " + curos) -if curos != "Windows": - import autorandr -else: - import winreg - - -if host == "raspberrypi": - mac = str(get_mac_address("eth0")) -elif host == "SERVER": - mac = str(get_mac_address("enp2s0")) -elif host == "ASUS" and curos != "Windows": - mac = str(get_mac_address("enp3s0f1")) -elif host == "morefine" and curos != "Windows": - mac = str(get_mac_address("eno1")) -else: - mac = str(get_mac_address("Ethernet")) - - -print("MAC : " + mac) -writeLog("MAC : " + mac) -print("SYSTEM : " + host) -writeLog("SYSTEM : " + host) -print("IP : " + IP) -writeLog("IP : " + IP) - -flag_connected = 0 -# The callback for when the client receives a CONNACK response from the server. -def on_connect(client, userdata, flags, rc): - print("Connected with result code " + str(rc)) - writeLog("Connected with result code " + str(rc)) - global flag_connected - flag_connected = 1 - # Subscribing in on_connect() means that if we lose the connection and - # reconnect then subscriptions will be renewed. - topic = "sectorq/systems/" + host.lower() - print(topic) - writeLog(topic) - time.sleep(1) - client.publish("sectorq/status", payload="{'action':'connect', 'system':'" + host.lower() + "', 'ip': '" + IP + "', 'mac':'" + mac + "', 'ver':'" + VERS + "'}", qos=0, retain=False) - client.publish("sectorq/systems/" + host.lower() + "/stat", payload="on", qos=0, retain=True) - if host.lower() == "router": - check_router() - - if host.lower() == "nas": - print("Getting VM info") - - cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh list --all" - print(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - l = 1 - lines = output.splitlines() - VMS = {} - for i in lines: - l = l + 1 - if l < 4: - continue - line = re.split(r" {2,}", i) - print(str(line[0].strip()) + " " + str(line[1].strip()) + " " + str(line[2].strip())) - VMS[str(line[1].strip())] = str(line[2].strip()) - - - - for m in VMS: - - cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + m - #out = subprocess.Popen(cmnd.split()) - print(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - print(output) - if output.strip() == "running": - client.publish("sectorq/systems/nas/" + m, payload=1, qos=0, retain=True) - else: - client.publish("sectorq/systems/nas/" + m, payload=0, qos=0, retain=True) - - - client.subscribe(topic) - -def on_disconnect(client, userdata, rc): - print("disconnecting reason " +str(rc)) - writeLog("disconnecting reason " +str(rc)) - client.connected_flag=False - client.disconnect_flag=True - global flag_connected - flag_connected = 0 - - -# The callback for when a PUBLISH message is received from the server. -def on_message(client, userdata, msg): - print(msg.topic) - print(msg.payload) - myObj = msg.payload.decode('utf-8') - # command = re.sub(r"^b\'|\'$", "", str(msg.payload)) - # command = json.loads(msg.payload.decode("utf-8")) - try: - myObj = json.loads(msg.payload) - try: - writeLog(myObj["action"]) - print(myObj["action"]) - except: - print("Action not set") - writeLog("Action not set", "WARNING") - - try: - print(myObj["cmd"]) - writeLog(myObj["cmd"]) - except: - print("Cmd not set") - writeLog("Cmd not set", "WARNING") - - try: - print(myObj["target"]) - writeLog(myObj["target"]) - except: - print("Target Not Set") - writeLog("Target Not Set", "WARNING") - try: - print(myObj["status"]) - writeLog(myObj["status"]) - except: - print("Status Not Set") - writeLog("Status Not Set") - - try: - print(myObj["command"]) - writeLog(myObj["command"]) - except: - print("Command Not Set") - writeLog("Command Not Set") - - try: - print(myObj["cmd_line"]) - writeLog(myObj["cmd_line"]) - except: - print("Cmd_line Not Set") - writeLog("Cmd_line Not Set") - - - if myObj["cmd"] == "command": - - print("Executing " + myObj["cmd_line"]) - writeLog("Executing " + myObj["cmd_line"]) - #os.system('start /b "' + myObj["cmd_line"] + '"') - try: - subprocess.Popen(myObj["cmd_line"].split(), shell=True) - #subprocess.Popen(myObj["cmd_line"].split()) - # ctypes.windll.user32.MessageBoxW(0, myObj["cmd_line"], "Executed", 64) - except: - ctypes.windll.user32.MessageBoxW(0, "Your text", "Your title", 16) - print("Executed " + myObj["cmd_line"]) - writeLog("Executed " + myObj["cmd_line"]) - - if myObj["cmd"] == "nas_cmd": - print("Executing NAS") - #cmnd = "/share/ZFS530_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + str(myObj["target"]) - cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + str(myObj["target"]) - print(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - print(output) - cmd_type = myObj["command"] - if myObj["command"] == "start": - if output.strip() == "paused": - print("System suspended") - cmd_type = "resume" - else: - print("System Off") - cmd_type = "start" - if myObj["command"] == "suspend": - cmd_type = "shutdown" - - - cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh " + cmd_type + " " + str(myObj["target"]) - subprocess.Popen(cmnd.split()) - print(cmnd) - if myObj["command"] == "start": - try: - print("sending") - client.publish("sectorq/systems/nas/" + str(myObj["target"]), payload=1, qos=0, retain=False) - except: - print("failed to execute!") - client.publish("sectorq/systems/nas/" + str(myObj["target"]), payload="failed", qos=0, retain=False) - else: - try: - print("sending") - client.publish("sectorq/systems/nas/" + str(myObj["target"]), payload=0, qos=0, retain=False) - except: - print("failed to execute!") - client.publish("sectorq/systems/nas/" + str(myObj["target"]), payload="failed", qos=0, retain=False) - - - if myObj["cmd"] == "distrib": - print("distributin313g") - # os.startfile(sys.argv[0]) - #sys.exit() - subprocess.Popen(['/bin/systemctl', 'restart', 'mqtt']) - - if myObj["cmd"] == "uci": - print("uci1") - print("Executing " + myObj["cmd_line"]) - writeLog("Executing " + myObj["cmd_line"]) - - if myObj["cmd_line"] == "wireless1": - cmnd = "/root/router_cmd.sh -t wireless -v 1 -m set" - try: - subprocess.Popen(cmnd.split()) - print("sending") - stats["macfilter"] = "allow" - client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=False) - writeLog("Payload : " + json.dumps(stats)) - except: - print("failed to execute!") - client.publish("sectorq/systems/router/stats", payload="failed", qos=0, retain=False) - - elif myObj["cmd_line"] == "wireless0": - cmnd = "/root/router_cmd.sh -t wireless -v 0 -m set" - try: - subprocess.Popen(cmnd.split()) - print("sending") - stats["macfilter"] = "off" - client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=False) - writeLog("Payload : " + json.dumps(stats)) - except: - print("failed to execute!") - client.publish("sectorq/systems/router/stats", payload="failed", qos=0, retain=False) - elif myObj["cmd_line"] == "fw0": - cmnd = "/root/router_cmd.sh -t firewall -n TOSHIBA-WIFI -p enabled -v 0 -m set" - try: - subprocess.Popen(cmnd.split()) - print("sending") - stats["fw"] = 0 - client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=False) - writeLog("Payload : " + json.dumps(stats)) - except: - print("failed to execute!") - client.publish("sectorq/systems/router/stats", payload="failed", qos=0, retain=False) - elif myObj["cmd_line"] == "fw1": - cmnd = "/root/router_cmd.sh -t firewall -n TOSHIBA-WIFI -p enabled -v 1 -m set" - try: - #subprocess.Popen(myObj["cmd_line"].split(), shell=True) - subprocess.Popen(cmnd.split()) - # ctypes.windll.user32.MessageBoxW(0, myObj["cmd_line"], "Executed", 64) - print("sending") - stats["fw"] = 1 - client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=False) - writeLog("Payload : " + json.dumps(stats)) - except: - print("failed to execute!") - client.publish("sectorq/systems/router/stats", payload="failed", qos=0, retain=False) - elif myObj["cmd_line"] == "openvpn": - cmnd = "service {}".format(myObj["target"]) - print(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - - elif myObj["cmd_line"] == "serv_dest": - writeLog("Payload111111 : " + myObj["target"].lower()) - - cmnd = "nvram get vts_rulelist" - status, output = subprocess.getstatusoutput(cmnd) - rule_data = output.split("<") - serv_d = {} - writeLog("Payload111112") - for l in rule_data: - rul = l.split(">") - if len(rul) > 3: - serv_d[rul[0]] = {"src_port":rul[1],"dest_ip":rul[2],"dest_port":rul[3],"prot":rul[4]} - stats["serv_dest"] = rul[2] - writeLog("Payload111113") - rules = {"HTTPS":{"dest_ip":"192.168.77.106","src_port":443,"dest_port":443,"prot":"TCP"}, - "HTTP":{"dest_ip":"192.168.77.106","src_port":80,"dest_port":80,"prot":"TCP"}, - "EMAIL_25":{"dest_ip":"192.168.77.106","src_port":25,"dest_port":25,"prot":"TCP"}, - "EMAIL_465":{"dest_ip":"192.168.77.106","src_port":465,"dest_port":465,"prot":"TCP"}, - "EMAIL_993":{"dest_ip":"192.168.77.106","src_port":993,"dest_port":993,"prot":"TCP"}, - "EMAIL_995":{"dest_ip":"192.168.77.106","src_port":995,"dest_port":995,"prot":"TCP"}, - "EMAIL_587":{"dest_ip":"192.168.77.106","src_port":587,"dest_port":587,"prot":"TCP"}, - "EMAIL_143":{"dest_ip":"192.168.77.106","src_port":143,"dest_port":143,"prot":"TCP"}} - writeLog("Payload1111135") - print(json.dumps(serv_d)) - for r in rules: - print(r) - try: - serv_d[r]["dest_ip"] = myObj["target"] - except: - serv_d[r] = rules[r] - - lala = [] - for sr in serv_d: - lala.append("{}>{}>{}>{}>{}>".format(sr,serv_d[sr]["src_port"],serv_d[sr]["dest_ip"],serv_d[sr]["dest_port"],serv_d[sr]["prot"])) - la = "<".join(lala) - la = "<{}".format(la) - print(la) - cmnd = "nvram set vts_rulelist=\"{}\"".format(la) - print(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - cmnd = "nvram commit" - status, output = subprocess.getstatusoutput(cmnd) - cmnd = "service restart_firewall" - status, output = subprocess.getstatusoutput(cmnd) - writeLog("Payload111114") - writeLog(output) - print(json.dumps(serv_d)) - ''' - if myObj["target"].lower() == "192.168.77.246": - dest_ip = "192.168.77.246" - elif myObj["target"].lower() == "192.168.77.106": - dest_ip = "192.168.77.106" - - - - - RULES = ["EMAIL993", "EMAIL995", "EMAIL143", "EMAIL25", "EMAIL993", "EMAIL465", "HTTPS", "HTTP"] - for i in RULES: - cmnd = "uci set firewall.{}.dest_ip={}".format(i,dest_ip) - writeLog(cmnd) - subprocess.Popen(cmnd.split()) - - #cmnd = "uci set dhcp.@dnsmasq[0].address=/mqtt_broker/" + dest_ip - #writeLog(cmnd) - #subprocess.Popen(cmnd.split()) - time.sleep(1) - cmnd = "uci commit" - - subprocess.Popen(cmnd.split()) - - writeLog("Starting " + myObj["target"].lower()) - if myObj["target"].lower() == "192.168.77.246": - dest_ip = "192.168.77.246" - - - cmnd = "ssh root@192.168.77.246 'docker start mailu_resolver_1 mailu_redis_1 mailu_front_1 mailu_antispam_1 mailu_imap_1 mailu_admin_1 mailu_smtp_1 mailu_webmail_1 watchtower_watchtower_1 nginx-proxy-manager_db_1 nginx-proxy-manager_app_1 HomeAssistant webhub_client_1 dockermon_docker_mon_1 mosquitto_mosquitto_1 node-red_node-red_1 nextcloud_db_1 nextcloud_app_1'" - status, output = subprocess.getstatusoutput(cmnd) - elif myObj["target"].lower() == "192.168.77.106": - dest_ip = "192.168.77.106" - cmnd = "ssh root@192.168.77.246 'docker stop mailu_resolver_1 mailu_redis_1 mailu_front_1 mailu_antispam_1 mailu_imap_1 mailu_admin_1 mailu_smtp_1 mailu_webmail_1 watchtower_watchtower_1 nginx-proxy-manager_db_1 nginx-proxy-manager_app_1 HomeAssistant webhub_client_1 dockermon_docker_mon_1 mosquitto_mosquitto_1 node-red_node-red_1 nextcloud_db_1 nextcloud_app_1'" - status, output = subprocess.getstatusoutput(cmnd) - time.sleep(1) - cmnd = "/etc/init.d/firewall restart" - subprocess.Popen(cmnd.split()) - #cmnd = "/etc/init.d/dnsmasq restart" - #subprocess.Popen(cmnd.split()) - writeLog("reconfigure iot") - MQTT_BROKER = dest_ip - MQTT_USER = "jaydee" - MQTT_PASS = "jaydee1" - - cmnd = "nmap -sP 192.168.77.*|grep \"Nmap scan report\"|egrep -o \"[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\"" - #print(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - - # print(output) - - ips = output.splitlines() - tasm_data = {} - for sys_ip in ips: - # print("Thsis is ip : " + sys_ip) - cmnd = "nmap " + sys_ip + " -p80|grep \"80/tcp open http\"" - status, output = subprocess.getstatusoutput(cmnd) - # print("status of 80 : " + str(status)) - if status == 0: - try: - # url = "http://" + sys_ip + "/cm?user=admin&password=l4c1j4yd33Du5l0&cmnd=STATUS+5" - - url = "http://" + sys_ip + "/cm?cmnd=Backlog%20MqttHost%20" + MQTT_BROKER + "%3BMqttUser%20" + MQTT_USER + "%3BMqttPassword%20" + MQTT_PASS - print(url) - requests.get(url) - - except: - #print(sys_ip + " : Not a tasmota!") - pass - else: - #print(sys_ip + " : Not a listening") - pass - - - - time.sleep(1) - cmnd = "sed -i 's/^MQTT_HOST = .*/MQTT_HOST = \"" + dest_ip + "\"/' /root/mqtt_srv.py" - writeLog(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - #for i in ;do uci set firewall.${i}.dest_ip=192.168.77.246;done;uci set firewall.HTTPS.dest_port='443';uci set firewall.HTTP.dest_port='80' ;uci commit;/etc/init.d/firewall restart - else: - pass - #cmnd = "/root/router_cmd.sh -t wireless -v 0" - - - print("Executed " + cmnd) - writeLog("Executed " + cmnd) - ''' - - - if myObj["cmd"] == "banip": - if myObj["status"] == "ban": - cmnd = "echo " + str(myObj["target"]) + " >> /etc/banip/banip.blacklist; /etc/init.d/banip refresh" - elif myObj["status"] == "enable": - cmnd = "/etc/init.d/banip resume" - stats["banip"] = "enabled" - elif myObj["status"] == "disable": - cmnd = "/etc/init.d/banip suspend" - stats["banip"] = "paused" - writeLog(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - - client.publish("sectorq/systems/router/stats", payload=json.dumps(stats), qos=0, retain=True) - - if myObj["cmd"] == "vnc": - print(myObj["target"]) - writeLog(myObj["target"]) - - # os.startfile(sys.argv[0]) - #sys.exit() - myCmd = 'c:\\Program Files\\RealVNC\\VNC Viewer\\vncviewer.exe C:\\Users\\jaydee\\' + myObj["target"].upper() + '.vnc' - print(myCmd) - writeLog(myCmd) - subprocess.Popen(myCmd.split()) - if myObj["cmd"] == "getstats": - print("lalaa1") - try: - client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":" + get_user_env('mb_temp') + ",\"mem_usage\":" + get_user_env('mem_usage') + ",\"cpu_temp\":" + get_user_env('cpu_temp') + ",\"cpu_usage\":" + get_user_env('cpu_usage') + ",\"gpu_temp\":" + get_user_env('gpu_temp') + ",\"gpu_usage\":" + get_user_env('gpu_usage') + "}", qos=0, retain=False) - print("ok") - except: - print("failed") - client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False) - - print("lalaa2") - - if myObj["cmd"] == "display": - if curos == "Windows1": - # os.startfile(sys.argv[0]) - #sys.exit() - #print("reconfigure") - myCmd = 'MonitorSwitcher.exe -load:' + myObj["target"] + '.xml' - writeLog(myCmd) - #writeLog(os.path.realpath(__file__)) - print("lalaa2") - #subprocess.Popen(r'"{}"'.format(myCmd), shell=True) - print("lalaa3") - subprocess.Popen(myCmd.split(), shell=True,cwd=r'c:\Progra~1\jaydee') - else: - ''' - myCmd = "" - if myObj["target"] == "mid": - myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --off --output HDMI-1 --off --output eDP-1 --off" - elif myObj["target"] == "all": - myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --auto --above HDMI-2 --mode 1920x1080 --output HDMI-1 --auto --left-of HDMI-2 --mode 1920x1080 --output eDP-1 --auto --right-of HDMI-2 --mode 1920x1080" - elif myObj["target"] == "midleft": - myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --off --output HDMI-1 --auto --left-of HDMI-2 --mode 1920x1080 --output eDP-1 --off" - elif myObj["target"] == "midtop": - myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --auto --above HDMI-2 --mode 1920x1080 --output HDMI-1 --off --output eDP-1 --off" - elif myObj["target"] == "midleftbuild": - myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --off --output HDMI-1 --auto --left-of HDMI-2 --mode 1920x1080 --output eDP-1 --auto --right-of HDMI-2 --mode 1920x1080" - elif myObj["target"] == "midbuild": - myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --off --output HDMI-1 --off --output eDP-1 --auto --right-of HDMI-2 --mode 1920x1080" - elif myObj["target"] == "midlefttop": - myCmd = "xrandr --output HDMI-2 --primary --auto --mode 1920x1080 --output DVI-I-2-1 --auto --above HDMI-2 --mode 1920x1080 --output HDMI-1 --auto --left-of HDMI-2 --mode 1920x1080 --output eDP-1 --off" - else: - pass - - if myCmd != "": - print(myCmd) - subprocess.Popen(myCmd.split()) - ''' - myCmd = "" - writeLog(myObj["target"]) - if curos == "Windows": - - myCmd = "DisplayFusionCommand.exe -monitorloadprofile {}".format(myObj["target"]) - - else: - ''' - mon1 = "HDMI-1-1" - mon2 = "HDMI-1-2" - mon3 = "DVI-I-2-1" - mon4 = "eDP-1-1" - ''' - right = ["HDMI-A-0", "1920x1080"] - tleft = ["HDMI-A-0", "1920x1080"] - tright = ["DVI-I-1-1", "1920x1080"] - left = ["DisplayPort-0", "2560x1440"] - mid = ["DisplayPort-1", "3440x1440"] - - #xrandr --output DisplayPort-1 --primary --auto --mode 3440x1440 --output HDMI-A-0 --auto --left-of DVI-I-1-1 --mode 1920x1080 --output DisplayPort-0 --auto --left-of DisplayPort-1 --mode 2560x1440 --output DVI-I-1-1 --above DisplayPort-1 --mode 1920x1080 - if myObj["target"] == "mid": - myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --output {left[0]} --off --output {tleft[0]} --off --output {tright[0]} --off" - elif myObj["target"] == "left": - myCmd = f"xrandr --output {left[0]} --primary --auto --mode {left[1]} --output {mid[0]} --off --output {tleft[0]} --off --output {tright[0]} --off" - elif myObj["target"] == "all": - myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --pos 0x0 --output {tleft[0]} --auto --pos -1920x-1080 --mode {tleft[1]} --output {left[0]} --auto --left-of {mid[0]} --mode {left[1]} --output {tright[0]} --above {mid[0]} --mode {tright[1]}" - #myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --output {right[0]} --auto --right-of {mid[0]} --mode {right[1]} --output {left[0]} --auto --left-of {mid[0]} --mode {left[1]}" - elif myObj["target"] == "midleft": - myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --output {tleft[0]} --off --output {left[0]} --auto --left-of {mid[0]} --mode {left[1]} --output {tright[0]} --off" - elif myObj["target"] == "midtop": - myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --output {tright[0]} --auto --above {mid[0]} --mode {tright[1]} --output {left[0]} --off --output {tleft[0]} --off" - elif myObj["target"] == "midlefttleft": - myCmd = f"xrandr --output {mid[0]} --primary --auto --mode {mid[1]} --pos 0x0 --output {tright[0]} --off --output {left[0]} --auto --left-of {mid[0]} --mode {left[1]} --output {tleft[0]} --auto --pos -1920x-1080 --mode {tleft[1]}" - elif myObj["target"] == "lefttlefttright": - myCmd = f"xrandr --output {mid[0]} --off --output {tleft[0]} --auto --pos 640x-1080 --mode {tright[1]} --output {left[0]} --primary --auto --mode {left[1]} --pos 0x0 --output {tright[0]} --right-of {tleft[0]} --mode {tright[1]}" - elif myObj["target"] == "lefttleft": - myCmd = f"xrandr --output {mid[0]} --off --output {tleft[0]} --auto --pos 640x-1080 --mode {tright[1]} --output {left[0]} --primary --auto --mode {left[1]} --pos 0x0 --output {tright[0]} --off" - - else: - pass - - writeLog(myCmd) - if myCmd != "": - print(myCmd) - writeLog("Executing : {myCmd}") - #subprocess.Popen(myCmd.split()) - status, output = subprocess.getstatusoutput(myCmd) - writeLog(output) - writeLog(status) - if myObj["cmd"] == "display2": - # os.startfile(sys.argv[0]) - #sys.exit() - #print("reconfigure") - subprocess.Popen(['MultiMonitorTool.exe', '/SaveConfig', 'c:\\Program Files\\jaydee\\switcher.cfg']) - myCmd = "powershell switcher.ps1 " + str(myObj["target"]) + " " + str(myObj["status"]) - writeLog(myCmd) - subprocess.Popen(myCmd.split()) - time.sleep(1) - subprocess.Popen(['MultiMonitorTool.exe', '/LoadConfig', 'c:\\Program Files\\jaydee\\switcher.cfg']) - client.publish("sectorq/feedback", payload='{"action":"resp", "source":"ASUS", "dev":{"display' + str(myObj["target"]) + '":'+ str(myObj["status"]) +'} }' , qos=0, retain=False) - if myObj["cmd"] == "displ": - print("Display") - # os.startfile(sys.argv[0]) - #sys.exit() - subprocess.Popen(['/usr/bin/xrandr', '--output', 'HDMI-1-1', '--off']) - - if myObj["cmd"] == "xrandr": - if curos == "Windows": - subprocess.Popen(['MultiMonitorTool.exe', '/LoadConfig', 'c:\\Program Files\\jaydee\\all_on.cfg']) - else: - print("Display") - # os.startfile(sys.argv[0]) - #sys.exit() - os.system("export DISPLAY=:0") - subprocess.Popen(['/usr/bin/xrandr']) - - if myObj["cmd"] == "suspend": - print("suspending") - if curos == "Windows": - if host == "amd" or host == "amd1": - os.system("shutdown /s /t 1") - else: - os.system("rundll32.exe powrprof.dll,SetSuspendState 0,1,0") - #cmnd = "psshutdown -d -t 1" - writeLog(cmnd) - #status, output = subprocess.getstatusoutput(cmnd) - #subprocess.Popen(["psshutdown", "-d", "-t", "1"]) - #writeLog(output) - else: - if host == "nas" or host == "octopi": - subprocess.Popen(["/sbin/poweroff"]) - elif host == "openmediavault" or host == "omv" or host == "amd" or host == "ryzen": - subprocess.Popen(["poweroff"]) - elif host == "amd" or host == "ryzen": - subprocess.Popen(["systemctl suspend"]) - - else: - #subprocess.Popen(["/bin/systemctl", "suspend", "-i"]) - #subprocess.Popen(["sudo", "pm-suspend"]) - cmnd = "pm-suspend" - status, output = subprocess.getstatusoutput(cmnd) - print(output) - print(status) - if myObj["cmd"] == "stats": - grep = subprocess.Popen(['grep', 'cpu', '/proc/stat'], - stdout=subprocess.PIPE, - ) - - awk = subprocess.Popen(['awk', '{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}'], - stdin=grep.stdout, - stdout=subprocess.PIPE, - ) - - # cat <(grep 'cpu ' /proc/stat) <(sleep 1 && grep 'cpu ' /proc/stat) | awk -v RS="" '{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}' - - end_of_pipe = awk.stdout - - for line in end_of_pipe: - # print(line.strip()) - # usage = re.sub(r"^b\'|\'$", "", (line.strip())) - cpu = round(float(line.strip().decode("utf-8"))) - free = subprocess.Popen(['free'], - stdout=subprocess.PIPE, - ) - - grep = subprocess.Popen(['grep', 'Mem'], - stdout=subprocess.PIPE, - stdin=free.stdout, - ) - - awk = subprocess.Popen(['awk', '{print $3/$2 * 100.0}'], - stdin=grep.stdout, - stdout=subprocess.PIPE, - ) - - end_of_pipe = awk.stdout - - for line in end_of_pipe: - # print(line.strip()) - # mem = re.sub(r"^b\'|\'$", "", (line.strip())) - mem = round(float(line.strip().decode("utf-8"))) - # mem = re.sub(r"^b\'|\'$", "", mem) - # cpu = re.sub(r"^b\'|\'$", "", cpu) - # print(mem) - jn = {"cpu": cpu, "mem": mem} - jn = json.dumps(jn) - client.publish("sectorq/status/" + host, payload=jn, qos=0, retain=False) - except: - print("not a json!") - -client = mqtt.Client() -payload = '{"status": "off"}' -client.username_pw_set("jaydee", password="jaydee1") -client.will_set("home-assistant/" + host.lower() + "/hwstats", payload=payload, qos=0, retain=True) -client.on_connect = on_connect -client.on_message = on_message -writeLog(MQTT_HOST) -connected = False -while not connected: - try: - client.connect(MQTT_HOST, MQTT_PORT, 25) - connected = True - except: - writeLog("Failed to connect repeating...") - time.sleep(10) - - -# client.publish("sectorq/status", payload="{'action':'connect', 'system':'" + host + "', 'ip': '" + IP + "', 'mac':'" + mac + "', 'ver':'?'}", qos=0, retain=False) - - -# Blocking call that processes network traffic, dispatches callbacks and -# handles reconnecting. -# Other loop*() functions are available that give a threaded interface and a -# manual interface. - -def checkIfProcessRunning(processName): - ''' - Check if there is any running process that contains the given name processName. - ''' - #Iterate over the all the running process - for proc in psutil.process_iter(): - try: - # Check if process name contains the given name string. - if processName.lower() in proc.name().lower(): - return True - except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): - pass - return False; - - - -if curos == "Windows": - print("WINDOWS") - #client.loop_forever() - client.loop_start() - NEXT_CHECK = 0 - while True: - print("Version: {}".format(VERSION)) - time.sleep(5) - try: - mtime = os.path.getmtime(sys.argv[0]) - except OSError: - mtime = 0 - print(mtime) - if NEXT_CHECK < int(time.time()): - NEXT_CHECK = int(time.time()) + 10 - writeLog("Blalala : Next : " + str(NEXT_CHECK)) - if curos == "Windows": - if checkIfProcessRunning("aida64.exe"): - aide_refs = { - 'TPCHDIO':"MB_TEMP", - 'TCPU':'CPU_TEMP', - 'SMEMUTI': 'MEM_UTIL', - 'SVIRTMEMUTI': 'VMEM_UTIL', - 'SCPUUTI': 'CPU_UTIL', - 'FCPU': 'FAN_CPU', - 'TGPU1DIO': 'GPU_TEMP', - 'SGPU1BIUTI': 'GPU_UTIL', - 'TMOBO':'MB_TEMP' - } - #ks = ["TCPU", "TPCHDIO", "SMEMUTI", "SVIRTMEMUTI", "SCPUUTI", "FCPU", "TGPU1DIO", "SGPU1BIUTI"] - - - - - path = winreg.HKEY_CURRENT_USER - try: - key = winreg.OpenKeyEx(path, r"SOFTWARE\\FinalWire\\AIDA64\\SensorValues") - results = {} - results["status"] = "on" - for k in aide_refs: - k2 = "Value." + str(k) - try: - value = winreg.QueryValueEx(key,k2) - print("{} : {}".format(k, value[0])) - results[aide_refs[k]] = value[0] - except: - pass - except: - print("aida initializing...") - results = {"status":"init"} - - - else: - print("CPU Cnt : {}".format(psutil.cpu_count())) - print(psutil.virtual_memory()) - cpu_usage = psutil.cpu_percent(interval=None) - swap_data = psutil.swap_memory() - print("CPU : {}".format(cpu_usage)) - mem_data = psutil.virtual_memory() - print(mem_data) - print(swap_data) - print("MEM : {}".format(mem_data.percent)) - print(psutil.getloadavg()) - #lodctr /R - try: - print(psutil.sensors_temperatures()) - except: - pass - try: - print(psutil.sensors_fans()) - except: - pass - results = {"status":"on","version":VERSION,"MB_TEMP":"NA", "MEM_UTIL":str(mem_data.percent), "CPU_TEMP":"NA", "FAN_CPU":"NA", "VMEM_UTIL":swap_data.percent, "CPU_UTIL":cpu_usage, "GPU_TEMP":"NA", "GPU_UTIL":"NA"} - print(json.dumps(results)) - r = json.dumps(results) - #client.publish("home-assistant/" + host + "/hwstats", payload='{"TPCHDIO":"' + str(results["TPCHDIO"]) + '", "SMEMUTI":"' + str(results["SMEMUTI"]) + '", "TCPU":"' + str(results["TCPU"]) + '", "TGPU1DIO":"' + str(results["TGPU1DIO"]) + '", "SGPU1BIUTI":"' + str(results["SGPU1BIUTI"]) + '", "FCPU":"' + str(results["FCPU"]) + '", "SVIRTMEMUTI":"' + str(results["SVIRTMEMUTI"]) + '", "SCPUUTI":"' + str(results["SCPUUTI"]) + '"}', qos=0, retain=False) - client.publish("home-assistant/" + host + "/hwstats", payload=r, qos=0, retain=False) - client.publish("sectorq/systems/" + host.lower() + "/stat", payload="on", qos=0, retain=True) - #print(json.dumps(stats)) - #writeLog(json.dumps(stats)) -else: - print("Linux") - client.loop_start() - - NEXT_CHECK = 0 - while True: - #print(VERSION) - time.sleep(5) - try: - mtime = os.path.getmtime(sys.argv[0]) - except OSError: - mtime = 0 - #print(mtime) - if NEXT_CHECK < int(time.time()): - NEXT_CHECK = int(time.time()) + 20 - writeLog("Blalala : Next : " + str(NEXT_CHECK)) - - if host.lower() == "asus" or host.lower() == "morefine" or host.lower() == "ryzen": - writeLog("Blalala : AAA") - print(psutil.sensors_temperatures()) - #print(psutil.sensors_fans()) - sences = psutil.sensors_temperatures() - print("SENCES") - print(sences) - print("#"*40) - try: - cpu_data = sences["coretemp"][0] - except: - try: - cpu_data = sences["k10temp"][0] - except: - cpu_data = "None" - writeLog(cpu_data) - print("CPUDATA") - print(cpu_data) - print("#"*40) - print("MBDATA") - try: - mb_data = sences["acpitz"][0] - print(mb_data) - print(mb_data.current) - mb_data = mb_data.current - except: - mb_data = 0 - - - print("#"*40) - - - try: - print(psutil.sensors_fans()) - fan_data = psutil.sensors_fans()["asus"][0].current - except: - fan_data = "None" - mem_data = psutil.virtual_memory() - swap_data = psutil.swap_memory() - #cpu_usage = psutil.cpu_percent(interval=1) - load1, load5, load15 = psutil.getloadavg() - cpu_usage = round((load1/os.cpu_count()) * 100, 1) - - print(mem_data) - print(mem_data.percent) - print(psutil.disk_usage('/')) - #print(psutil.virtual_memory()) - #print(dict(psutil.virtual_memory()._asdict())) - #cmnd = "sensors -j|grep -v \"Can't read\"" - #status, output = subprocess.getstatusoutput(cmnd) - #print(output) - #print(type(output)) - #jn1 = json.loads(output) - - #print(str(jn1["coretemp-isa-0000"]["Package id 0"]["temp1_input"])) - #print(str(jn1["asus-isa-0000"]["cpu_fan"]["fan1_input"])) - #client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False) - writeLog('{"status":"on", "version":"' + VERSION + '","TCPU":"NA", "MB_TEMP":' + str(mb_data) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":"' + str(fan_data) + '", "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}') - client.publish("home-assistant/" + host + "/hwstats", payload='{"status":"on", "version":"' + VERSION + '","TCPU":"NA", "MB_TEMP":' + str(mb_data) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":"' + str(fan_data) + '", "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) - client.publish("sectorq/systems/" + host.lower() + "/stat", payload="on", qos=0, retain=True) - elif host.lower() == "openmediavault" or host.lower() == "omv": - #print(psutil.sensors_temperatures()) - #print(psutil.sensors_fans()) - sences = psutil.sensors_temperatures() - #print(sences) - cpu_data = sences["coretemp"][0] - mb_data = sences["acpitz"][0] - mem_data = psutil.virtual_memory() - swap_data = psutil.swap_memory() - #cpu_usage = psutil.cpu_percent(interval=1) - load1, load5, load15 = psutil.getloadavg() - cpu_usage = round((load1/os.cpu_count()) * 100, 1) - print(psutil.getloadavg()) - print("CPU Util : {}".format(cpu_usage)) - print(mem_data) - print(mem_data.percent) - raid_data = psutil.disk_usage('/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee') - #print(psutil.virtual_memory()) - #print(dict(psutil.virtual_memory()._asdict())) - #cmnd = "sensors -j|grep -v \"Can't read\"" - #status, output = subprocess.getstatusoutput(cmnd) - #print(output) - #print(type(output)) - #jn1 = json.loads(output) - stat_rsync = subprocess.call(["systemctl", "is-active", "--quiet", "rsync"]) - if(stat_rsync == 0): # if 0 (active), print "Active" - stat_rsync = "on" - else: - stat_rsync = "off" - #sdiskusage = psutil.disk_partitions() - disk_usage = raid_data[3] - print(disk_usage) - sys_uptime = str(datetime.timedelta(seconds=round(time.time() - psutil.boot_time(), 0))) - reboot_pending = False - if os.path.exists("/var/run/reboot-required"): - reboot_pending = True - #str(datetime.timedelta(seconds=666)) - #print(str(jn1["coretemp-isa-0000"]["Package id 0"]["temp1_input"])) - #print(str(jn1["asus-isa-0000"]["cpu_fan"]["fan1_input"])) - #client.publish("sectorq/monitor/" + host.lower(), payload="{\"mb_temp\":0,\"mem_usage\":0,\"cpu_temp\":0,\"cpu_usage\":0,\"gpu_temp\":0,\"gpu_usage\":0}", qos=0, retain=False) - client.publish("home-assistant/" + host + "/hwstats", payload='{"version":"' + VERSION + '","reboot":"' + str(reboot_pending) + '", "uptime":"' + str(sys_uptime) + '", "raid_usage": ' + str(disk_usage) + ',"rsync":"' + str(stat_rsync) +'", "MB_TEMP":' + str(mb_data.current) + ', "MEM_UTIL":' + str(mem_data.percent) + ', "CPU_TEMP":' + str(cpu_data.current) + ', "GPU_TEMP":0, "GPU_UTIL":0, "FAN_CPU":0, "VMEM_UTIL":' + str(swap_data.percent) + ', "CPU_UTIL":' + str(cpu_usage) + '}', qos=0, retain=False) - elif host.lower() == "router": - check_router() - elif host.lower() == "nas": - print("Getting VM info") - - cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh list --all" - writeLog(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - l = 1 - lines = output.splitlines() - VMS = {} - for i in lines: - l = l + 1 - if l < 4: - continue - line = re.split(r" {2,}", i) - print(str(line[0].strip()) + " " + str(line[1].strip()) + " " + str(line[2].strip())) - VMS[str(line[1].strip())] = str(line[2].strip()) - - - - for m in VMS: - - cmnd = "/share/ZFS532_DATA/.qpkg/QKVM/usr/bin/virsh domstate " + m - #out = subprocess.Popen(cmnd.split()) - writeLog(cmnd) - status, output = subprocess.getstatusoutput(cmnd) - writeLog(output) - if output.strip() == "running": - client.publish("sectorq/systems/nas/" + m, payload=1, qos=0, retain=True) - else: - client.publish("sectorq/systems/nas/" + m, payload=0, qos=0, retain=True) - - - if FILE_TIMESTAMP != mtime: - writeLog("Script updated ! restarting...") - #os.execv(sys.executable, ['python'] + sys.argv) - #os.system("/share/ZFS530_DATA/.qpkg/QPython39/bin/python3 mqtt_srv.py") - - if host.lower() == "nas": - sys.stdout.flush() - os.execv("/share/ZFS530_DATA/.qpkg/QPython39/bin/python3", sys.argv) - if host.lower() == "router" or host.lower() == "omv": - #sys.stdout.flush() - #os.execv(sys.argv, "") - print("argv was",sys.argv) - print("sys.executable was", sys.executable) - print("restart now") - - os.execv(sys.executable, ['python3'] + sys.argv) - #os.startfile(sys.argv[0]) - sys.exit() \ No newline at end of file From 0fb906d2cf16686244d35bfcc199a2497f1569b2 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:19:51 +0200 Subject: [PATCH 201/374] bitwarden --- hosts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts.yml b/hosts.yml index 9044058..66ea0b9 100644 --- a/hosts.yml +++ b/hosts.yml @@ -33,6 +33,7 @@ datacenter: ansible_password: q ansible_become_user: root ansible_become_password: q + ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" ryzen: hosts: 192.168.77.15: From 6a75b171708293af870576fd25b65109a67e8f5e Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:32:10 +0200 Subject: [PATCH 202/374] bitwarden --- playbooks/install_mqtt_srv.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index ef2be21..5d97995 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -7,21 +7,19 @@ ansible.builtin.apt: name: - python3-pip - - python3-pip - - python3-pip - - python3-pip - - python3-pip + when: inventory_hostname not in groups['nas'] - name: Upload service config ansible.builtin.copy: src: services/mqtt_srv.service dest: /etc/systemd/system/ - + when: inventory_hostname not in groups['nas'] - name: Upload service script ansible.builtin.copy: src: scripts/mqtt_srv.py dest: /usr/bin/ mode: '755' owner: root + when: inventory_hostname not in groups['nas'] - name: Install bottle python package ansible.builtin.shell: pip install {{ item }} --break-system-packages loop: @@ -30,10 +28,13 @@ - ping3 - psutil - autorandr + when: inventory_hostname not in groups['nas'] - name: Just force systemd to reread configs (2.4 and above) ansible.builtin.systemd: daemon_reload: true + when: inventory_hostname not in groups['nas'] - name: Restart mqtt_srv service ansible.builtin.service: name: mqtt_srv.service - state: restarted \ No newline at end of file + state: restarted + when: inventory_hostname not in groups['nas'] \ No newline at end of file From 78250209e4db75a6c4333e9a2df5a2919018aac5 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:33:41 +0200 Subject: [PATCH 203/374] bitwarden --- hosts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts.yml b/hosts.yml index 66ea0b9..24950cd 100644 --- a/hosts.yml +++ b/hosts.yml @@ -122,6 +122,7 @@ datacenter: # ansible_user: admin # ansible_pass: l4c1!j4yd33?Du5lo1 ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 + ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" fog: hosts: 192.168.77.108: From 32835c2c45c33e00da8c53167e531fee97c567f7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:37:22 +0200 Subject: [PATCH 204/374] bitwarden --- playbooks/install_mqtt_srv.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 5d97995..20fec05 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -1,18 +1,19 @@ - hosts: datacenter name: Install mqtt_srv ignore_unreachable: false - become: True tasks: - name: Install bottle python package ansible.builtin.apt: name: - python3-pip when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Upload service config ansible.builtin.copy: src: services/mqtt_srv.service dest: /etc/systemd/system/ when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Upload service script ansible.builtin.copy: src: scripts/mqtt_srv.py @@ -20,6 +21,7 @@ mode: '755' owner: root when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install bottle python package ansible.builtin.shell: pip install {{ item }} --break-system-packages loop: @@ -29,12 +31,15 @@ - psutil - autorandr when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Just force systemd to reread configs (2.4 and above) ansible.builtin.systemd: daemon_reload: true when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Restart mqtt_srv service ansible.builtin.service: name: mqtt_srv.service state: restarted - when: inventory_hostname not in groups['nas'] \ No newline at end of file + when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" \ No newline at end of file From 849341f8e76c0c173d6eca2e8298c10c6b4438d9 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:41:10 +0200 Subject: [PATCH 205/374] bitwarden --- playbooks/install_mqtt_srv.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 20fec05..5a8b2b1 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -8,12 +8,16 @@ - python3-pip when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Upload service config ansible.builtin.copy: src: services/mqtt_srv.service dest: /etc/systemd/system/ when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Upload service script ansible.builtin.copy: src: scripts/mqtt_srv.py @@ -22,6 +26,16 @@ owner: root when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Upload service script + ansible.builtin.copy: + src: scripts/mqtt_srv.py + dest: /share/Data/__GITLAB/mqtt_srv/ + mode: '755' + owner: admin + when: inventory_hostname in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + - name: Install bottle python package ansible.builtin.shell: pip install {{ item }} --break-system-packages loop: @@ -32,14 +46,25 @@ - autorandr when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Just force systemd to reread configs (2.4 and above) ansible.builtin.systemd: daemon_reload: true when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Restart mqtt_srv service ansible.builtin.service: name: mqtt_srv.service state: restarted when: inventory_hostname not in groups['nas'] - become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" \ No newline at end of file + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Install bottle python package + ansible.builtin.shell: python3 /share/Data/__GITLAB/mqtt_srv/mqtt_srv.py > /dev/null 2>&1 & + when: inventory_hostname not in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + \ No newline at end of file From 3d066f0600bbe4e0ad28671cca33d6ed81a00e52 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:43:04 +0200 Subject: [PATCH 206/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 5a8b2b1..92c2b70 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -64,7 +64,7 @@ - name: Install bottle python package ansible.builtin.shell: python3 /share/Data/__GITLAB/mqtt_srv/mqtt_srv.py > /dev/null 2>&1 & - when: inventory_hostname not in groups['nas'] + when: inventory_hostname in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" \ No newline at end of file From 188bbca71ac33273845e9c6710eb0d8c66cf549e Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:45:09 +0200 Subject: [PATCH 207/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 92c2b70..8363e18 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -63,7 +63,7 @@ become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install bottle python package - ansible.builtin.shell: python3 /share/Data/__GITLAB/mqtt_srv/mqtt_srv.py > /dev/null 2>&1 & + ansible.builtin.shell: "/share/ZFS530_DATA/.qpkg/QPython312/bin/python3 /share/Data/__GITLAB/mqtt_srv/mqtt_srv.py > /dev/null 2>&1 &" when: inventory_hostname in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" From ece70d35e40520d3995507574af2faf22a69d28e Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:46:28 +0200 Subject: [PATCH 208/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 8363e18..0d72294 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -67,4 +67,6 @@ when: inventory_hostname in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + \ No newline at end of file From abc76981d05b27ee12df38cf3138cb114535a48d Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 22:56:38 +0200 Subject: [PATCH 209/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 0d72294..36f69c6 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -63,7 +63,7 @@ become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install bottle python package - ansible.builtin.shell: "/share/ZFS530_DATA/.qpkg/QPython312/bin/python3 /share/Data/__GITLAB/mqtt_srv/mqtt_srv.py > /dev/null 2>&1 &" + ansible.builtin.shell: '/share/ZFS530_DATA/.qpkg/QPython312/bin/python3 /share/Data/__GITLAB/mqtt_srv/mqtt_srv.py > /dev/null 2>&1 &' when: inventory_hostname in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" From 2aafdd8918c226e22b8d0394bb4cb5c83c64136c Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 23:03:37 +0200 Subject: [PATCH 210/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 36f69c6..25d754a 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -63,7 +63,7 @@ become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install bottle python package - ansible.builtin.shell: '/share/ZFS530_DATA/.qpkg/QPython312/bin/python3 /share/Data/__GITLAB/mqtt_srv/mqtt_srv.py > /dev/null 2>&1 &' + ansible.builtin.shell: /etc/init.d/mqtt start when: inventory_hostname in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" From 584be956700fd951f4ac9a841b98d44d62e412c1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 23:08:16 +0200 Subject: [PATCH 211/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 25d754a..0ebc6f2 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -62,7 +62,7 @@ when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Install bottle python package + - name: Install bottle python package1 ansible.builtin.shell: /etc/init.d/mqtt start when: inventory_hostname in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" From 052b2ec87553e06744e1863c60e8403ff899feb0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 23:14:24 +0200 Subject: [PATCH 212/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 0ebc6f2..3ee37dd 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -30,7 +30,7 @@ - name: Upload service script ansible.builtin.copy: src: scripts/mqtt_srv.py - dest: /share/Data/__GITLAB/mqtt_srv/ + dest: /share/Data/__GITLAB/mqtt_srv/mqtt_srv.pyw mode: '755' owner: admin when: inventory_hostname in groups['nas'] From ad31fa3f5975d95456dcdf0322c63d8a9aef259f Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 23:18:55 +0200 Subject: [PATCH 213/374] bitwarden --- playbooks/install_mqtt_srv.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 3ee37dd..1e19295 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -30,7 +30,7 @@ - name: Upload service script ansible.builtin.copy: src: scripts/mqtt_srv.py - dest: /share/Data/__GITLAB/mqtt_srv/mqtt_srv.pyw + dest: /share/Data/__GITLAB/mqtt_srv/ mode: '755' owner: admin when: inventory_hostname in groups['nas'] @@ -63,7 +63,9 @@ become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install bottle python package1 - ansible.builtin.shell: /etc/init.d/mqtt start + ansible.builtin.shell: "(/etc/init.d/mqtt start >/dev/null 2>&1 &)" + async: 10 + poll: 0 when: inventory_hostname in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" From f4276dc37aec4c1ae86e05d92b496fef566e567f Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 7 Jul 2024 23:24:00 +0200 Subject: [PATCH 214/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 1e19295..c3fad54 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -63,7 +63,7 @@ become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install bottle python package1 - ansible.builtin.shell: "(/etc/init.d/mqtt start >/dev/null 2>&1 &)" + ansible.builtin.shell: "(/etc/init.d/mqtt restart >/dev/null 2>&1 &)" async: 10 poll: 0 when: inventory_hostname in groups['nas'] From 0e1299ad93d7a343817cc0e289131c16d05321f7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 8 Jul 2024 20:27:37 +0200 Subject: [PATCH 215/374] bitwarden --- playbooks/00_install_zabbix_agent1.yml | 146 +++++++++++++++++++++++++ playbooks/import_media.yml | 6 + 2 files changed, 152 insertions(+) create mode 100644 playbooks/00_install_zabbix_agent1.yml create mode 100644 playbooks/import_media.yml diff --git a/playbooks/00_install_zabbix_agent1.yml b/playbooks/00_install_zabbix_agent1.yml new file mode 100644 index 0000000..c4e63a9 --- /dev/null +++ b/playbooks/00_install_zabbix_agent1.yml @@ -0,0 +1,146 @@ +- hosts: datacenter + name: Install zabbix agent + vars: + ZABBIX_SERVER_IP: "192.168.77.216" + tasks: + - name: Combine list1 and list2 into a merged_list var + ansible.builtin.set_fact: + zabbix_agent_cfg: "/etc/zabbix/zabbix_agentd.conf" + when: inventory_hostname in groups['rhasspy'] + + - name: Combine list1 and list2 into a merged_list var + ansible.builtin.set_fact: + zabbix_agent_cfg: "/etc/zabbix/zabbix_agent2.conf" + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['rhasspy'] + + - name: Combine list1 and list2 into a merged_list var + ansible.builtin.set_fact: + zabbix_agent_cfg: "/opt/ZabbixAgent/etc/zabbix_agentd.conf" + when: inventory_hostname in groups['nas'] + + - name: Print all available facts + ansible.builtin.debug: + msg: "{{ false if inventory_hostname not in groups['nas'] else true }}" + + - name: Print all available facts + ansible.builtin.debug: + var: ansible_facts.architecture + # - name: Upload zabbix package + # ansible.builtin.copy: + # src: packages/zabbix-release_6.4-1+ubuntu22.04_all.deb + # dest: /tmp/ + - name: Install a .deb package from the internet + ansible.builtin.apt: + deb: https://repo.zabbix.com/zabbix/6.4/ubuntu-arm64/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb + when: + - ansible_facts.architecture != "armv7l" and ansible_distribution == "Ubuntu" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Install a .deb package from the internet + ansible.builtin.apt: + #deb: https://repo.zabbix.com/zabbix/6.4/raspbian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb + deb: https://repo.zabbix.com/zabbix/7.0/raspbian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian11_all.deb + retries: 5 + delay: 5 + when: + - ansible_facts.architecture == "armv7l" + ignore_errors: true + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Install a .deb package from the internet + ansible.builtin.apt: + deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb + + when: + - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "11" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Install a .deb package from the internet + ansible.builtin.apt: + #deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb + deb: https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian12_all.deb + when: + - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "12" + + + + # - name: Install a .deb package localy + # ansible.builtin.apt: + # deb: /tmp/zabbix-release_6.4-1+ubuntu22.04_all.deb + - name: Install zabbix packages + ansible.builtin.apt: + name: + - zabbix-agent + update_cache: yes + when: inventory_hostname not in groups['nas'] + become: "{{ false if inventory_hostname in groups['nas'] else true }}" + + + - name: Reconfigure zabbix agent Server + ansible.builtin.lineinfile: + path: "{{ zabbix_agent_cfg }}" + regexp: "^Server=.*" + insertafter: '^# Server=' + line: "Server=192.168.77.0/24" + become: "{{ false if inventory_hostname in groups['nas'] else true }}" + + - name: Reconfigure zabbix agent ServerActive + ansible.builtin.lineinfile: + path: "{{ zabbix_agent_cfg }}" + regexp: "^ServerActive=.*" + line: "ServerActive={{ ZABBIX_SERVER_IP }}" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Reconfigure zabbix agent ListenPort + ansible.builtin.lineinfile: + path: "{{ zabbix_agent_cfg }}" + regexp: "^ListenPort=.*" + line: "ListenPort=10050" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + # - name: Reconfigure zabbix agent ListenIP + # ansible.builtin.lineinfile: + # path: /"{{ zabbix_agent_cfg }}" + # regexp: "^ListenIP=.*" + # line: "ListenIP=0.0.0.0" + - name: Reconfigure zabbix-agent2 hostname + ansible.builtin.lineinfile: + path: "{{ zabbix_agent_cfg }}" + regexp: "^Hostname=.*" + line: "Hostname={{ansible_hostname}}" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Reconfigure zabbix-agent2 hostname + ansible.builtin.lineinfile: + path: "{{ zabbix_agent_cfg }}" + regexp: "^UserParameter=.*" + insertafter: '^# UserParameter=' + line: "UserParameter=system.temperature,vcgencmd measure_temp" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Reconfigure zabbix-agent2 hostname + ansible.builtin.lineinfile: + path: "{{ zabbix_agent_cfg }}" + regexp: "^HostMetadata=.*" + insertafter: '^# HostMetadata=' + line: "HostMetadata=linux;jaydee" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Add the user 'james' with a bash shell, appending the group 'admins' and 'developers' to the user's groups + ansible.builtin.user: + name: zabbix + groups: video + append: yes + when: inventory_hostname not in groups['nas'] + + + - name: Restart zabbix-agent2 service + ansible.builtin.service: + name: zabbix-agent.service + state: restarted + enabled: true + become: true + when: inventory_hostname not in groups['nas'] + + - name: Restart agent + ansible.builtin.shell: /etc/init.d/ZabbixAgent.sh restart + when: inventory_hostname in groups['nas'] \ No newline at end of file diff --git a/playbooks/import_media.yml b/playbooks/import_media.yml new file mode 100644 index 0000000..b2fc864 --- /dev/null +++ b/playbooks/import_media.yml @@ -0,0 +1,6 @@ +- hosts: nas + name: Import media + become: true + tasks: + - name: Import media + ansible.builtin.shell: "(python3 /share/Data/__GITLAB/python/auto_import.py >/dev/null 2>&1 &)" From f8ce4d0dd7ec337324ddaf9ab09a00f84bc9fc17 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 8 Jul 2024 20:30:27 +0200 Subject: [PATCH 216/374] bitwarden --- playbooks/import_media.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/playbooks/import_media.yml b/playbooks/import_media.yml index b2fc864..a595d49 100644 --- a/playbooks/import_media.yml +++ b/playbooks/import_media.yml @@ -1,6 +1,5 @@ - hosts: nas name: Import media - become: true tasks: - name: Import media ansible.builtin.shell: "(python3 /share/Data/__GITLAB/python/auto_import.py >/dev/null 2>&1 &)" From 045dba4f3eeb0b528b8b6d328af1527dfaf9ed9e Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 8 Jul 2024 20:33:10 +0200 Subject: [PATCH 217/374] bitwarden --- playbooks/import_media.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playbooks/import_media.yml b/playbooks/import_media.yml index a595d49..3d482fe 100644 --- a/playbooks/import_media.yml +++ b/playbooks/import_media.yml @@ -2,4 +2,6 @@ name: Import media tasks: - name: Import media - ansible.builtin.shell: "(python3 /share/Data/__GITLAB/python/auto_import.py >/dev/null 2>&1 &)" + ansible.builtin.shell: "(/share/ZFS530_DATA/.qpkg/QPython312/bin/python3 /share/Data/__GITLAB/python/auto_import.py >/dev/null 2>&1 &)" + async: 10 + poll: 0 \ No newline at end of file From 844b3d0fa9591329fcc3c79e598b63b66a835ae6 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 8 Jul 2024 20:34:45 +0200 Subject: [PATCH 218/374] bitwarden --- playbooks/import_media.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/import_media.yml b/playbooks/import_media.yml index 3d482fe..e3e0807 100644 --- a/playbooks/import_media.yml +++ b/playbooks/import_media.yml @@ -1,5 +1,6 @@ - hosts: nas name: Import media + gather_facts: false tasks: - name: Import media ansible.builtin.shell: "(/share/ZFS530_DATA/.qpkg/QPython312/bin/python3 /share/Data/__GITLAB/python/auto_import.py >/dev/null 2>&1 &)" From 1c21541ff77bc84a3a283b0b60f90b2cd1e2f53a Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 8 Jul 2024 21:49:42 +0200 Subject: [PATCH 219/374] bitwarden --- hosts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts.yml b/hosts.yml index 24950cd..01accd2 100644 --- a/hosts.yml +++ b/hosts.yml @@ -34,6 +34,7 @@ datacenter: ansible_become_user: root ansible_become_password: q ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + ryzen: hosts: 192.168.77.15: @@ -64,6 +65,7 @@ datacenter: ansible_ssh_pass: l4c1j4yd33Du5lo ansible_become_user: root ansible_become_password: l4c1j4yd33Du5lo + ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" rhasspy: hosts: 192.168.77.16[6:7] From fc853ca2987dbfa7921b4a85adb5d1cbe2a2711c Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 8 Jul 2024 22:02:50 +0200 Subject: [PATCH 220/374] bitwarden --- hosts.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/hosts.yml b/hosts.yml index 01accd2..740e79f 100644 --- a/hosts.yml +++ b/hosts.yml @@ -65,7 +65,6 @@ datacenter: ansible_ssh_pass: l4c1j4yd33Du5lo ansible_become_user: root ansible_become_password: l4c1j4yd33Du5lo - ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" rhasspy: hosts: 192.168.77.16[6:7] @@ -124,7 +123,6 @@ datacenter: # ansible_user: admin # ansible_pass: l4c1!j4yd33?Du5lo1 ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 - ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" fog: hosts: 192.168.77.108: From e0945fec0543c1cd9b8dcfeef96ea2d181a6d3db Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 8 Jul 2024 22:39:36 +0200 Subject: [PATCH 221/374] upt playbook --- playbooks/install_mqtt_srv.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index c3fad54..51dfbc7 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -27,10 +27,19 @@ when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Upload service script + - name: Upload service script1 + ansible.builtin.copy: + src: scripts/mqtt_srv.sh + dest: /etc/init.d/ + mode: '755' + owner: admin + when: inventory_hostname in groups['nas'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + + - name: Upload service script2 ansible.builtin.copy: src: scripts/mqtt_srv.py - dest: /share/Data/__GITLAB/mqtt_srv/ + dest: /usr/bin/ mode: '755' owner: admin when: inventory_hostname in groups['nas'] @@ -63,7 +72,7 @@ become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Install bottle python package1 - ansible.builtin.shell: "(/etc/init.d/mqtt restart >/dev/null 2>&1 &)" + ansible.builtin.shell: "(/etc/init.d/mqtt_srv.sh restart >/dev/null 2>&1 &)" async: 10 poll: 0 when: inventory_hostname in groups['nas'] From 9ac9ff0e45f81bc96be87da66e3fc6490f7e8568 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 8 Jul 2024 22:58:17 +0200 Subject: [PATCH 222/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 51dfbc7..a51ec44 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -71,7 +71,7 @@ when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Install bottle python package1 + - name: Restart mqtt service ansible.builtin.shell: "(/etc/init.d/mqtt_srv.sh restart >/dev/null 2>&1 &)" async: 10 poll: 0 From 12cff6ca07bb583061abda8b232179c89b69118e Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:21:30 +0200 Subject: [PATCH 223/374] upt playbook --- playbooks/install_mqtt_srv.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index a51ec44..9e33fb9 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -18,6 +18,7 @@ become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + - name: Upload service script ansible.builtin.copy: src: scripts/mqtt_srv.py @@ -27,6 +28,25 @@ when: inventory_hostname not in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + - name: Upload service script1 + ansible.builtin.copy: + src: scripts/mqtt_srv.sh + dest: /jffs/scripts/mqtt_srv/ + mode: '755' + owner: root + when: inventory_hostname in groups['router'] + become: false + + + - name: Upload service script + ansible.builtin.copy: + src: scripts/mqtt_srv.py + dest: /jffs/scripts/mqtt_srv/ + mode: '755' + owner: root + when: inventory_hostname not in groups['router'] + become: false + - name: Upload service script1 ansible.builtin.copy: src: scripts/mqtt_srv.sh @@ -77,7 +97,13 @@ poll: 0 when: inventory_hostname in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - + + - name: Restart mqtt service + ansible.builtin.shell: "(/jffs/scripts/mqtt_srv/mqtt_srv.sh restart >/dev/null 2>&1 &)" + async: 10 + poll: 0 + when: inventory_hostname in groups['router'] + become: false \ No newline at end of file From 7ac519c756174ea9a9def257cefcf855c6f251d4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:25:29 +0200 Subject: [PATCH 224/374] upt playbook --- playbooks/install_mqtt_srv.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 9e33fb9..9c807db 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -73,8 +73,8 @@ - ping3 - psutil - autorandr - when: inventory_hostname not in groups['nas'] - become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + when: inventory_hostname not in groups['nas','router'] + become: "{{ 'no' if inventory_hostname in groups['nas','router'] else 'yes' }}" - name: Just force systemd to reread configs (2.4 and above) @@ -97,7 +97,7 @@ poll: 0 when: inventory_hostname in groups['nas'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - + - name: Restart mqtt service ansible.builtin.shell: "(/jffs/scripts/mqtt_srv/mqtt_srv.sh restart >/dev/null 2>&1 &)" async: 10 From 50110e773ce27753a02ed98f7dc0a3fb9b3927d9 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:27:25 +0200 Subject: [PATCH 225/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 9c807db..4092fbd 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -6,7 +6,7 @@ ansible.builtin.apt: name: - python3-pip - when: inventory_hostname not in groups['nas'] + when: inventory_hostname not in groups['nas','router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" From 362355675f521f8ab1ba77e8975b19a3915121c0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:27:36 +0200 Subject: [PATCH 226/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 4092fbd..6e5bdd2 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -2,7 +2,7 @@ name: Install mqtt_srv ignore_unreachable: false tasks: - - name: Install bottle python package + - name: Install python3-pip ansible.builtin.apt: name: - python3-pip From 6a26651b968dd4f968d1d9d5e6ccffcea24e69da Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:29:35 +0200 Subject: [PATCH 227/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 6e5bdd2..2df0a40 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -6,7 +6,7 @@ ansible.builtin.apt: name: - python3-pip - when: inventory_hostname not in groups['nas','router'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" From 1c8f7e7431d24cfea1db6804e42e70d373e38651 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:32:15 +0200 Subject: [PATCH 228/374] upt playbook --- playbooks/install_mqtt_srv.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 2df0a40..45318b5 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -14,7 +14,7 @@ ansible.builtin.copy: src: services/mqtt_srv.service dest: /etc/systemd/system/ - when: inventory_hostname not in groups['nas'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" @@ -25,7 +25,7 @@ dest: /usr/bin/ mode: '755' owner: root - when: inventory_hostname not in groups['nas'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Upload service script1 @@ -44,7 +44,7 @@ dest: /jffs/scripts/mqtt_srv/ mode: '755' owner: root - when: inventory_hostname not in groups['router'] + when: inventory_hostname in groups['router'] become: false - name: Upload service script1 @@ -73,14 +73,14 @@ - ping3 - psutil - autorandr - when: inventory_hostname not in groups['nas','router'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas','router'] else 'yes' }}" - name: Just force systemd to reread configs (2.4 and above) ansible.builtin.systemd: daemon_reload: true - when: inventory_hostname not in groups['nas'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" @@ -88,7 +88,7 @@ ansible.builtin.service: name: mqtt_srv.service state: restarted - when: inventory_hostname not in groups['nas'] + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Restart mqtt service From ea4f494540a7cd50b49edd96f57aedcb1b23b99b Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:34:45 +0200 Subject: [PATCH 229/374] upt playbook --- playbooks/install_mqtt_srv.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 45318b5..09e0c62 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -33,7 +33,7 @@ src: scripts/mqtt_srv.sh dest: /jffs/scripts/mqtt_srv/ mode: '755' - owner: root + owner: admin when: inventory_hostname in groups['router'] become: false @@ -43,7 +43,7 @@ src: scripts/mqtt_srv.py dest: /jffs/scripts/mqtt_srv/ mode: '755' - owner: root + owner: admin when: inventory_hostname in groups['router'] become: false From 016e9fb1880a56f887fe65c4cb3ff206328e586f Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:50:40 +0200 Subject: [PATCH 230/374] upt playbook --- hosts.yml | 50 +++++++++++++++++++++++++++++++++- playbooks/install_mqtt_srv.yml | 2 +- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/hosts.yml b/hosts.yml index 740e79f..0e3ead3 100644 --- a/hosts.yml +++ b/hosts.yml @@ -18,6 +18,7 @@ datacenter: ansible_become_password: lacijaydee ssh_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + localhost1: hosts: localhost @@ -27,6 +28,7 @@ datacenter: hosts: 192.168.77.12: vars: + jaydee_install_mqtt_srv: true ansible_python_interpreter: auto_silent ansible_ssh_user: jd ansible_ssh_pass: q @@ -82,7 +84,53 @@ datacenter: ansible_port: 5985 ansible_winrm_server_cert_validation: ignore ansible_winrm_kerberos_delegation: true\ - + mqtt_srv: + children: + router: + hosts: + 192.168.77.1 + vars: + ansible_python_interpreter: /opt/bin/python + ansible_user: admin + ansible_pass: l4c1!j4yd33?Du5lo + ansible_ssh_user: admin + ansible_ssh_pass: l4c1!j4yd33?Du5lo + raspberrypi5: + hosts: + 192.168.77.238 + vars: + ansible_python_interpreter: /usr/bin/python + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_become_user: root + ansible_become_password: l4c1j4yd33Du5lo + nas: + hosts: + 192.168.77.106: + vars: + ansible_ssh_user: admin + ansible_ssh_pass: l4c1!j4yd33?Du5lo + become_method: su + become_user: admin + # ansible_user: admin + # ansible_pass: l4c1!j4yd33?Du5lo1 + ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 + fog: + hosts: + 192.168.77.108: + vars: + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_become_user: root + ansible_become_password: q + zabbix: + hosts: + 192.168.77.216: + vars: + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_become_user: root + ansible_become_password: q containers: children: router: diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 09e0c62..1cfc487 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -1,6 +1,6 @@ - hosts: datacenter name: Install mqtt_srv - ignore_unreachable: false + ignore_unreachable: true tasks: - name: Install python3-pip ansible.builtin.apt: From 51e35870835e98cfe8bd2024fe90d02485440f17 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:50:55 +0200 Subject: [PATCH 231/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 1cfc487..a9397d5 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -1,4 +1,4 @@ -- hosts: datacenter +- hosts: mqtt_srv name: Install mqtt_srv ignore_unreachable: true tasks: From 20d954ed3f05a4f8bf982abe278476610156be69 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:54:16 +0200 Subject: [PATCH 232/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index a9397d5..f3b0d35 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -1,6 +1,6 @@ - hosts: mqtt_srv name: Install mqtt_srv - ignore_unreachable: true + ignore_unreachable: false tasks: - name: Install python3-pip ansible.builtin.apt: From 2b88f1b008fdfa3e1fdeed847a70f46d7eab4140 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 00:58:19 +0200 Subject: [PATCH 233/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index f3b0d35..2bf6f29 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -6,6 +6,8 @@ ansible.builtin.apt: name: - python3-pip + update_cache: yes + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" From d4794b933ded4a8ebe69f8a907d8e4f5d6b43414 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 01:00:33 +0200 Subject: [PATCH 234/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 2bf6f29..4b4b4f5 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -76,7 +76,7 @@ - psutil - autorandr when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] - become: "{{ 'no' if inventory_hostname in groups['nas','router'] else 'yes' }}" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Just force systemd to reread configs (2.4 and above) From d8dd6d4c3582c3345baf4cff64ea1d4953c98b48 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 01:03:21 +0200 Subject: [PATCH 235/374] upt playbook --- hosts.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/hosts.yml b/hosts.yml index 0e3ead3..e142a0b 100644 --- a/hosts.yml +++ b/hosts.yml @@ -95,15 +95,6 @@ datacenter: ansible_pass: l4c1!j4yd33?Du5lo ansible_ssh_user: admin ansible_ssh_pass: l4c1!j4yd33?Du5lo - raspberrypi5: - hosts: - 192.168.77.238 - vars: - ansible_python_interpreter: /usr/bin/python - ansible_ssh_user: jd - ansible_ssh_pass: q - ansible_become_user: root - ansible_become_password: l4c1j4yd33Du5lo nas: hosts: 192.168.77.106: @@ -115,14 +106,29 @@ datacenter: # ansible_user: admin # ansible_pass: l4c1!j4yd33?Du5lo1 ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 - fog: + morefine: hosts: - 192.168.77.108: + 192.168.77.12: vars: + jaydee_install_mqtt_srv: true + ansible_python_interpreter: auto_silent ansible_ssh_user: jd ansible_ssh_pass: q + ansible_password: q ansible_become_user: root ansible_become_password: q + ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + + ryzen: + hosts: + 192.168.77.15: + vars: + ansible_python_interpreter: auto_silent + ansible_ssh_user: root + ansible_ssh_pass: lacijaydee + ansible_password: lacijaydee + ansible_become_user: root + ansible_become_password: lacijaydee zabbix: hosts: 192.168.77.216: From 7d65f7f8c6a9130c6742ad469f94b65453c33817 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 01:05:10 +0200 Subject: [PATCH 236/374] upt playbook --- hosts.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hosts.yml b/hosts.yml index e142a0b..0dd412a 100644 --- a/hosts.yml +++ b/hosts.yml @@ -129,14 +129,7 @@ datacenter: ansible_password: lacijaydee ansible_become_user: root ansible_become_password: lacijaydee - zabbix: - hosts: - 192.168.77.216: - vars: - ansible_ssh_user: jd - ansible_ssh_pass: q - ansible_become_user: root - ansible_become_password: q + containers: children: router: From 9887df89022c4556f03c39468ec07da878e9f070 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 01:12:28 +0200 Subject: [PATCH 237/374] upt playbook --- hosts.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/hosts.yml b/hosts.yml index 0dd412a..0df2ecf 100644 --- a/hosts.yml +++ b/hosts.yml @@ -117,18 +117,8 @@ datacenter: ansible_password: q ansible_become_user: root ansible_become_password: q - ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" - ryzen: - hosts: - 192.168.77.15: - vars: - ansible_python_interpreter: auto_silent - ansible_ssh_user: root - ansible_ssh_pass: lacijaydee - ansible_password: lacijaydee - ansible_become_user: root - ansible_become_password: lacijaydee + containers: children: From 6140c0fdb09fa05a65543c54d46270377d6f6c65 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 01:14:59 +0200 Subject: [PATCH 238/374] upt playbook --- hosts.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 0df2ecf..0bc50d9 100644 --- a/hosts.yml +++ b/hosts.yml @@ -118,7 +118,16 @@ datacenter: ansible_become_user: root ansible_become_password: q - + ryzen: + hosts: + 192.168.77.15: + vars: + ansible_python_interpreter: auto_silent + ansible_ssh_user: root + ansible_ssh_pass: lacijaydee + ansible_password: lacijaydee + ansible_become_user: root + ansible_become_password: lacijaydee containers: children: From 3327ffe530028934e8ced4aae9a536f67c61c167 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 01:51:42 +0200 Subject: [PATCH 239/374] upt playbook --- playbooks/install_mqtt_srv.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 4b4b4f5..39b5678 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -1,6 +1,7 @@ - hosts: mqtt_srv name: Install mqtt_srv ignore_unreachable: false + ignore_errors: true tasks: - name: Install python3-pip ansible.builtin.apt: From 1e5ef71ef8778f66424e4811caa49a61a715d564 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 01:58:28 +0200 Subject: [PATCH 240/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 39b5678..016fa84 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -1,6 +1,6 @@ - hosts: mqtt_srv name: Install mqtt_srv - ignore_unreachable: false + ignore_unreachable: true ignore_errors: true tasks: - name: Install python3-pip From 094191ea54b7f0b412ed1a15a18f659ed80ef4a2 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 9 Jul 2024 02:05:42 +0200 Subject: [PATCH 241/374] upt playbook --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 016fa84..39b5678 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -1,6 +1,6 @@ - hosts: mqtt_srv name: Install mqtt_srv - ignore_unreachable: true + ignore_unreachable: false ignore_errors: true tasks: - name: Install python3-pip From 6f780242c5d33d5c3a569af10f641e34ab9d66a0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 11 Jul 2024 01:24:22 +0200 Subject: [PATCH 242/374] upt playbook --- hosts.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hosts.yml b/hosts.yml index 0bc50d9..0f291f6 100644 --- a/hosts.yml +++ b/hosts.yml @@ -86,6 +86,16 @@ datacenter: ansible_winrm_kerberos_delegation: true\ mqtt_srv: children: + omv: + hosts: + 192.168.77.189: + vars: + ansible_user: root + ansible_password: lacijaydee + ansible_ssh_user: root + ansible_ssh_pass: lacijaydee + ansible_become_user: root + ansible_become_password: lacijaydee router: hosts: 192.168.77.1 From a2ba1ae83ea37c9710d008d8dd0488cb136388f2 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 11 Jul 2024 02:20:05 +0200 Subject: [PATCH 243/374] upt playbook --- hosts.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 0f291f6..6e7b16c 100644 --- a/hosts.yml +++ b/hosts.yml @@ -83,9 +83,20 @@ datacenter: ansible_connection: winrm ansible_port: 5985 ansible_winrm_server_cert_validation: ignore - ansible_winrm_kerberos_delegation: true\ + ansible_winrm_kerberos_delegation: true mqtt_srv: children: + amd: + hosts: + 192.168.77.4: + vars: + ansible_user: root + ansible_password: l4c1j4yd33Du5lo + ansible_ssh_user: root + ansible_ssh_pass: l4c1j4yd33Du5lo + ansible_become_user: root + ansible_become_password: l4c1j4yd33Du5lo + omv: hosts: 192.168.77.189: From 92f3fea8d0d8389c7215b881ea7d5a45b85aff7a Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 25 Jul 2024 14:00:42 +0200 Subject: [PATCH 244/374] bitwarden --- playbooks/00_install_zabbix_agent.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index 50cbdb6..2421c58 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -1,7 +1,7 @@ - hosts: datacenter name: Install zabbix agent vars: - ZABBIX_SERVER_IP: "192.168.77.216" + ZABBIX_SERVER: "zabbix-server.lan" tasks: - name: Combine list1 and list2 into a merged_list var @@ -85,7 +85,7 @@ ansible.builtin.lineinfile: path: "{{ zabbix_agent_cfg }}" regexp: "^ServerActive=.*" - line: "ServerActive={{ ZABBIX_SERVER_IP }}" + line: "ServerActive={{ ZABBIX_SERVER }}" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Reconfigure zabbix agent ListenPort @@ -108,11 +108,18 @@ - name: Reconfigure zabbix-agent2 hostname ansible.builtin.lineinfile: path: "{{ zabbix_agent_cfg }}" - regexp: "^UserParameter=.*" insertafter: '^# UserParameter=' line: "UserParameter=system.temperature,vcgencmd measure_temp" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + - name: Reconfigure zabbix-agent2 config + ansible.builtin.lineinfile: + path: "{{ zabbix_agent_cfg }}" + insertafter: '^# UserParameter=' + line: "UserParameter=system.certs,python3 /share/ZFS530_DATA/.qpkg/ZabbixAgent/cert_check2.py" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + when: inventory_hostname not in groups['nas'] + - name: Reconfigure zabbix-agent2 hostname ansible.builtin.lineinfile: path: "{{ zabbix_agent_cfg }}" From a5a260d9ed6006f2c4182d5269675347e461fa84 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 18 Aug 2024 23:49:57 +0200 Subject: [PATCH 245/374] bitwarden --- playbooks/00_check_for_reboot.yml | 4 ++-- playbooks/00_install_zabbix_agent.yml | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/playbooks/00_check_for_reboot.yml b/playbooks/00_check_for_reboot.yml index 4fd1d42..738615b 100644 --- a/playbooks/00_check_for_reboot.yml +++ b/playbooks/00_check_for_reboot.yml @@ -1,7 +1,7 @@ - hosts: odroid_cluster name: Check for reboot become: true - gather_facts: no + gather_facts: false tasks: - name: Check if file exists using stat module stat: @@ -13,7 +13,7 @@ var: file_status.stat.exists - name: Reboot the server tags: reboot - become: yes + become: true become_user: root shell: "sleep 5 && reboot" async: 1 diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index 2421c58..659fcbf 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -25,25 +25,26 @@ # ansible.builtin.copy: # src: packages/zabbix-release_6.4-1+ubuntu22.04_all.deb # dest: /tmp/ - - name: Install a .deb package from the internet + - name: Install a .deb package from the internet1 ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/ubuntu-arm64/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb when: - ansible_facts.architecture != "armv7l" and ansible_distribution == "Ubuntu" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Install a .deb package from the internet + - name: Install a .deb package from the internet2 ansible.builtin.apt: #deb: https://repo.zabbix.com/zabbix/6.4/raspbian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb deb: https://repo.zabbix.com/zabbix/7.0/raspbian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian11_all.deb retries: 5 delay: 5 when: - - ansible_facts.architecture == "armv7l" + - ansible_facts.architecture == "armv7l" or ansible_facts.architecture == "aarch64" + ignore_errors: true become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Install a .deb package from the internet + - name: Install a .deb package from the internet3 ansible.builtin.apt: deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian11_all.deb @@ -51,14 +52,13 @@ - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "11" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - - name: Install a .deb package from the internet + - name: Install a .deb package from the internet4 ansible.builtin.apt: #deb: https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb deb: https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian12_all.deb when: - - ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "12" - - + - ansible_facts.architecture != "armv7l" and ansible_facts.architecture != "aarch64" and ansible_distribution == "Debian" and ansible_distribution_major_version == "12" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" # - name: Install a .deb package localy # ansible.builtin.apt: @@ -67,7 +67,9 @@ ansible.builtin.apt: name: - zabbix-agent2 - - zabbix-agent2-plugin-* + - zabbix-agent2-plugin-mongodb + - zabbix-agent2-plugin-postgresql + - zabbix-agent2-plugin-mssql update_cache: yes when: inventory_hostname not in groups['nas'] become: "{{ false if inventory_hostname in groups['nas'] else true }}" @@ -98,6 +100,7 @@ # path: /"{{ zabbix_agent_cfg }}" # regexp: "^ListenIP=.*" # line: "ListenIP=0.0.0.0" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Reconfigure zabbix-agent2 hostname ansible.builtin.lineinfile: path: "{{ zabbix_agent_cfg }}" @@ -134,7 +137,7 @@ groups: video append: yes when: inventory_hostname not in groups['nas'] - + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Restart zabbix-agent2 service ansible.builtin.service: From edf96e2bd63fd2a797f657d884e79df10f574132 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 20 Sep 2024 14:56:09 +0200 Subject: [PATCH 246/374] bitwarden --- hosts.yml | 2 +- playbooks/05_install_rhasspy.yml | 9 ++++----- playbooks/install_mqtt_srv.yml | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hosts.yml b/hosts.yml index 6e7b16c..b86e418 100644 --- a/hosts.yml +++ b/hosts.yml @@ -69,7 +69,7 @@ datacenter: ansible_become_password: l4c1j4yd33Du5lo rhasspy: hosts: - 192.168.77.16[6:7] + 192.168.77.224 vars: ansible_user: jd ansible_ssh_pass: q diff --git a/playbooks/05_install_rhasspy.yml b/playbooks/05_install_rhasspy.yml index 6dc8884..bcb1b6e 100644 --- a/playbooks/05_install_rhasspy.yml +++ b/playbooks/05_install_rhasspy.yml @@ -1,7 +1,6 @@ - hosts: rhasspy name: Install rhasspy become: true - become_user: root tasks: - name: Set a hostname ansible.builtin.hostname: @@ -113,7 +112,7 @@ mode: '0755' - name: Upload config ansible.builtin.copy: - src: /etc/ansible/playbooks/files/conf/rhasspy/profile.json + src: conf/rhasspy/profile.json dest: /home/jd/.config/rhasspy/profiles/en/profile.json owner: jd group: jd @@ -132,9 +131,9 @@ name: jd append: true groups: docker - - name: Install pip modules - ansible.builtin.pip: - name: docker + # - name: Install pip modules + # ansible.builtin.pip: + # name: docker - name: Pull image community.docker.docker_image: diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 39b5678..f1b6c49 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -91,6 +91,7 @@ ansible.builtin.service: name: mqtt_srv.service state: restarted + enabled: true when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" From 879f3b2e69c761af91730dbf9b2685311cb40f62 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 10 Oct 2024 22:15:54 +0200 Subject: [PATCH 247/374] bitwarden --- hosts.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hosts.yml b/hosts.yml index b86e418..dc37344 100644 --- a/hosts.yml +++ b/hosts.yml @@ -107,6 +107,16 @@ datacenter: ansible_ssh_pass: lacijaydee ansible_become_user: root ansible_become_password: lacijaydee + omv: + hosts: + 192.168.77.189: + vars: + ansible_user: jd + ansible_password: q + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_become_user: root + ansible_become_password: q router: hosts: 192.168.77.1 From bfe7eb63408454d09851509c66f10b38d15d5d8e Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 10 Oct 2024 22:22:25 +0200 Subject: [PATCH 248/374] bitwarden --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index dc37344..a6dfb36 100644 --- a/hosts.yml +++ b/hosts.yml @@ -107,7 +107,7 @@ datacenter: ansible_ssh_pass: lacijaydee ansible_become_user: root ansible_become_password: lacijaydee - omv: + rack: hosts: 192.168.77.189: vars: From 1c5bb2abb171d5d90199d3fe6b898c1919ee4ac6 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 10 Oct 2024 22:26:05 +0200 Subject: [PATCH 249/374] bitwarden --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index a6dfb36..9e23f2a 100644 --- a/hosts.yml +++ b/hosts.yml @@ -109,7 +109,7 @@ datacenter: ansible_become_password: lacijaydee rack: hosts: - 192.168.77.189: + 192.168.77.55: vars: ansible_user: jd ansible_password: q From c1b284f0ac7dde6579777df6061cbaefa191a47e Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 10 Oct 2024 22:27:59 +0200 Subject: [PATCH 250/374] bitwarden --- hosts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts.yml b/hosts.yml index 9e23f2a..491e671 100644 --- a/hosts.yml +++ b/hosts.yml @@ -115,6 +115,7 @@ datacenter: ansible_password: q ansible_ssh_user: jd ansible_ssh_pass: q + become_method: su ansible_become_user: root ansible_become_password: q router: From f9bacc228497caaa95bd08abf3ebc6fd42871a98 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 12 Oct 2024 23:42:49 +0200 Subject: [PATCH 251/374] bitwarden --- playbooks/install_mqtt_srv.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index f1b6c49..fb7072c 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -3,14 +3,14 @@ ignore_unreachable: false ignore_errors: true tasks: - - name: Install python3-pip - ansible.builtin.apt: - name: - - python3-pip - update_cache: yes + # - name: Install python3-pip + # ansible.builtin.apt: + # name: + # - python3-pip + # update_cache: yes - when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] - become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + # when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] + # become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Upload service config From bbd1146fc65f3de129bfd3d231f70fa1c8337aea Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 15 Oct 2024 13:05:43 +0200 Subject: [PATCH 252/374] bitwarden --- playbooks/05_install_docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index ab917f3..bc46d16 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -2,7 +2,7 @@ name: Install docker1 become: true become_user: root - gather_facts: no + gather_facts: false tasks: - name: Install docker ansible.builtin.apt: @@ -35,7 +35,6 @@ dest: "/etc/systemd/system/docker.service.d/override.conf" content: | [Service] - ExecStart= ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 - name: Just force systemd to reread configs (2.4 and above) ansible.builtin.systemd_service: From 2c4099298c43a14d62dd98f7467f7637746193b6 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 15 Oct 2024 13:06:53 +0200 Subject: [PATCH 253/374] bitwarden --- playbooks/05_install_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index bc46d16..4bcb4d7 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -35,7 +35,7 @@ dest: "/etc/systemd/system/docker.service.d/override.conf" content: | [Service] - ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 + "ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375" - name: Just force systemd to reread configs (2.4 and above) ansible.builtin.systemd_service: daemon_reload: true From 130f7bfdfaaa06eb138f3f11bc0a7ada87ecbec0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 15 Oct 2024 13:08:00 +0200 Subject: [PATCH 254/374] bitwarden --- playbooks/05_install_docker.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index 4bcb4d7..f60ff6a 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -35,11 +35,4 @@ dest: "/etc/systemd/system/docker.service.d/override.conf" content: | [Service] - "ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375" - - name: Just force systemd to reread configs (2.4 and above) - ansible.builtin.systemd_service: - daemon_reload: true - - name: Restart docker service - ansible.builtin.service: - name: docker.service - state: restarted \ No newline at end of file + ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 From e00f6df3c9a3f38c45cb446553bb704a14be1070 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 15 Oct 2024 13:10:31 +0200 Subject: [PATCH 255/374] bitwarden --- playbooks/05_install_docker.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index f60ff6a..5b67f71 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -36,3 +36,13 @@ content: | [Service] ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 + + - name: Just force systemd to reread configs + ansible.builtin.systemd_service: + daemon_reload: true + + - name: Restart docker service + ansible.builtin.service: + name: docker.service + state: restarted + \ No newline at end of file From 8cc19ea2408c66bbe8faa26e111205a6ad1a4851 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 15 Oct 2024 13:24:38 +0200 Subject: [PATCH 256/374] bitwarden --- playbooks/05_install_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index 5b67f71..4875cf6 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -35,7 +35,7 @@ dest: "/etc/systemd/system/docker.service.d/override.conf" content: | [Service] - ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 + ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 - name: Just force systemd to reread configs ansible.builtin.systemd_service: From a7d71e6fc92e9f344520224dd271079a1b72478b Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 22 Oct 2024 17:59:39 +0200 Subject: [PATCH 257/374] bitwarden --- playbooks/00_install_zabbix_agent.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index 659fcbf..adac9db 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -122,6 +122,18 @@ line: "UserParameter=system.certs,python3 /share/ZFS530_DATA/.qpkg/ZabbixAgent/cert_check2.py" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" when: inventory_hostname not in groups['nas'] + - name: Reconfigure zabbix-agent2 config + ansible.builtin.lineinfile: + path: "{{ zabbix_agent_cfg }}" + insertafter: '^# UserParameter=' + line: "UserParameter=rpi.hw.temp,vcgencmd measure_temp" + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" + when: inventory_hostname not in groups['raspberrypi5'] + + + + + - name: Reconfigure zabbix-agent2 hostname ansible.builtin.lineinfile: From 187e61585117250641b28424c950b702570c89e7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 22 Oct 2024 18:00:03 +0200 Subject: [PATCH 258/374] bitwarden --- playbooks/00_install_zabbix_agent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index adac9db..902ac2b 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -126,7 +126,7 @@ ansible.builtin.lineinfile: path: "{{ zabbix_agent_cfg }}" insertafter: '^# UserParameter=' - line: "UserParameter=rpi.hw.temp,vcgencmd measure_temp" + line: "UserParameter=rpi.hw.temp,/usr/bin/vcgencmd measure_temp" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" when: inventory_hostname not in groups['raspberrypi5'] From 1f27f58b376621ad5db622aca70c2190ba87a190 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 22 Oct 2024 18:05:50 +0200 Subject: [PATCH 259/374] bitwarden --- playbooks/00_install_zabbix_agent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index 902ac2b..516c202 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -128,7 +128,7 @@ insertafter: '^# UserParameter=' line: "UserParameter=rpi.hw.temp,/usr/bin/vcgencmd measure_temp" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - when: inventory_hostname not in groups['raspberrypi5'] + when: inventory_hostname in groups['raspberrypi5'] From fae6f122c1eea7e20e277a25f12407b135438bde Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 22 Oct 2024 22:31:40 +0200 Subject: [PATCH 260/374] bitwarden --- playbooks/00_install_zabbix_agent.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index 516c202..d8d001c 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -121,7 +121,8 @@ insertafter: '^# UserParameter=' line: "UserParameter=system.certs,python3 /share/ZFS530_DATA/.qpkg/ZabbixAgent/cert_check2.py" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - when: inventory_hostname not in groups['nas'] + when: inventory_hostname in groups['nas'] + - name: Reconfigure zabbix-agent2 config ansible.builtin.lineinfile: path: "{{ zabbix_agent_cfg }}" From dbce5b295a89338cfeeca7f92e3b434e0407aa35 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 22 Oct 2024 22:38:08 +0200 Subject: [PATCH 261/374] bitwarden --- playbooks/00_install_zabbix_agent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index d8d001c..e0eab97 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -119,7 +119,7 @@ ansible.builtin.lineinfile: path: "{{ zabbix_agent_cfg }}" insertafter: '^# UserParameter=' - line: "UserParameter=system.certs,python3 /share/ZFS530_DATA/.qpkg/ZabbixAgent/cert_check2.py" + line: "UserParameter=system.certs,/share/ZFS530_DATA/.qpkg/QPython312/bin/python3 /share/ZFS530_DATA/.qpkg/ZabbixAgent/cert_check2.py" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" when: inventory_hostname in groups['nas'] From bc1d30189211943adfee1a1c0cf994fa307c9d24 Mon Sep 17 00:00:00 2001 From: jaydee Date: Tue, 22 Oct 2024 22:45:14 +0200 Subject: [PATCH 262/374] bitwarden --- playbooks/00_install_zabbix_agent.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/00_install_zabbix_agent.yml b/playbooks/00_install_zabbix_agent.yml index e0eab97..d8d001c 100644 --- a/playbooks/00_install_zabbix_agent.yml +++ b/playbooks/00_install_zabbix_agent.yml @@ -119,7 +119,7 @@ ansible.builtin.lineinfile: path: "{{ zabbix_agent_cfg }}" insertafter: '^# UserParameter=' - line: "UserParameter=system.certs,/share/ZFS530_DATA/.qpkg/QPython312/bin/python3 /share/ZFS530_DATA/.qpkg/ZabbixAgent/cert_check2.py" + line: "UserParameter=system.certs,python3 /share/ZFS530_DATA/.qpkg/ZabbixAgent/cert_check2.py" become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" when: inventory_hostname in groups['nas'] From 50fd53aadd711ae3dba1c7f858568458bb4464f2 Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 30 Oct 2024 12:14:02 +0100 Subject: [PATCH 263/374] bitwarden --- playbooks/install_mqtt_srv.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index fb7072c..9d2060a 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -30,7 +30,14 @@ owner: root when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - + - name: Upload service script config + ansible.builtin.copy: + src: scripts/mqtt_srv.cfg + dest: /etc/mqtt_srv + mode: '755' + owner: root + when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] + become: "{{ 'no' if inventory_hostname in groups['nas'] else 'yes' }}" - name: Upload service script1 ansible.builtin.copy: src: scripts/mqtt_srv.sh From 057da92fb9c07cf185d55c46cd75a5637d44459c Mon Sep 17 00:00:00 2001 From: jaydee Date: Wed, 30 Oct 2024 12:17:23 +0100 Subject: [PATCH 264/374] bitwarden --- playbooks/install_mqtt_srv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/install_mqtt_srv.yml b/playbooks/install_mqtt_srv.yml index 9d2060a..394ed1d 100644 --- a/playbooks/install_mqtt_srv.yml +++ b/playbooks/install_mqtt_srv.yml @@ -33,7 +33,7 @@ - name: Upload service script config ansible.builtin.copy: src: scripts/mqtt_srv.cfg - dest: /etc/mqtt_srv + dest: /etc/mqtt_srv/ mode: '755' owner: root when: inventory_hostname not in groups['nas'] and inventory_hostname not in groups['router'] From 91adde523e22b5881c248a446d834002f947cc49 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 10 Nov 2024 22:09:39 +0100 Subject: [PATCH 265/374] bitwarden --- playbooks/restore_container.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 playbooks/restore_container.yaml diff --git a/playbooks/restore_container.yaml b/playbooks/restore_container.yaml new file mode 100644 index 0000000..92fc02f --- /dev/null +++ b/playbooks/restore_container.yaml @@ -0,0 +1,10 @@ +- hosts: nas + name: Sync mailu + ignore_unreachable: false + tasks: + - name: Syncing all + ansible.builtin.shell: 'rsync -avh --delete root@192.168.77.219:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/latest/{{ item }} share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + #ansible.builtin.shell: 'ls -la' + when: inventory_hostname in groups['nas'] + loop: "{{ CONTAINERS }}" \ No newline at end of file From c08bda7c2fcb6cdd1498721cba7f81f6a6de2818 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 10 Nov 2024 22:12:06 +0100 Subject: [PATCH 266/374] bitwarden --- playbooks/restore_container.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/restore_container.yaml b/playbooks/restore_container.yaml index 92fc02f..bc0ab51 100644 --- a/playbooks/restore_container.yaml +++ b/playbooks/restore_container.yaml @@ -3,7 +3,7 @@ ignore_unreachable: false tasks: - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete root@192.168.77.219:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/latest/{{ item }} share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete root@192.168.77.219:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ item }} share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] From b42013a6f12c996ca41a46ff53aebd5ddfdcea6e Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 10 Nov 2024 22:16:53 +0100 Subject: [PATCH 267/374] bitwarden --- playbooks/restore_container.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/restore_container.yaml b/playbooks/restore_container.yaml index bc0ab51..6bba4fb 100644 --- a/playbooks/restore_container.yaml +++ b/playbooks/restore_container.yaml @@ -7,4 +7,4 @@ #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] - loop: "{{ CONTAINERS }}" \ No newline at end of file + loop: '{{ CONTAINERS }}' \ No newline at end of file From 9f5fdc17304fbb30759ca4f52ff69b4bc519a1d0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 10 Nov 2024 22:20:36 +0100 Subject: [PATCH 268/374] bitwarden --- playbooks/restore_container.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/restore_container.yaml b/playbooks/restore_container.yaml index 6bba4fb..114f399 100644 --- a/playbooks/restore_container.yaml +++ b/playbooks/restore_container.yaml @@ -3,8 +3,8 @@ ignore_unreachable: false tasks: - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete root@192.168.77.219:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ item }} share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete root@192.168.77.219:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ CONTAINERS }} share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] - loop: '{{ CONTAINERS }}' \ No newline at end of file + # loop: '{{ CONTAINERS }}' \ No newline at end of file From c035dcb33effb04e99afaa4d35ac167652e158a7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 10 Nov 2024 22:21:26 +0100 Subject: [PATCH 269/374] bitwarden --- playbooks/restore_container.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/restore_container.yaml b/playbooks/restore_container.yaml index 114f399..23553ae 100644 --- a/playbooks/restore_container.yaml +++ b/playbooks/restore_container.yaml @@ -3,7 +3,7 @@ ignore_unreachable: false tasks: - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete root@192.168.77.219:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ CONTAINERS }} share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete root@192.168.77.219:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ CONTAINERS }} /share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] From 8ea4c55846bb1872972d030a463cc7189490b00b Mon Sep 17 00:00:00 2001 From: jaydee Date: Sun, 10 Nov 2024 22:23:03 +0100 Subject: [PATCH 270/374] bitwarden --- playbooks/restore_container.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/restore_container.yaml b/playbooks/restore_container.yaml index 23553ae..30b0c08 100644 --- a/playbooks/restore_container.yaml +++ b/playbooks/restore_container.yaml @@ -3,7 +3,7 @@ ignore_unreachable: false tasks: - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete root@192.168.77.219:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ CONTAINERS }} /share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete root@192.168.77.189:/srv/dev-disk-by-uuid-02fbe97a-cd9a-4511-8bd5-21f8516353ee/docker_data/latest/{{ CONTAINERS }} /share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] From a6814552e07d6d190a8fe7ec42a43367990a185d Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 09:54:56 +0100 Subject: [PATCH 271/374] bitwarden --- hosts.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hosts.yml b/hosts.yml index 491e671..cd25a2d 100644 --- a/hosts.yml +++ b/hosts.yml @@ -149,6 +149,17 @@ datacenter: ansible_password: q ansible_become_user: root ansible_become_password: q + morefine-server: + hosts: + 192.168.77.47: + vars: + jaydee_install_mqtt_srv: true + ansible_python_interpreter: auto_silent + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_password: q + ansible_become_user: root + ansible_become_password: q ryzen: hosts: From abeee5f8d067155f08b466253130743a69ead4ab Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 10:05:24 +0100 Subject: [PATCH 272/374] bitwarden --- playbooks/05_install_docker.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index 4875cf6..3e67224 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -37,9 +37,7 @@ [Service] ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 - - name: Just force systemd to reread configs - ansible.builtin.systemd_service: - daemon_reload: true + - name: Restart docker service ansible.builtin.service: From fcd8f0e92466e51a5a4fec725f318aeb4456a322 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 10:23:44 +0100 Subject: [PATCH 273/374] bitwarden --- playbooks/05_install_docker.yml | 54 +++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index 3e67224..2e78b9f 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -6,25 +6,39 @@ tasks: - name: Install docker ansible.builtin.apt: - name: docker.io - state: present - - name: Install telnet - ansible.builtin.apt: - name: telnet - state: present - - name: Install net-tools - ansible.builtin.apt: - name: net-tools - state: present - - name: Install curl! - ansible.builtin.apt: - name: curl - state: present - - name: Install deps... - ansible.builtin.apt: - name: + name: + - ca-certificates + - curl + - telnet + - net-tools - python3-pip - python3-dev + state: present + - name: Get keys for raspotify + ansible.builtin.shell: + install -m 0755 -d /etc/apt/keyrings + - name: Get keys for raspotify + ansible.builtin.shell: + curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc + - name: Get keys for raspotify + ansible.builtin.shell: + chmod a+r /etc/apt/keyrings/docker.asc + + - name: Get keys for raspotify + ansible.builtin.shell: - + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + - name: Install docker + ansible.builtin.apt: + name: + - docker-ce + - docker-ce-cli + - containerd.io + - docker-buildx-plugin + - docker-compose-plugin + - name: Create a directory docker.service.d ansible.builtin.file: path: /etc/systemd/system/docker.service.d/ @@ -35,9 +49,11 @@ dest: "/etc/systemd/system/docker.service.d/override.conf" content: | [Service] - ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 - + ExecStart=/usr/sbin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 + # - name: Just force systemd to reread configs + # ansible.builtin.systemd_service: + # daemon_reload: true - name: Restart docker service ansible.builtin.service: From 86e7f1df5bb5fd52ec80e98f743afa0d6e36c741 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 10:25:27 +0100 Subject: [PATCH 274/374] bitwarden --- playbooks/05_install_docker.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index 2e78b9f..a501f8e 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -25,11 +25,7 @@ chmod a+r /etc/apt/keyrings/docker.asc - name: Get keys for raspotify - ansible.builtin.shell: - - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + ansible.builtin.shell: echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - name: Install docker ansible.builtin.apt: name: From 574c6f1e70f081e5a85e50066017fd156654a1c0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 10:26:38 +0100 Subject: [PATCH 275/374] bitwarden --- playbooks/05_install_docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index a501f8e..eb5e49f 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -47,9 +47,9 @@ [Service] ExecStart=/usr/sbin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 - # - name: Just force systemd to reread configs - # ansible.builtin.systemd_service: - # daemon_reload: true + - name: Just force systemd to reread configs + ansible.builtin.systemd_service: + daemon_reload: true - name: Restart docker service ansible.builtin.service: From 36d05d3d8b5cd000ea863426aa7dfcd714cb05ac Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 10:32:18 +0100 Subject: [PATCH 276/374] bitwarden --- playbooks/05_install_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/05_install_docker.yml b/playbooks/05_install_docker.yml index eb5e49f..d32c674 100644 --- a/playbooks/05_install_docker.yml +++ b/playbooks/05_install_docker.yml @@ -48,7 +48,7 @@ ExecStart=/usr/sbin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 - name: Just force systemd to reread configs - ansible.builtin.systemd_service: + ansible.builtin.systemd: daemon_reload: true - name: Restart docker service From 2d5c7d8cd5d7de1ac6a211954e6747dd9b6bae80 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 11:13:49 +0100 Subject: [PATCH 277/374] bitwarden --- hosts.yml | 11 +++++++++++ playbooks/sync_container_data.yaml | 1 + 2 files changed, 12 insertions(+) diff --git a/hosts.yml b/hosts.yml index cd25a2d..3e0fd9f 100644 --- a/hosts.yml +++ b/hosts.yml @@ -201,6 +201,17 @@ datacenter: ansible_ssh_pass: q ansible_become_user: root ansible_become_password: l4c1j4yd33Du5lo + morefine-server: + hosts: + 192.168.77.47: + vars: + jaydee_install_mqtt_srv: true + ansible_python_interpreter: auto_silent + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_password: q + ansible_become_user: root + ansible_become_password: q nas: hosts: 192.168.77.106: diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 7909973..d65bc67 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -1,3 +1,4 @@ +--- - name: Changing permission ansible.builtin.shell: 'chown -R root. /share/docker_data/' become: true From c70c758c96b4d47c8d105b3cca5ac758011d4895 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 11:35:42 +0100 Subject: [PATCH 278/374] bitwarden --- playbooks/sync_all_test.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 playbooks/sync_all_test.yaml diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml new file mode 100644 index 0000000..377ae0b --- /dev/null +++ b/playbooks/sync_all_test.yaml @@ -0,0 +1,7 @@ +--- +- name: import a task + hosts: containers + gather_facts: false + tasks: + - debug: + msg: "{{ selected_containers }}" From f7203cbf382234114eafad46618655dbeca969b4 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 11:37:05 +0100 Subject: [PATCH 279/374] bitwarden --- playbooks/sync_all_test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 377ae0b..4c62fad 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -4,4 +4,6 @@ gather_facts: false tasks: - debug: - msg: "{{ selected_containers }}" + msg: "{{ item }}" + loop: "{{ selected_containers }}" + From 47e61f1d0f7924168b4039172c8c0da70d6c8b75 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 11:38:45 +0100 Subject: [PATCH 280/374] bitwarden --- playbooks/sync_all_test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 4c62fad..35cc945 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -7,3 +7,6 @@ msg: "{{ item }}" loop: "{{ selected_containers }}" + - debug: + msg: "{{ item }}" + loop: "{{ selected_host }}" \ No newline at end of file From 80ef2784064be817bed8c32cec5b23841c7226a7 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 11:42:42 +0100 Subject: [PATCH 281/374] bitwarden --- playbooks/sync_all_test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 35cc945..dbd2d49 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -3,6 +3,8 @@ hosts: containers gather_facts: false tasks: + - debug: + msg: "{{ selected_containers }}" - debug: msg: "{{ item }}" loop: "{{ selected_containers }}" From 8c155a22a4cdd677b883a95d9c91c5daf89fcc77 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 11:48:21 +0100 Subject: [PATCH 282/374] bitwarden --- playbooks/sync_all_test.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index dbd2d49..ad35031 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -2,13 +2,15 @@ - name: import a task hosts: containers gather_facts: false + vars: + listjojocomma: "{{ selected_containers | split(',') }}" tasks: - debug: - msg: "{{ selected_containers }}" + msg: "{{ listjojocomma }}" - debug: msg: "{{ item }}" - loop: "{{ selected_containers }}" - + loop: "{{ listjojocomma }}" + - debug: msg: "{{ item }}" loop: "{{ selected_host }}" \ No newline at end of file From 97d1c4ec8f6c08cfeca1d71d08461a1cac6aef36 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 11:51:47 +0100 Subject: [PATCH 283/374] bitwarden --- playbooks/sync_all_test.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index ad35031..60d3962 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -3,14 +3,17 @@ hosts: containers gather_facts: false vars: - listjojocomma: "{{ selected_containers | split(',') }}" + listjojocomma: "{{ selected_containers | replace('[', '')| replace(']','')|[split(',') }}" tasks: - debug: msg: "{{ listjojocomma }}" + when: inventory_hostname in groups['morefine-server'] - debug: msg: "{{ item }}" loop: "{{ listjojocomma }}" + when: inventory_hostname in groups['morefine-server'] - debug: msg: "{{ item }}" - loop: "{{ selected_host }}" \ No newline at end of file + loop: "{{ selected_host }}" + when: inventory_hostname in groups['morefine-server'] \ No newline at end of file From 4e1e3982de05ae9d03634b89987e6c807571c246 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 11:53:04 +0100 Subject: [PATCH 284/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 60d3962..1f17abb 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -3,7 +3,7 @@ hosts: containers gather_facts: false vars: - listjojocomma: "{{ selected_containers | replace('[', '')| replace(']','')|[split(',') }}" + listjojocomma: "{{ selected_containers | replace('\\[', '')| replace('\\]','')|[split(',') }}" tasks: - debug: msg: "{{ listjojocomma }}" From 79c19dfa3dff4cc71193594ebfa0cd9b6599b7dd Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 11:55:14 +0100 Subject: [PATCH 285/374] bitwarden --- playbooks/sync_all_test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 1f17abb..5c407a5 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -3,7 +3,8 @@ hosts: containers gather_facts: false vars: - listjojocomma: "{{ selected_containers | replace('\\[', '')| replace('\\]','')|[split(',') }}" + #listjojocomma: "{{ selected_containers | replace('\\[', '')| replace('\\]','')|[split(',') }}" + listjojocomma: "{{ selected_containers | from_json }}" tasks: - debug: msg: "{{ listjojocomma }}" From cfe83649ec07f403bccd54b3b32542ee16114710 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:01:26 +0100 Subject: [PATCH 286/374] bitwarden --- playbooks/sync_all_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 5c407a5..1ef9614 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -3,8 +3,8 @@ hosts: containers gather_facts: false vars: - #listjojocomma: "{{ selected_containers | replace('\\[', '')| replace('\\]','')|[split(',') }}" - listjojocomma: "{{ selected_containers | from_json }}" + listjojocomma: "{{ selected_containers | split(',') }}" + #listjojocomma: "{{ selected_containers | from_json }}" tasks: - debug: msg: "{{ listjojocomma }}" From e18bccd4f2e21adbf4dc755125dcd65d1623046c Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:07:11 +0100 Subject: [PATCH 287/374] bitwarden --- playbooks/sync_all_test.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 1ef9614..560eb0f 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -6,9 +6,6 @@ listjojocomma: "{{ selected_containers | split(',') }}" #listjojocomma: "{{ selected_containers | from_json }}" tasks: - - debug: - msg: "{{ listjojocomma }}" - when: inventory_hostname in groups['morefine-server'] - debug: msg: "{{ item }}" loop: "{{ listjojocomma }}" From f46e5aa2a754cc2b04ae09e9f3921c4bbc9b1af8 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:07:59 +0100 Subject: [PATCH 288/374] bitwarden --- playbooks/sync_all_test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 560eb0f..1812f1c 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -12,6 +12,5 @@ when: inventory_hostname in groups['morefine-server'] - debug: - msg: "{{ item }}" - loop: "{{ selected_host }}" + msg: "{{ selected_host }}" when: inventory_hostname in groups['morefine-server'] \ No newline at end of file From f6aca2734f59a095a3d73401d23fb93e31fa2b7a Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:08:57 +0100 Subject: [PATCH 289/374] bitwarden --- playbooks/sync_all_test.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 1812f1c..fa5b231 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -2,13 +2,10 @@ - name: import a task hosts: containers gather_facts: false - vars: - listjojocomma: "{{ selected_containers | split(',') }}" - #listjojocomma: "{{ selected_containers | from_json }}" tasks: - debug: msg: "{{ item }}" - loop: "{{ listjojocomma }}" + loop: "{{ selected_containers | split(',') }}" when: inventory_hostname in groups['morefine-server'] - debug: From f1e5b7cae28ccbc9621a318ecbb594c594c44fc3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:13:40 +0100 Subject: [PATCH 290/374] bitwarden --- playbooks/sync_all.yaml | 12 ++++++------ playbooks/sync_container_data.yaml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 9af402b..f7104b9 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -5,7 +5,7 @@ tasks: - include_tasks: stop_containers.yaml name: Stop Containers - when: inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname == {{ selected_server }} - name: Pause for 60 seconds ansible.builtin.pause: seconds: 60 @@ -24,13 +24,13 @@ - semaphore.sectorq.eu - kestra.sectorq.eu - auth.sectorq.eu - when: inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname == {{ selected_server }} - name: Get relevant configs ansible.builtin.shell: 'egrep -l "# kestra.sectorq.eu|# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' ignore_errors: true become: true register: result - when: inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname == {{ selected_server }} - debug: msg: "{{ result.stdout_lines }}" @@ -43,7 +43,7 @@ become: true with_items: - "{{ result.stdout_lines }}" - when: inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname == {{ selected_server }} - include_tasks: reconfigure_heimdall.yaml name: Reconfigure heimdall @@ -54,7 +54,7 @@ - Roundcube - Authentik - Kestra - when: inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname == {{ selected_server }} - name: Changing heimdall background ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" become: true @@ -70,7 +70,7 @@ ignore_errors: true become: true register: result - when: inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname == {{ selected_server }} # - name: Get relevant configs # ansible.builtin.shell: 'docker restart gitlab' # ignore_errors: yes diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index d65bc67..83e3094 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -4,7 +4,7 @@ become: true when: inventory_hostname in groups['raspberrypi5'] - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{kestra,authentik,mailu2,ha,gitlab,semaphore,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ selected_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname in groups['nas'] \ No newline at end of file From 8729da7122812a0bf576d9d62a34d2d225ade487 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:15:28 +0100 Subject: [PATCH 291/374] bitwarden --- playbooks/sync_all.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index f7104b9..4e914f7 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -5,7 +5,7 @@ tasks: - include_tasks: stop_containers.yaml name: Stop Containers - when: inventory_hostname == {{ selected_server }} + when: inventory_hostname == selected_server - name: Pause for 60 seconds ansible.builtin.pause: seconds: 60 @@ -24,13 +24,13 @@ - semaphore.sectorq.eu - kestra.sectorq.eu - auth.sectorq.eu - when: inventory_hostname == {{ selected_server }} + when: inventory_hostname == selected_server - name: Get relevant configs ansible.builtin.shell: 'egrep -l "# kestra.sectorq.eu|# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' ignore_errors: true become: true register: result - when: inventory_hostname == {{ selected_server }} + when: inventory_hostname == selected_server - debug: msg: "{{ result.stdout_lines }}" @@ -43,7 +43,7 @@ become: true with_items: - "{{ result.stdout_lines }}" - when: inventory_hostname == {{ selected_server }} + when: inventory_hostname == selected_server - include_tasks: reconfigure_heimdall.yaml name: Reconfigure heimdall @@ -54,7 +54,7 @@ - Roundcube - Authentik - Kestra - when: inventory_hostname == {{ selected_server }} + when: inventory_hostname == selected_server - name: Changing heimdall background ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" become: true @@ -70,7 +70,7 @@ ignore_errors: true become: true register: result - when: inventory_hostname == {{ selected_server }} + when: inventory_hostname == selected_server # - name: Get relevant configs # ansible.builtin.shell: 'docker restart gitlab' # ignore_errors: yes From 2e172df93400c6e936634976c243e80d1767833d Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:22:52 +0100 Subject: [PATCH 292/374] bitwarden --- playbooks/sync_container_data.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 83e3094..30620ae 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -2,9 +2,13 @@ - name: Changing permission ansible.builtin.shell: 'chown -R root. /share/docker_data/' become: true - when: inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname == destination_server +- debug: + msg: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + when: inventory_hostname == source_server + - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ selected_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' - when: inventory_hostname in groups['nas'] \ No newline at end of file + when: inventory_hostname == source_server \ No newline at end of file From 3da4715190ac774d0ed0e556e7a554a1c7519a8a Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:32:11 +0100 Subject: [PATCH 293/374] bitwarden --- playbooks/sync_all_test.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index fa5b231..398886c 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -6,8 +6,16 @@ - debug: msg: "{{ item }}" loop: "{{ selected_containers | split(',') }}" - when: inventory_hostname in groups['morefine-server'] - + when: inventory_hostname == destination_server - debug: - msg: "{{ selected_host }}" - when: inventory_hostname in groups['morefine-server'] \ No newline at end of file + msg: "{{ destination_server }}" + when: inventory_hostname == destination_server + - debug: + msg: "{{ source_server }}" + when: inventory_hostname == destination_server + - debug: + msg: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + when: inventory_hostname == source_server + - debug: + msg: "{{ destination_server }}" + when: inventory_hostname == destination_server \ No newline at end of file From 0924904a110e7bbfef8f2deb1ef3b02cee25a7a1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:33:42 +0100 Subject: [PATCH 294/374] bitwarden --- playbooks/sync_all_test.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 398886c..463ce61 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -1,21 +1,17 @@ --- - name: import a task - hosts: containers + hosts: nas gather_facts: false tasks: - debug: msg: "{{ item }}" loop: "{{ selected_containers | split(',') }}" - when: inventory_hostname == destination_server - debug: msg: "{{ destination_server }}" - when: inventory_hostname == destination_server - debug: msg: "{{ source_server }}" - when: inventory_hostname == destination_server - debug: msg: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' when: inventory_hostname == source_server - debug: msg: "{{ destination_server }}" - when: inventory_hostname == destination_server \ No newline at end of file From 76d587bb6b4938b978c09d6494e913ff64e12770 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:34:27 +0100 Subject: [PATCH 295/374] bitwarden --- playbooks/sync_all_test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 463ce61..306eb0a 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -12,6 +12,5 @@ msg: "{{ source_server }}" - debug: msg: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - when: inventory_hostname == source_server - debug: msg: "{{ destination_server }}" From 580ff4544f4cf6f64c9ca40088962b00a36ab695 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:35:52 +0100 Subject: [PATCH 296/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 306eb0a..99c7c1a 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + msg: 'rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - debug: msg: "{{ destination_server }}" From cfa01dbb681c7aa4c4c5ed3d419f09c58682d437 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:36:35 +0100 Subject: [PATCH 297/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 99c7c1a..e949502 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: 'rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + msg: 'rsync -avh --delete /share/docker_data/\\{{{ selected_containers }}\\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - debug: msg: "{{ destination_server }}" From ed04dd158647e2f8c51eb4b2c24fa3bf5c140f6f Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:39:43 +0100 Subject: [PATCH 298/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index e949502..7dc3aac 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: 'rsync -avh --delete /share/docker_data/\\{{{ selected_containers }}\\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + msg: 'rsync -avh --delete /share/docker_data/{{}{{ selected_containers }}{}} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - debug: msg: "{{ destination_server }}" From c26d4199a2ad47e5963194e74ab16c2b86a73707 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:40:37 +0100 Subject: [PATCH 299/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 7dc3aac..8d2b49e 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: 'rsync -avh --delete /share/docker_data/{{}{{ selected_containers }}{}} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + msg: 'rsync -avh --delete /share/docker_data/{{{}}{{ selected_containers }}{{}}} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - debug: msg: "{{ destination_server }}" From ebd5f8b61dc2a57cb666495b1f51194a03b90291 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:42:10 +0100 Subject: [PATCH 300/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 8d2b49e..29a42f3 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: 'rsync -avh --delete /share/docker_data/{{{}}{{ selected_containers }}{{}}} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + msg: 'rsync -avh --delete /share/docker_data/{{'{'}}{{ selected_containers }}{{'}'}} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - debug: msg: "{{ destination_server }}" From 474d6b97da2d9049ead1bb71ba758b456ba00588 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:42:54 +0100 Subject: [PATCH 301/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 29a42f3..99c7c1a 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: 'rsync -avh --delete /share/docker_data/{{'{'}}{{ selected_containers }}{{'}'}} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + msg: 'rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' - debug: msg: "{{ destination_server }}" From 0ce1e8831d3eaad0cc915ed01237db0f843db28f Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:43:43 +0100 Subject: [PATCH 302/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 99c7c1a..61401b9 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: 'rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + msg: rsync -avh --delete /share/docker_data/{'{{ selected_containers }}'} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - debug: msg: "{{ destination_server }}" From b9c2cbfdd2c5db427511d6939f67d51f362da5e2 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:44:15 +0100 Subject: [PATCH 303/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 61401b9..01d033f 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: rsync -avh --delete /share/docker_data/{'{{ selected_containers }}'} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" + msg: rsync -avh --delete /share/docker_data/{{{ selected_containers }}} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - debug: msg: "{{ destination_server }}" From 83f1b132c74cee9b0558f3e3740e0d0e8d15bef1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:44:59 +0100 Subject: [PATCH 304/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 01d033f..aa1b596 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: rsync -avh --delete /share/docker_data/{{{ selected_containers }}} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" + msg: rsync -avh --delete /share/docker_data/{"{{ selected_containers }}"} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - debug: msg: "{{ destination_server }}" From 0c2118d15472168e7da68edd02191967e321bbda Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:47:00 +0100 Subject: [PATCH 305/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index aa1b596..899701b 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: rsync -avh --delete /share/docker_data/{"{{ selected_containers }}"} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" + msg: rsync -avh --delete /share/docker_data/'{'{{ selected_containers }}'}' root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - debug: msg: "{{ destination_server }}" From 4f8a34ecdcf0c99b14a2c8e769fdc7bc5ff3db15 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:48:17 +0100 Subject: [PATCH 306/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 899701b..6bba1c6 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: rsync -avh --delete /share/docker_data/'{'{{ selected_containers }}'}' root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" + msg: rsync -avh --delete /share/docker_data/{{ '{{' }}{{ selected_containers }}{{ '{{' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - debug: msg: "{{ destination_server }}" From 6158cefb0afb52b225d95e5e3e6534fd213fd16d Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:48:47 +0100 Subject: [PATCH 307/374] bitwarden --- playbooks/sync_all_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all_test.yaml b/playbooks/sync_all_test.yaml index 6bba1c6..04f1fe7 100644 --- a/playbooks/sync_all_test.yaml +++ b/playbooks/sync_all_test.yaml @@ -11,6 +11,6 @@ - debug: msg: "{{ source_server }}" - debug: - msg: rsync -avh --delete /share/docker_data/{{ '{{' }}{{ selected_containers }}{{ '{{' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" + msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - debug: msg: "{{ destination_server }}" From fb1fddb77341bd53269e3fa77a54fd7095acc2bf Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:50:43 +0100 Subject: [PATCH 308/374] bitwarden --- playbooks/sync_container_data.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 30620ae..a5c1756 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -4,11 +4,11 @@ become: true when: inventory_hostname == destination_server - debug: - msg: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' when: inventory_hostname == source_server - + - name: Syncing all - ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/\{{{ selected_containers }}\} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + ansible.builtin.shell: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '{' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' when: inventory_hostname == source_server \ No newline at end of file From 95e77f095f4775f615174566c29d5ce0fe7def57 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:51:42 +0100 Subject: [PATCH 309/374] bitwarden --- playbooks/sync_all.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 4e914f7..c9f01c7 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -34,7 +34,7 @@ - debug: msg: "{{ result.stdout_lines }}" - when: inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname == selected_server - name: Replace ip ansible.builtin.lineinfile: path: "{{ item }}" From a68f90fe6db0e8414c2cc38fe0541d76fa03c941 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 12:53:37 +0100 Subject: [PATCH 310/374] bitwarden --- playbooks/sync_all.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index c9f01c7..085bede 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -5,7 +5,7 @@ tasks: - include_tasks: stop_containers.yaml name: Stop Containers - when: inventory_hostname == selected_server + when: inventory_hostname == destination_server - name: Pause for 60 seconds ansible.builtin.pause: seconds: 60 @@ -24,26 +24,26 @@ - semaphore.sectorq.eu - kestra.sectorq.eu - auth.sectorq.eu - when: inventory_hostname == selected_server + when: inventory_hostname == destination_server - name: Get relevant configs ansible.builtin.shell: 'egrep -l "# kestra.sectorq.eu|# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' ignore_errors: true become: true register: result - when: inventory_hostname == selected_server + when: inventory_hostname == destination_server - debug: msg: "{{ result.stdout_lines }}" - when: inventory_hostname == selected_server + when: inventory_hostname == destination_server - name: Replace ip ansible.builtin.lineinfile: path: "{{ item }}" regexp: '^\s+set \$server\s+\"\w+.\w+.\w+.\w+\";' - line: " set $server \"192.168.77.238\";" + line: " set $server \"192.168.77.47\";" become: true with_items: - "{{ result.stdout_lines }}" - when: inventory_hostname == selected_server + when: inventory_hostname == destination_server - include_tasks: reconfigure_heimdall.yaml name: Reconfigure heimdall @@ -54,7 +54,7 @@ - Roundcube - Authentik - Kestra - when: inventory_hostname == selected_server + when: inventory_hostname == destination_server - name: Changing heimdall background ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" become: true @@ -70,7 +70,7 @@ ignore_errors: true become: true register: result - when: inventory_hostname == selected_server + when: inventory_hostname == destination_server # - name: Get relevant configs # ansible.builtin.shell: 'docker restart gitlab' # ignore_errors: yes From 6f6c23a0b60932af8a393a60a430759eb6fe192c Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 13:02:39 +0100 Subject: [PATCH 311/374] bitwarden --- playbooks/sync_all.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 085bede..f27a20a 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -3,6 +3,10 @@ hosts: containers gather_facts: false tasks: + - name: Install docker + ansible.builtin.apt: + name: + - sqlite3 - include_tasks: stop_containers.yaml name: Stop Containers when: inventory_hostname == destination_server From 9afbd9f9e4d9b6d52a1598326fd5e61a18195bc3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 13:03:08 +0100 Subject: [PATCH 312/374] bitwarden --- playbooks/sync_all.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index f27a20a..e859afe 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -7,6 +7,7 @@ ansible.builtin.apt: name: - sqlite3 + state: present - include_tasks: stop_containers.yaml name: Stop Containers when: inventory_hostname == destination_server From cc8774755442881513472e55f8d1203572458409 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 13:04:46 +0100 Subject: [PATCH 313/374] bitwarden --- playbooks/sync_all.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index e859afe..bc63f8a 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -8,6 +8,8 @@ name: - sqlite3 state: present + become: true + when: inventory_hostname == destination_server - include_tasks: stop_containers.yaml name: Stop Containers when: inventory_hostname == destination_server From e47d3ce5298130e933030b0dd29ff45fb993eb81 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 13:08:27 +0100 Subject: [PATCH 314/374] bitwarden --- playbooks/sync_all.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index bc63f8a..e108236 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -3,12 +3,13 @@ hosts: containers gather_facts: false tasks: - - name: Install docker + - name: Install sqlite3 ansible.builtin.apt: name: - sqlite3 state: present become: true + update_cache: yes when: inventory_hostname == destination_server - include_tasks: stop_containers.yaml name: Stop Containers From ab811102a6a0ed2f7d44233ab8c4a28f69313c0a Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 13:09:23 +0100 Subject: [PATCH 315/374] bitwarden --- playbooks/sync_all.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index e108236..e34b0b0 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -8,9 +8,11 @@ name: - sqlite3 state: present + update_cache: yes become: true - update_cache: yes + when: inventory_hostname == destination_server + - include_tasks: stop_containers.yaml name: Stop Containers when: inventory_hostname == destination_server From 3f8b52fdbe22c9615843c5e6b81a7d9277f25b8a Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 13:11:57 +0100 Subject: [PATCH 316/374] bitwarden --- playbooks/sync_all.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index e34b0b0..cc3a529 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -3,6 +3,10 @@ hosts: containers gather_facts: false tasks: + - debug: + msg: "{{ inventory_hostname }}" + - debug: + msg: "{{ destination_server }}" - name: Install sqlite3 ansible.builtin.apt: name: From e97bd0de267daf02b8b81b1ed05a3e8291ca7afe Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 13:25:30 +0100 Subject: [PATCH 317/374] bitwarden --- hosts.yml | 2 +- playbooks/sync_all.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 3e0fd9f..a5c7bfa 100644 --- a/hosts.yml +++ b/hosts.yml @@ -151,7 +151,7 @@ datacenter: ansible_become_password: q morefine-server: hosts: - 192.168.77.47: + morefine: vars: jaydee_install_mqtt_srv: true ansible_python_interpreter: auto_silent diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index cc3a529..68d5251 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -20,6 +20,7 @@ - include_tasks: stop_containers.yaml name: Stop Containers when: inventory_hostname == destination_server + - name: Pause for 60 seconds ansible.builtin.pause: seconds: 60 From 5bf6dc6345262c24166d95d23eaf83b83fa700df Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 13:30:10 +0100 Subject: [PATCH 318/374] bitwarden --- playbooks/sync_all.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 68d5251..3577829 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -73,7 +73,7 @@ - name: Changing heimdall background ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" become: true - when: inventory_hostname in groups['raspberrypi5'] + when: inventory_hostname == destination_server # - include_tasks: start_containers.yaml # name: Start Containers # when: inventory_hostname in groups['raspberrypi5'] From 0c212784d10db93757b1a1ee70d4deb8efa47a03 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 14:35:55 +0100 Subject: [PATCH 319/374] bitwarden --- hosts.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hosts.yml b/hosts.yml index a5c7bfa..c84ee2e 100644 --- a/hosts.yml +++ b/hosts.yml @@ -149,9 +149,9 @@ datacenter: ansible_password: q ansible_become_user: root ansible_become_password: q - morefine-server: + m-server.home.lan: hosts: - morefine: + mm-server.home.lan: vars: jaydee_install_mqtt_srv: true ansible_python_interpreter: auto_silent @@ -201,9 +201,9 @@ datacenter: ansible_ssh_pass: q ansible_become_user: root ansible_become_password: l4c1j4yd33Du5lo - morefine-server: + m-server.home.lan: hosts: - 192.168.77.47: + m-server.home.lan: vars: jaydee_install_mqtt_srv: true ansible_python_interpreter: auto_silent From 4968379e3cf5a542f43ef083e4ec6c41be80eb3f Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 14:43:06 +0100 Subject: [PATCH 320/374] bitwarden --- hosts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts.yml b/hosts.yml index c84ee2e..b7f18a4 100644 --- a/hosts.yml +++ b/hosts.yml @@ -140,7 +140,7 @@ datacenter: ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 morefine: hosts: - 192.168.77.12: + morefine.home.lan: vars: jaydee_install_mqtt_srv: true ansible_python_interpreter: auto_silent @@ -151,7 +151,7 @@ datacenter: ansible_become_password: q m-server.home.lan: hosts: - mm-server.home.lan: + m-server.home.lan: vars: jaydee_install_mqtt_srv: true ansible_python_interpreter: auto_silent From 21a9d5d54bc2f5c5edca83858dc8ff69a6b10a15 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 16:00:54 +0100 Subject: [PATCH 321/374] bitwarden --- hosts.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hosts.yml b/hosts.yml index b7f18a4..c911a03 100644 --- a/hosts.yml +++ b/hosts.yml @@ -107,9 +107,9 @@ datacenter: ansible_ssh_pass: lacijaydee ansible_become_user: root ansible_become_password: lacijaydee - rack: + rack.home.lan: hosts: - 192.168.77.55: + rack.home.lan: vars: ansible_user: jd ansible_password: q @@ -127,9 +127,9 @@ datacenter: ansible_pass: l4c1!j4yd33?Du5lo ansible_ssh_user: admin ansible_ssh_pass: l4c1!j4yd33?Du5lo - nas: + nas.home.lan: hosts: - 192.168.77.106: + nas.home.lan: vars: ansible_ssh_user: admin ansible_ssh_pass: l4c1!j4yd33?Du5lo @@ -138,7 +138,7 @@ datacenter: # ansible_user: admin # ansible_pass: l4c1!j4yd33?Du5lo1 ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 - morefine: + morefine.home.lan: hosts: morefine.home.lan: vars: @@ -192,7 +192,7 @@ datacenter: # ansible_ssh_pass: q # ansible_become_user: root # ansible_become_password: l4c1j4yd33Du5lo - raspberrypi5: + rpi5.home.lan: hosts: 192.168.77.238 vars: @@ -212,9 +212,9 @@ datacenter: ansible_password: q ansible_become_user: root ansible_become_password: q - nas: + nas.home.lan: hosts: - 192.168.77.106: + nas.home.lan: vars: ansible_ssh_user: admin ansible_ssh_pass: l4c1!j4yd33?Du5lo @@ -223,17 +223,17 @@ datacenter: # ansible_user: admin # ansible_pass: l4c1!j4yd33?Du5lo1 ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 - fog: + fog.home.lan: hosts: - 192.168.77.108: + fog.home.lan: vars: ansible_ssh_user: jd ansible_ssh_pass: q ansible_become_user: root ansible_become_password: q - zabbix: + zabbix.home.lan: hosts: - 192.168.77.216: + zabbix.home.lan: vars: ansible_ssh_user: jd ansible_ssh_pass: q From 7e6ab961d97de50feafae42cdd198fc761690020 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 16:30:03 +0100 Subject: [PATCH 322/374] bitwarden --- hosts.yml | 147 +++++++++++------------------------------------------- 1 file changed, 28 insertions(+), 119 deletions(-) diff --git a/hosts.yml b/hosts.yml index c911a03..c9be0df 100644 --- a/hosts.yml +++ b/hosts.yml @@ -86,9 +86,12 @@ datacenter: ansible_winrm_kerberos_delegation: true mqtt_srv: children: - amd: + servers: hosts: 192.168.77.4: + omv.home.lan: + rack.home.lan: + m-server.home.lan: vars: ansible_user: root ansible_password: l4c1j4yd33Du5lo @@ -96,123 +99,45 @@ datacenter: ansible_ssh_pass: l4c1j4yd33Du5lo ansible_become_user: root ansible_become_password: l4c1j4yd33Du5lo - - omv: - hosts: - 192.168.77.189: - vars: - ansible_user: root - ansible_password: lacijaydee - ansible_ssh_user: root - ansible_ssh_pass: lacijaydee - ansible_become_user: root - ansible_become_password: lacijaydee - rack.home.lan: - hosts: - rack.home.lan: - vars: - ansible_user: jd - ansible_password: q - ansible_ssh_user: jd - ansible_ssh_pass: q - become_method: su - ansible_become_user: root - ansible_become_password: q - router: - hosts: - 192.168.77.1 - vars: - ansible_python_interpreter: /opt/bin/python - ansible_user: admin - ansible_pass: l4c1!j4yd33?Du5lo - ansible_ssh_user: admin - ansible_ssh_pass: l4c1!j4yd33?Du5lo - nas.home.lan: - hosts: - nas.home.lan: - vars: - ansible_ssh_user: admin - ansible_ssh_pass: l4c1!j4yd33?Du5lo - become_method: su - become_user: admin - # ansible_user: admin - # ansible_pass: l4c1!j4yd33?Du5lo1 - ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 - morefine.home.lan: + nas: + nas.home.lan: + hosts: + nas.home.lan: + + vars: + ansible_ssh_user: admin + ansible_ssh_pass: l4c1!j4yd33?Du5lo + become_method: su + become_user: admin + # ansible_user: admin + # ansible_pass: l4c1!j4yd33?Du5lo1 + ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 + desktop: hosts: morefine.home.lan: vars: - jaydee_install_mqtt_srv: true - ansible_python_interpreter: auto_silent - ansible_ssh_user: jd - ansible_ssh_pass: q - ansible_password: q - ansible_become_user: root - ansible_become_password: q - m-server.home.lan: - hosts: - m-server.home.lan: - vars: - jaydee_install_mqtt_srv: true - ansible_python_interpreter: auto_silent - ansible_ssh_user: jd - ansible_ssh_pass: q - ansible_password: q - ansible_become_user: root - ansible_become_password: q - - ryzen: - hosts: - 192.168.77.15: - vars: - ansible_python_interpreter: auto_silent + ansible_user: root + ansible_password: l4c1j4yd33Du5lo ansible_ssh_user: root - ansible_ssh_pass: lacijaydee - ansible_password: lacijaydee + ansible_ssh_pass: l4c1j4yd33Du5lo ansible_become_user: root - ansible_become_password: lacijaydee + ansible_become_password: l4c1j4yd33Du5lo containers: children: - router: + servers: hosts: - 192.168.77.1 - vars: - ansible_python_interpreter: /opt/bin/python - ansible_user: admin - ansible_pass: l4c1!j4yd33?Du5lo - ansible_ssh_user: admin - ansible_ssh_pass: l4c1!j4yd33?Du5lo - # raspberry: - # hosts: - # 192.168.77.246 - # vars: - # ansible_python_interpreter: /usr/bin/python - # ansible_ssh_user: jd - # ansible_ssh_pass: q - # ansible_become_user: root - # ansible_become_password: l4c1j4yd33Du5lo - rpi5.home.lan: - hosts: - 192.168.77.238 + rpi5.home.lan: + m-server.hoe.lan: + fog.home.lan: + zabbix.home.lan: vars: ansible_python_interpreter: /usr/bin/python ansible_ssh_user: jd ansible_ssh_pass: q ansible_become_user: root ansible_become_password: l4c1j4yd33Du5lo - m-server.home.lan: - hosts: - m-server.home.lan: - vars: - jaydee_install_mqtt_srv: true - ansible_python_interpreter: auto_silent - ansible_ssh_user: jd - ansible_ssh_pass: q - ansible_password: q - ansible_become_user: root - ansible_become_password: q - nas.home.lan: + nas: hosts: nas.home.lan: vars: @@ -223,19 +148,3 @@ datacenter: # ansible_user: admin # ansible_pass: l4c1!j4yd33?Du5lo1 ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 - fog.home.lan: - hosts: - fog.home.lan: - vars: - ansible_ssh_user: jd - ansible_ssh_pass: q - ansible_become_user: root - ansible_become_password: q - zabbix.home.lan: - hosts: - zabbix.home.lan: - vars: - ansible_ssh_user: jd - ansible_ssh_pass: q - ansible_become_user: root - ansible_become_password: q \ No newline at end of file From cd5593f734dae637d11e6d3b261ef0efcb1483cc Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 16:40:51 +0100 Subject: [PATCH 323/374] bitwarden --- playbooks/sync_container_data.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index a5c1756..f7a8575 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -4,7 +4,7 @@ become: true when: inventory_hostname == destination_server - debug: - msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" when: inventory_hostname == source_server - name: Syncing all From 8437173c68ddcbac3f1d0efcf51f1589ae67ed8e Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 16:41:30 +0100 Subject: [PATCH 324/374] bitwarden --- playbooks/sync_all.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 3577829..e56e1c7 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -3,10 +3,10 @@ hosts: containers gather_facts: false tasks: - - debug: - msg: "{{ inventory_hostname }}" - - debug: - msg: "{{ destination_server }}" + # - debug: + # msg: "{{ inventory_hostname }}" + # - debug: + # msg: "{{ destination_server }}" - name: Install sqlite3 ansible.builtin.apt: name: From 6bd66903eea230aea8f6d1ac1a66d5beddfdb275 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:02:08 +0100 Subject: [PATCH 325/374] bitwarden --- playbooks/distrib_ssh_keys.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/playbooks/distrib_ssh_keys.yml b/playbooks/distrib_ssh_keys.yml index 01c3573..a0c08c6 100644 --- a/playbooks/distrib_ssh_keys.yml +++ b/playbooks/distrib_ssh_keys.yml @@ -1,10 +1,21 @@ - hosts: "{{ hosts }}" - become: yes + become: true tasks: # Deploy SSH Key # -- + - name: Download id_rsa + ansible.builtin.get_url: + url: http://192.168.77.106:48000/ssh/id_rsa + dest: ~/.ssh/id_rsa + mode: '0600' + - name: Download foo.conf + ansible.builtin.get_url: + url: http://192.168.77.106:48000/ssh/id_rsa.pub + dest: ~/.ssh/id_rsa.pub + mode: '0600' + - name: install public keys ansible.posix.authorized_key: user: "{{ user }}" From fd793155632dad2dff87d63a643d0d8e2d03be04 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:02:19 +0100 Subject: [PATCH 326/374] bitwarden --- playbooks/update_ssh_keys.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 playbooks/update_ssh_keys.yml diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml new file mode 100644 index 0000000..ce6bf4c --- /dev/null +++ b/playbooks/update_ssh_keys.yml @@ -0,0 +1,20 @@ +- hosts: "{{ hosts }}" + tasks: + + # Deploy SSH Key + # -- + - name: Create a directory if it does not exist + ansible.builtin.file: + path: ~/.ssh/id_rsa + state: directory + mode: '0700' + - name: Download id_rsa + ansible.builtin.get_url: + url: http://192.168.77.106:48000/ssh/id_rsa + dest: ~/.ssh/id_rsa + mode: '0600' + - name: Download id_rsa.pub + ansible.builtin.get_url: + url: http://192.168.77.106:48000/ssh/id_rsa.pub + dest: ~/.ssh/id_rsa.pub + mode: '0600' From 2fc9af3c1ef2882da52dc4dc5ab685a26e450518 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:20:27 +0100 Subject: [PATCH 327/374] bitwarden --- playbooks/update_ssh_keys.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index ce6bf4c..62d0a4a 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -11,10 +11,10 @@ - name: Download id_rsa ansible.builtin.get_url: url: http://192.168.77.106:48000/ssh/id_rsa - dest: ~/.ssh/id_rsa + dest: /home/jd/.ssh/id_rsa mode: '0600' - name: Download id_rsa.pub ansible.builtin.get_url: url: http://192.168.77.106:48000/ssh/id_rsa.pub - dest: ~/.ssh/id_rsa.pub + dest: /home/jd/.ssh/id_rsa.pub mode: '0600' From 6164cc3b95d47605b615e2691c24f182f7cfd60d Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:23:16 +0100 Subject: [PATCH 328/374] bitwarden --- hosts.yml | 10 +++++----- playbooks/update_ssh_keys.yml | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hosts.yml b/hosts.yml index c9be0df..3533804 100644 --- a/hosts.yml +++ b/hosts.yml @@ -116,12 +116,12 @@ datacenter: hosts: morefine.home.lan: vars: - ansible_user: root - ansible_password: l4c1j4yd33Du5lo - ansible_ssh_user: root - ansible_ssh_pass: l4c1j4yd33Du5lo + ansible_user: jd + ansible_password: q + ansible_ssh_user: jd + ansible_ssh_pass: q ansible_become_user: root - ansible_become_password: l4c1j4yd33Du5lo + ansible_become_password: q containers: children: diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 62d0a4a..bd4f094 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -1,6 +1,5 @@ - hosts: "{{ hosts }}" tasks: - # Deploy SSH Key # -- - name: Create a directory if it does not exist From 5df535c75fa985baec4ac7e5846052ef87939e6d Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:24:28 +0100 Subject: [PATCH 329/374] bitwarden --- playbooks/update_ssh_keys.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index bd4f094..ba536a7 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -10,10 +10,10 @@ - name: Download id_rsa ansible.builtin.get_url: url: http://192.168.77.106:48000/ssh/id_rsa - dest: /home/jd/.ssh/id_rsa + dest: ~/.ssh/id_rsa mode: '0600' - name: Download id_rsa.pub ansible.builtin.get_url: url: http://192.168.77.106:48000/ssh/id_rsa.pub - dest: /home/jd/.ssh/id_rsa.pub + dest: ~/.ssh/id_rsa.pub mode: '0600' From d0b413077c49ed62f876c5b53da2b5cb64cd9eb1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:27:06 +0100 Subject: [PATCH 330/374] bitwarden --- playbooks/update_ssh_keys.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index ba536a7..a47eb3a 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -17,3 +17,5 @@ url: http://192.168.77.106:48000/ssh/id_rsa.pub dest: ~/.ssh/id_rsa.pub mode: '0600' + - ansible.builtin.debug: + msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '~/.ssh/id_rsa.pub') }}" \ No newline at end of file From ae8b999e231eec0e79687bf700d1a67a33203d53 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:28:41 +0100 Subject: [PATCH 331/374] bitwarden --- hosts.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/hosts.yml b/hosts.yml index 3533804..5049bcb 100644 --- a/hosts.yml +++ b/hosts.yml @@ -100,18 +100,17 @@ datacenter: ansible_become_user: root ansible_become_password: l4c1j4yd33Du5lo nas: - nas.home.lan: - hosts: - nas.home.lan: - - vars: - ansible_ssh_user: admin - ansible_ssh_pass: l4c1!j4yd33?Du5lo - become_method: su - become_user: admin - # ansible_user: admin - # ansible_pass: l4c1!j4yd33?Du5lo1 - ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 + hosts: + nas.home.lan: + + vars: + ansible_ssh_user: admin + ansible_ssh_pass: l4c1!j4yd33?Du5lo + become_method: su + become_user: admin + # ansible_user: admin + # ansible_pass: l4c1!j4yd33?Du5lo1 + ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 desktop: hosts: morefine.home.lan: From 6ef4dbdb80c8a77c8a47465185bd3255e7ff8450 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:31:10 +0100 Subject: [PATCH 332/374] bitwarden --- playbooks/update_ssh_keys.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index a47eb3a..32901d3 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -17,5 +17,6 @@ url: http://192.168.77.106:48000/ssh/id_rsa.pub dest: ~/.ssh/id_rsa.pub mode: '0600' + - ansible.builtin.debug: msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '~/.ssh/id_rsa.pub') }}" \ No newline at end of file From ac3d2b32982b2ba58e0831f5674585588e86bb19 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:32:29 +0100 Subject: [PATCH 333/374] bitwarden --- playbooks/update_ssh_keys.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 32901d3..178e0bf 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -17,6 +17,6 @@ url: http://192.168.77.106:48000/ssh/id_rsa.pub dest: ~/.ssh/id_rsa.pub mode: '0600' - - - ansible.builtin.debug: - msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '~/.ssh/id_rsa.pub') }}" \ No newline at end of file + - name: Print + ansible.builtin.debug: + msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '~/.ssh/id_rsa.pub') }}" \ No newline at end of file From b5bf6c92b3d335b1acf4ba33fd0e33dbd73ff8a5 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:34:26 +0100 Subject: [PATCH 334/374] bitwarden --- playbooks/update_ssh_keys.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 178e0bf..82730cf 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -4,7 +4,7 @@ # -- - name: Create a directory if it does not exist ansible.builtin.file: - path: ~/.ssh/id_rsa + path: ~/.ssh state: directory mode: '0700' - name: Download id_rsa From 83c08fd38dc535a5705dbbb84f45dc7fbef7c224 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:35:53 +0100 Subject: [PATCH 335/374] bitwarden --- playbooks/update_ssh_keys.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 82730cf..8c36b5a 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -19,4 +19,4 @@ mode: '0600' - name: Print ansible.builtin.debug: - msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '~/.ssh/id_rsa.pub') }}" \ No newline at end of file + msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '$HOME/.ssh/id_rsa.pub') }}" \ No newline at end of file From 569bce3719cf0a623eca5e41fb55d1a7fa79c955 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:36:32 +0100 Subject: [PATCH 336/374] bitwarden --- playbooks/update_ssh_keys.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 8c36b5a..41b188a 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -19,4 +19,4 @@ mode: '0600' - name: Print ansible.builtin.debug: - msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '$HOME/.ssh/id_rsa.pub') }}" \ No newline at end of file + msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '/home/jd/.ssh/id_rsa.pub') }}" \ No newline at end of file From a8d2bb861b7cade910cf8f7db9f8138d68a88f7e Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:40:00 +0100 Subject: [PATCH 337/374] bitwarden --- playbooks/update_ssh_keys.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 41b188a..79c00d5 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -17,6 +17,13 @@ url: http://192.168.77.106:48000/ssh/id_rsa.pub dest: ~/.ssh/id_rsa.pub mode: '0600' + - name: get remote file contents + command: "cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub" + register: key + - name: show key contents + debug: + var: key.stdout + - name: Print ansible.builtin.debug: msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '/home/jd/.ssh/id_rsa.pub') }}" \ No newline at end of file From 8d81bf6450ef2922839fef04eef38a5a19f9859b Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:44:01 +0100 Subject: [PATCH 338/374] bitwarden --- playbooks/update_ssh_keys.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 79c00d5..66c2606 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -24,6 +24,11 @@ debug: var: key.stdout + - name: Ensure we have our own comment added to /etc/services + ansible.builtin.lineinfile: + path: "cat {{ ansible_env.HOME }}/.ssh/authorized_keys" + line: key.stdout + - name: Print ansible.builtin.debug: msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '/home/jd/.ssh/id_rsa.pub') }}" \ No newline at end of file From 358fa2c9b1793731ef2da1df1d90dda10f1dc2c1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:44:56 +0100 Subject: [PATCH 339/374] bitwarden --- playbooks/update_ssh_keys.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 66c2606..8025e81 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -26,9 +26,9 @@ - name: Ensure we have our own comment added to /etc/services ansible.builtin.lineinfile: - path: "cat {{ ansible_env.HOME }}/.ssh/authorized_keys" + path: "{{ ansible_env.HOME }}/.ssh/authorized_keys" line: key.stdout - + - name: Print ansible.builtin.debug: msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '/home/jd/.ssh/id_rsa.pub') }}" \ No newline at end of file From 74427b899840ae8b2a2aac1c0dbd86704b26acaa Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:45:22 +0100 Subject: [PATCH 340/374] bitwarden --- playbooks/update_ssh_keys.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 8025e81..5ac108d 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -27,7 +27,7 @@ - name: Ensure we have our own comment added to /etc/services ansible.builtin.lineinfile: path: "{{ ansible_env.HOME }}/.ssh/authorized_keys" - line: key.stdout + line: "{{ key.stdout }}" - name: Print ansible.builtin.debug: From 086d718558b4df976c2cbce91303e4dc46f8e24b Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:52:09 +0100 Subject: [PATCH 341/374] bitwarden --- hosts.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hosts.yml b/hosts.yml index 5049bcb..a2dd2aa 100644 --- a/hosts.yml +++ b/hosts.yml @@ -93,12 +93,12 @@ datacenter: rack.home.lan: m-server.home.lan: vars: - ansible_user: root - ansible_password: l4c1j4yd33Du5lo - ansible_ssh_user: root - ansible_ssh_pass: l4c1j4yd33Du5lo + ansible_user: jd + ansible_password: q + ansible_ssh_user: jd + ansible_ssh_pass: q ansible_become_user: root - ansible_become_password: l4c1j4yd33Du5lo + ansible_become_password: q nas: hosts: nas.home.lan: From 47e552a84472ce4e56de8185426fa4b2beffabe2 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:54:13 +0100 Subject: [PATCH 342/374] bitwarden --- hosts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts.yml b/hosts.yml index a2dd2aa..9067bf9 100644 --- a/hosts.yml +++ b/hosts.yml @@ -93,6 +93,7 @@ datacenter: rack.home.lan: m-server.home.lan: vars: + ansible_python_interpreter: /usr/bin/python ansible_user: jd ansible_password: q ansible_ssh_user: jd From ba41a53d9f990b2ec56c486d3585dfc73a5800c1 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:55:50 +0100 Subject: [PATCH 343/374] bitwarden --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 9067bf9..208f4c0 100644 --- a/hosts.yml +++ b/hosts.yml @@ -93,7 +93,7 @@ datacenter: rack.home.lan: m-server.home.lan: vars: - ansible_python_interpreter: /usr/bin/python + ansible_python_interpreter: /usr/bin/python3 ansible_user: jd ansible_password: q ansible_ssh_user: jd From 50f8267914a3f0587a6073395bcf5b1c53a17ce3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:56:24 +0100 Subject: [PATCH 344/374] bitwarden --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 208f4c0..b2984e8 100644 --- a/hosts.yml +++ b/hosts.yml @@ -132,7 +132,7 @@ datacenter: fog.home.lan: zabbix.home.lan: vars: - ansible_python_interpreter: /usr/bin/python + ansible_python_interpreter: /usr/bin/python3 ansible_ssh_user: jd ansible_ssh_pass: q ansible_become_user: root From 9e411099d6c24d6d91b26af66aa9c05a40844e80 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 17:57:34 +0100 Subject: [PATCH 345/374] bitwarden --- playbooks/update_ssh_keys.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 5ac108d..7ec26bf 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -28,6 +28,7 @@ ansible.builtin.lineinfile: path: "{{ ansible_env.HOME }}/.ssh/authorized_keys" line: "{{ key.stdout }}" + create: yes - name: Print ansible.builtin.debug: From 383428748e01798c0aec0d49d48f92092b0dc45f Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 18:38:34 +0100 Subject: [PATCH 346/374] bitwarden --- playbooks/update_ssh_keys.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 7ec26bf..37e0c9c 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -29,7 +29,4 @@ path: "{{ ansible_env.HOME }}/.ssh/authorized_keys" line: "{{ key.stdout }}" create: yes - - - name: Print - ansible.builtin.debug: - msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '/home/jd/.ssh/id_rsa.pub') }}" \ No newline at end of file + \ No newline at end of file From 0ef234b6e1603f81c24941140f91ed490b1d2c00 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 19:39:21 +0100 Subject: [PATCH 347/374] bitwarden --- hosts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts.yml b/hosts.yml index b2984e8..05a4b55 100644 --- a/hosts.yml +++ b/hosts.yml @@ -140,6 +140,7 @@ datacenter: nas: hosts: nas.home.lan: + 192.168.77.106: vars: ansible_ssh_user: admin ansible_ssh_pass: l4c1!j4yd33?Du5lo From a04ae2d80b26491203e5304c6ad2bad740c3e312 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 19:52:41 +0100 Subject: [PATCH 348/374] bitwarden --- hosts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts.yml b/hosts.yml index 05a4b55..b72698c 100644 --- a/hosts.yml +++ b/hosts.yml @@ -88,7 +88,7 @@ datacenter: children: servers: hosts: - 192.168.77.4: + rpi5-1.home.lan: omv.home.lan: rack.home.lan: m-server.home.lan: @@ -127,7 +127,7 @@ datacenter: children: servers: hosts: - rpi5.home.lan: + rpi5-1.home.lan: m-server.hoe.lan: fog.home.lan: zabbix.home.lan: From 5070dbeab7182283986732ddd3b6bd01c436e735 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 20:01:21 +0100 Subject: [PATCH 349/374] bitwarden --- hosts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hosts.yml b/hosts.yml index b72698c..503ed0d 100644 --- a/hosts.yml +++ b/hosts.yml @@ -92,6 +92,7 @@ datacenter: omv.home.lan: rack.home.lan: m-server.home.lan: + zabbix.home.lan: vars: ansible_python_interpreter: /usr/bin/python3 ansible_user: jd @@ -131,6 +132,7 @@ datacenter: m-server.hoe.lan: fog.home.lan: zabbix.home.lan: + omv.home.lan: vars: ansible_python_interpreter: /usr/bin/python3 ansible_ssh_user: jd From 7713cbd200bf63d001e13093628449d18fb7a597 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 20:25:50 +0100 Subject: [PATCH 350/374] bitwarden --- hosts.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hosts.yml b/hosts.yml index 503ed0d..0822a50 100644 --- a/hosts.yml +++ b/hosts.yml @@ -96,11 +96,11 @@ datacenter: vars: ansible_python_interpreter: /usr/bin/python3 ansible_user: jd - ansible_password: q + ansible_password: l4c1j4yd33Du5lo ansible_ssh_user: jd - ansible_ssh_pass: q + ansible_ssh_pass: l4c1j4yd33Du5lo ansible_become_user: root - ansible_become_password: q + ansible_become_password: l4c1j4yd33Du5lo nas: hosts: nas.home.lan: @@ -122,7 +122,7 @@ datacenter: ansible_ssh_user: jd ansible_ssh_pass: q ansible_become_user: root - ansible_become_password: q + ansible_become_password: q containers: children: @@ -136,7 +136,7 @@ datacenter: vars: ansible_python_interpreter: /usr/bin/python3 ansible_ssh_user: jd - ansible_ssh_pass: q + ansible_ssh_pass: l4c1j4yd33Du5lo ansible_become_user: root ansible_become_password: l4c1j4yd33Du5lo nas: From 6a0b417621a1032be51f77681416e49e2419d4e3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Thu, 14 Nov 2024 20:30:46 +0100 Subject: [PATCH 351/374] bitwarden --- hosts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts.yml b/hosts.yml index 0822a50..6c6e822 100644 --- a/hosts.yml +++ b/hosts.yml @@ -129,7 +129,7 @@ datacenter: servers: hosts: rpi5-1.home.lan: - m-server.hoe.lan: + m-server.home.lan: fog.home.lan: zabbix.home.lan: omv.home.lan: From c322277290f20ded03959256737f4d53795aba1b Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 10:27:01 +0100 Subject: [PATCH 352/374] bitwarden --- hosts.yml | 1 + hosts_kestra.yml | 151 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 hosts_kestra.yml diff --git a/hosts.yml b/hosts.yml index 6c6e822..97de24b 100644 --- a/hosts.yml +++ b/hosts.yml @@ -139,6 +139,7 @@ datacenter: ansible_ssh_pass: l4c1j4yd33Du5lo ansible_become_user: root ansible_become_password: l4c1j4yd33Du5lo + ansible_ssh_private_key_file: ~/.ssh/ansible nas: hosts: nas.home.lan: diff --git a/hosts_kestra.yml b/hosts_kestra.yml new file mode 100644 index 0000000..6d77244 --- /dev/null +++ b/hosts_kestra.yml @@ -0,0 +1,151 @@ +--- +datacenter: + children: + odroid_cluster: + children: + odroid_master: + hosts: + 192.168.77.131: + vars: + testVar: 999 + odroid_worker: + hosts: + 192.168.77.13[2:5]: + + vars: + ansible_ssh_user: jd + ansible_ssh_pass: lacijaydee + ansible_become_password: lacijaydee + ssh_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + + localhost1: + hosts: + localhost + vars: + ansible_user: root + morefine: + hosts: + 192.168.77.12: + vars: + jaydee_install_mqtt_srv: true + ansible_python_interpreter: auto_silent + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_password: q + ansible_become_user: root + ansible_become_password: q + ansible_ssh_common_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + + ryzen: + hosts: + 192.168.77.15: + vars: + ansible_python_interpreter: auto_silent + ansible_ssh_user: root + ansible_ssh_pass: lacijaydee + ansible_password: lacijaydee + ansible_become_user: root + ansible_become_password: lacijaydee + omv: + hosts: + 192.168.77.189: + vars: + ansible_user: root + ansible_password: lacijaydee + ansible_ssh_user: root + ansible_ssh_pass: lacijaydee + ansible_become_user: root + ansible_become_password: lacijaydee + amd: + hosts: + 192.168.77.4: + vars: + ansible_user: root + ansible_password: l4c1j4yd33Du5lo + ansible_ssh_user: root + ansible_ssh_pass: l4c1j4yd33Du5lo + ansible_become_user: root + ansible_become_password: l4c1j4yd33Du5lo + rhasspy: + hosts: + 192.168.77.224 + vars: + ansible_user: jd + ansible_ssh_pass: q + ansible_become_password: l4c1j4yd33Du5lo + windows: + hosts: + 192.168.77.211 + vars: + ansible_user: jd + ansible_password: "q" + ansible_connection: winrm + ansible_port: 5985 + ansible_winrm_server_cert_validation: ignore + ansible_winrm_kerberos_delegation: true + mqtt_srv: + children: + servers: + hosts: + rpi5-1.home.lan: + omv.home.lan: + rack.home.lan: + m-server.home.lan: + zabbix.home.lan: + vars: + ansible_python_interpreter: /usr/bin/python3 + ansible_user: jd + ansible_password: l4c1j4yd33Du5lo + ansible_ssh_user: jd + ansible_ssh_pass: l4c1j4yd33Du5lo + ansible_become_user: root + ansible_become_password: l4c1j4yd33Du5lo + nas: + hosts: + nas.home.lan: + + vars: + ansible_ssh_user: admin + ansible_ssh_pass: l4c1!j4yd33?Du5lo + become_method: su + become_user: admin + # ansible_user: admin + # ansible_pass: l4c1!j4yd33?Du5lo1 + ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 + desktop: + hosts: + morefine.home.lan: + vars: + ansible_user: jd + ansible_password: q + ansible_ssh_user: jd + ansible_ssh_pass: q + ansible_become_user: root + ansible_become_password: q + + containers: + children: + servers: + hosts: + rpi5-1.home.lan: + m-server.home.lan: + fog.home.lan: + zabbix.home.lan: + omv.home.lan: + vars: + ansible_python_interpreter: /usr/bin/python3 + ansible_ssh_user: jd + ansible_ssh_private_key_file: ssh_key.pem + nas: + hosts: + nas.home.lan: + 192.168.77.106: + vars: + ansible_ssh_user: admin + ansible_ssh_pass: l4c1!j4yd33?Du5lo + become_method: su + become_user: admin + # ansible_user: admin + # ansible_pass: l4c1!j4yd33?Du5lo1 + ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 From 23345984e00b27b2d17cafb33d1ede440e45f88e Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 10:34:16 +0100 Subject: [PATCH 353/374] bitwarden --- hosts_kestra.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hosts_kestra.yml b/hosts_kestra.yml index 6d77244..98e5540 100644 --- a/hosts_kestra.yml +++ b/hosts_kestra.yml @@ -96,20 +96,16 @@ datacenter: vars: ansible_python_interpreter: /usr/bin/python3 ansible_user: jd - ansible_password: l4c1j4yd33Du5lo - ansible_ssh_user: jd - ansible_ssh_pass: l4c1j4yd33Du5lo - ansible_become_user: root - ansible_become_password: l4c1j4yd33Du5lo + ansible_ssh_private_key_file: ssh_key.pem nas: hosts: nas.home.lan: vars: ansible_ssh_user: admin - ansible_ssh_pass: l4c1!j4yd33?Du5lo become_method: su become_user: admin + ansible_ssh_private_key_file: ssh_key.pem # ansible_user: admin # ansible_pass: l4c1!j4yd33?Du5lo1 ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 From 161720a519d9ed227a729ac56c12cf23324ae11e Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 12:46:46 +0100 Subject: [PATCH 354/374] bitwarden --- hosts_kestra.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts_kestra.yml b/hosts_kestra.yml index 98e5540..2351806 100644 --- a/hosts_kestra.yml +++ b/hosts_kestra.yml @@ -139,9 +139,9 @@ datacenter: 192.168.77.106: vars: ansible_ssh_user: admin - ansible_ssh_pass: l4c1!j4yd33?Du5lo become_method: su become_user: admin + ansible_ssh_private_key_file: ssh_key.pem # ansible_user: admin # ansible_pass: l4c1!j4yd33?Du5lo1 ansible_python_interpreter: /share/ZFS530_DATA/.qpkg/QPython312/bin/python3 From f7a80fed8ec7221593ba31cd1d87fbb778132ea0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 12:52:38 +0100 Subject: [PATCH 355/374] bitwarden --- playbooks/update_ssh_keys.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/playbooks/update_ssh_keys.yml b/playbooks/update_ssh_keys.yml index 37e0c9c..9f8089b 100644 --- a/playbooks/update_ssh_keys.yml +++ b/playbooks/update_ssh_keys.yml @@ -29,4 +29,9 @@ path: "{{ ansible_env.HOME }}/.ssh/authorized_keys" line: "{{ key.stdout }}" create: yes - \ No newline at end of file + - name: Ensure we have our own comment added to /etc/services + ansible.builtin.lineinfile: + path: "/root/.ssh/authorized_keys" + line: "{{ key.stdout }}" + create: yes + become: true \ No newline at end of file From 1eec43b5880ae8acfb2d31e5cb77b668bf8126a0 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:20:11 +0100 Subject: [PATCH 356/374] bitwarden --- playbooks/reconfigure_nginx.yaml | 4 ++-- playbooks/sync_all.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/playbooks/reconfigure_nginx.yaml b/playbooks/reconfigure_nginx.yaml index 2180573..1b68bae 100644 --- a/playbooks/reconfigure_nginx.yaml +++ b/playbooks/reconfigure_nginx.yaml @@ -1,6 +1,6 @@ +--- - debug: msg: "{{ item }}" - name: Changing entry in nginx database - ansible.builtin.shell: sqlite3 /share/docker_data/nginx/data/database.sqlite "UPDATE proxy_host SET forward_host = '192.168.77.238' WHERE domain_names = '[\"{{ item }}\"]'" + ansible.builtin.shell: sqlite3 /share/docker_data/nginx/data/database.sqlite "UPDATE proxy_host SET forward_host = '{{ destination_server}}' WHERE domain_names = '[\"{{ item }}\"]'" become: true - when: inventory_hostname in groups['raspberrypi5'] \ No newline at end of file diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index e56e1c7..7039923 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -40,6 +40,7 @@ - kestra.sectorq.eu - auth.sectorq.eu when: inventory_hostname == destination_server + - name: Get relevant configs ansible.builtin.shell: 'egrep -l "# kestra.sectorq.eu|# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' ignore_errors: true From ed4a7a28a07a9be6d1d7f25b5c8d1e81d3044e80 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:28:22 +0100 Subject: [PATCH 357/374] bitwarden --- playbooks/sync_container_data.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index f7a8575..f09378b 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -5,7 +5,10 @@ when: inventory_hostname == destination_server - debug: msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - when: inventory_hostname == source_server + when: inventory_hostname == source_server and selected_containers|split(",")|length > 1 +- debug: + msg: rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" + when: inventory_hostname == source_server and selected_containers|split(",")|length = 1 - name: Syncing all ansible.builtin.shell: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '{' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" From 636aafa3929a598c5b3f1522848d0502c6415d67 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:30:36 +0100 Subject: [PATCH 358/374] bitwarden --- playbooks/sync_container_data.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index f09378b..5a4ca30 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -8,7 +8,7 @@ when: inventory_hostname == source_server and selected_containers|split(",")|length > 1 - debug: msg: rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - when: inventory_hostname == source_server and selected_containers|split(",")|length = 1 + when: inventory_hostname == source_server and selected_containers|split(",")|length == 1 - name: Syncing all ansible.builtin.shell: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '{' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" From b6fc945c19634b6e2908fbae19f159f488917bb3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:34:19 +0100 Subject: [PATCH 359/374] bitwarden --- playbooks/sync_container_data.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 5a4ca30..2e5bb83 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -14,4 +14,9 @@ ansible.builtin.shell: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '{' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' - when: inventory_hostname == source_server \ No newline at end of file + when: inventory_hostname == source_server and selected_containers|split(",")|length > 1 +- name: Syncing all + ansible.builtin.shell: rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" + #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' + #ansible.builtin.shell: 'ls -la' + when: inventory_hostname == source_server and selected_containers|split(",")|length == 1 \ No newline at end of file From 821560f53e311fcc076cd2e9d4fdf8ca8b0856c3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:37:42 +0100 Subject: [PATCH 360/374] bitwarden --- playbooks/reconfigure_heimdall.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/playbooks/reconfigure_heimdall.yaml b/playbooks/reconfigure_heimdall.yaml index 2cf9f2a..350580d 100644 --- a/playbooks/reconfigure_heimdall.yaml +++ b/playbooks/reconfigure_heimdall.yaml @@ -1,7 +1,6 @@ - name: Getting entry ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "SELECT url FROM items WHERE title = '{{ item }}'" become: true - when: inventory_hostname in groups['raspberrypi5'] register: url - debug: @@ -9,4 +8,3 @@ - name: Changing entry ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE items SET url = '{{ url.stdout |regex_replace('[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}','192.168.77.238') }}' WHERE title = '{{ item }}'" become: true - when: inventory_hostname in groups['raspberrypi5'] \ No newline at end of file From 9e8a3ce1501f18b32246adda4a65165a92f843d3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:43:32 +0100 Subject: [PATCH 361/374] bitwarden --- playbooks/stop_containers.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index 831b719..f2956ba 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -1,5 +1,16 @@ --- + +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - element1 + - element2 + - element3 +- debug: + msg: "{{ docker_containers }}" - name: Stop mailu containers command: "docker stop kestra-kestra-1 kestra-postgres-1 authentik-postgresql-1 authentik-worker-1 authentik-server-1 authentik-redis-1 gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1" become: true - ignore_errors: true \ No newline at end of file + ignore_errors: true + \ No newline at end of file From 8c339ffa7e2c3b833a6772d72fe92a32661553fb Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:45:26 +0100 Subject: [PATCH 362/374] bitwarden --- playbooks/stop_containers.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index f2956ba..a1180b2 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -4,9 +4,9 @@ set_fact: docker_containers: "{{ docker_containers | default([]) + [item] }}" loop: - - element1 - - element2 - - element3 + - semaphore-db-1 + - semaphore-app-1 + - debug: msg: "{{ docker_containers }}" - name: Stop mailu containers From 0668981d6373f37715a39381843f020c451a6ace Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:46:52 +0100 Subject: [PATCH 363/374] bitwarden --- playbooks/stop_containers.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index a1180b2..3cb7ffa 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -6,6 +6,7 @@ loop: - semaphore-db-1 - semaphore-app-1 + when: '"semaphore" in selected_containers' - debug: msg: "{{ docker_containers }}" From 6b50e67012dbffed90b679f23d44568c75d83518 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:48:52 +0100 Subject: [PATCH 364/374] bitwarden --- playbooks/stop_containers.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index 3cb7ffa..5baa83e 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -8,10 +8,13 @@ - semaphore-app-1 when: '"semaphore" in selected_containers' + +# kestra-kestra-1 kestra-postgres-1 authentik-postgresql-1 authentik-worker-1 authentik-server-1 authentik-redis-1 gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1" + - debug: msg: "{{ docker_containers }}" - name: Stop mailu containers - command: "docker stop kestra-kestra-1 kestra-postgres-1 authentik-postgresql-1 authentik-worker-1 authentik-server-1 authentik-redis-1 gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1" + command: "docker stop {{ docker_containers|split(' ') }}" become: true ignore_errors: true \ No newline at end of file From 9b2374e8ec2a45661bc2dc83c727a37e4eb746c3 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:50:06 +0100 Subject: [PATCH 365/374] bitwarden --- playbooks/stop_containers.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index 5baa83e..ee1dc90 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -14,7 +14,7 @@ - debug: msg: "{{ docker_containers }}" - name: Stop mailu containers - command: "docker stop {{ docker_containers|split(' ') }}" + command: "docker stop {{ docker_containers|join(' ') }}" become: true ignore_errors: true \ No newline at end of file From 0568c30c86d7d7dda8faa16e732ff9f9b63e6706 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 13:57:18 +0100 Subject: [PATCH 366/374] bitwarden --- playbooks/start_containers.yaml | 7 ++-- playbooks/stop_containers.yaml | 71 ++++++++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/playbooks/start_containers.yaml b/playbooks/start_containers.yaml index c0b5e19..f693b0f 100644 --- a/playbooks/start_containers.yaml +++ b/playbooks/start_containers.yaml @@ -1,5 +1,6 @@ --- -- name: Stop mailu containers - command: "docker start kestra-kestra-1 kestra-postgres-1 authentik-postgresql-1 authentik-worker-1 authentik-server-1 authentik-redis-1 gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1" +- name: Start mailu containers + command: "docker start {{ docker_containers|join(' ') }}" become: true - ignore_errors: true \ No newline at end of file + ignore_errors: true + \ No newline at end of file diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index ee1dc90..8001522 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -8,8 +8,75 @@ - semaphore-app-1 when: '"semaphore" in selected_containers' - -# kestra-kestra-1 kestra-postgres-1 authentik-postgresql-1 authentik-worker-1 authentik-server-1 authentik-redis-1 gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1" +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - authentik-postgresql-1 + - authentik-worker-1 + - authentik-server-1 + - authentik-redis-1 + when: '"authentik" in selected_containers' +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - kestra-kestra-1 + - kestra-postgres-1 + when: '"kestra" in selected_containers' +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - gitlab + when: '"gitlab" in selected_containers' +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - nginx-app-1 + when: '"nginx" in selected_containers' +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - heimdall + when: '"heimdall" in selected_containers' +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - mailu3-admin-1 + - mailu3-antispam-1 + - mailu3-antivirus-1 + - mailu3-fetchmail-1 + - mailu3-front-1 + - mailu3-imap-1 + - mailu3-oletools-1 + - mailu3-redis-1 + - mailu3-resolver-1 + - mailu3-smtp-1 + - mailu3-webdav-1 + - mailu3-webmail-1 + when: '"mailu3" in selected_containers' +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - HomeAssistant + when: '"homeassistant" in selected_containers' +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - webhub-web-1" + when: '"webhub" in selected_containers' +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - mosquitto-mosquitto-1" + when: '"mosquitto" in selected_containers' - debug: msg: "{{ docker_containers }}" From 389ae647de0c3005a451bada74d257b4ade2f06b Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 14:01:26 +0100 Subject: [PATCH 367/374] bitwarden --- playbooks/sync_all.yaml | 3 ++- playbooks/sync_container_data.yaml | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 7039923..32c94fd 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -27,6 +27,7 @@ - include_tasks: sync_container_data.yaml name: Sync Container Data + when: inventory_hostname == source_server - include_tasks: reconfigure_nginx.yaml name: Reconfigure nginx proxy manager @@ -40,7 +41,7 @@ - kestra.sectorq.eu - auth.sectorq.eu when: inventory_hostname == destination_server - + - name: Get relevant configs ansible.builtin.shell: 'egrep -l "# kestra.sectorq.eu|# auth.sectorq.eu|# ha.sectorq.eu|# pw.sectorq.eu|# semaphore.sectorq.eu|# sectorq.eu|# gitlab.sectorq.eu|# ha.sectorq.eu" /share/docker_data/nginx/data/nginx/proxy_host/*' ignore_errors: true diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 2e5bb83..0638895 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -2,21 +2,21 @@ - name: Changing permission ansible.builtin.shell: 'chown -R root. /share/docker_data/' become: true - when: inventory_hostname == destination_server + - debug: msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - when: inventory_hostname == source_server and selected_containers|split(",")|length > 1 + when: selected_containers|split(",")|length > 1 - debug: msg: rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" - when: inventory_hostname == source_server and selected_containers|split(",")|length == 1 + when: selected_containers|split(",")|length == 1 - name: Syncing all ansible.builtin.shell: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '{' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' - when: inventory_hostname == source_server and selected_containers|split(",")|length > 1 + when: selected_containers|split(",")|length > 1 - name: Syncing all ansible.builtin.shell: rsync -avh --delete /share/docker_data/{{ selected_containers }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" #ansible.builtin.shell: 'rsync -avh --delete /share/docker_data/{mailu2,webhub,nginx,heimdall} root@192.168.77.238:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*"' #ansible.builtin.shell: 'ls -la' - when: inventory_hostname == source_server and selected_containers|split(",")|length == 1 \ No newline at end of file + when: selected_containers|split(",")|length == 1 \ No newline at end of file From 41933c02a19850aed2b654b76a7f08b8ba7cd8bd Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 14:03:46 +0100 Subject: [PATCH 368/374] bitwarden --- playbooks/sync_all.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 32c94fd..1f5af94 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -76,12 +76,12 @@ ansible.builtin.shell: sqlite3 /share/docker_data/heimdall/config/www/app.sqlite "UPDATE setting_user SET uservalue = 'backgrounds/TRN2Ydr5dyVAkWvCq4xqR5bQ6iyv5XaKvM1r84sJ.jpg' WHERE user_id = (SELECT id FROM users WHERE username = 'jaydee')" become: true when: inventory_hostname == destination_server - # - include_tasks: start_containers.yaml - # name: Start Containers - # when: inventory_hostname in groups['raspberrypi5'] - # - name: Pause for 60 seconds - # ansible.builtin.pause: - # seconds: 10 + - include_tasks: start_containers.yaml + name: Start Containers + when: inventory_hostname == destination_server + - name: Pause for 60 seconds + ansible.builtin.pause: + seconds: 60 - name: Update gitlab perms ansible.builtin.shell: 'docker exec -t gitlab update-permissions' ignore_errors: true From 3389d9c5a182af65d54e3fffb31cd2b169541f60 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 14:12:07 +0100 Subject: [PATCH 369/374] bitwarden --- playbooks/stop_containers.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index 8001522..f4f2344 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -58,6 +58,7 @@ - mailu3-smtp-1 - mailu3-webdav-1 - mailu3-webmail-1 + - mailu3-fts_attachments-1 when: '"mailu3" in selected_containers' - name: Add elements to a list set_fact: From e5c9b09c0cacfb04a17cff30ed50dde642c250ac Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 14:19:44 +0100 Subject: [PATCH 370/374] bitwarden --- playbooks/sync_all.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index 1f5af94..c2339ed 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -19,7 +19,7 @@ - include_tasks: stop_containers.yaml name: Stop Containers - when: inventory_hostname == destination_server + when: inventory_hostname == destination_server or inventory_hostname == source_server - name: Pause for 60 seconds ansible.builtin.pause: @@ -87,7 +87,7 @@ ignore_errors: true become: true register: result - when: inventory_hostname == destination_server + when: inventory_hostname == destination_server or inventory_hostname == source_server # - name: Get relevant configs # ansible.builtin.shell: 'docker restart gitlab' # ignore_errors: yes From c06d9f7bc1421d308827940137124a36293ed64f Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 14:27:21 +0100 Subject: [PATCH 371/374] bitwarden --- playbooks/sync_all.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index c2339ed..b30ee0b 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -78,7 +78,7 @@ when: inventory_hostname == destination_server - include_tasks: start_containers.yaml name: Start Containers - when: inventory_hostname == destination_server + when: inventory_hostname == destination_server or inventory_hostname == source_server - name: Pause for 60 seconds ansible.builtin.pause: seconds: 60 @@ -87,7 +87,7 @@ ignore_errors: true become: true register: result - when: inventory_hostname == destination_server or inventory_hostname == source_server + when: inventory_hostname == destination_server # - name: Get relevant configs # ansible.builtin.shell: 'docker restart gitlab' # ignore_errors: yes From dab68012c7f879399a36bd8dfdb54e90b05ad752 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 14:41:17 +0100 Subject: [PATCH 372/374] bitwarden --- playbooks/stop_containers.yaml | 7 ++++++- playbooks/sync_all.yaml | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index f4f2344..501fe46 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -78,7 +78,12 @@ loop: - mosquitto-mosquitto-1" when: '"mosquitto" in selected_containers' - +- name: Add elements to a list + set_fact: + docker_containers: "{{ docker_containers | default([]) + [item] }}" + loop: + - mosquitto-mosquitto-1" + when: '"ha" in selected_containers' - debug: msg: "{{ docker_containers }}" - name: Stop mailu containers diff --git a/playbooks/sync_all.yaml b/playbooks/sync_all.yaml index b30ee0b..2d6dfcf 100644 --- a/playbooks/sync_all.yaml +++ b/playbooks/sync_all.yaml @@ -2,6 +2,8 @@ - name: import a task hosts: containers gather_facts: false + # vars: + # selected_containers: selected_containers|split(",") tasks: # - debug: # msg: "{{ inventory_hostname }}" From 9fa3844e3e5cbe6a7ef1c0930c0773b3a224004a Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 15:39:07 +0100 Subject: [PATCH 373/374] bitwarden --- playbooks/stop_containers.yaml | 7 ++----- playbooks/sync_container_data.yaml | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index 501fe46..a6f6a7b 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -79,11 +79,8 @@ - mosquitto-mosquitto-1" when: '"mosquitto" in selected_containers' - name: Add elements to a list - set_fact: - docker_containers: "{{ docker_containers | default([]) + [item] }}" - loop: - - mosquitto-mosquitto-1" - when: '"ha" in selected_containers' + + - debug: msg: "{{ docker_containers }}" - name: Stop mailu containers diff --git a/playbooks/sync_container_data.yaml b/playbooks/sync_container_data.yaml index 0638895..70955aa 100644 --- a/playbooks/sync_container_data.yaml +++ b/playbooks/sync_container_data.yaml @@ -2,7 +2,8 @@ - name: Changing permission ansible.builtin.shell: 'chown -R root. /share/docker_data/' become: true - + vars: + selected_containers: "{{ selected_containers|replace('homeassistant' ,'ha') }}" - debug: msg: rsync -avh --delete /share/docker_data/{{ '{' }}{{ selected_containers }}{{ '}' }} root@{{ destination_server }}:/share/docker_data/ --exclude="home-assistant.log*" --exclude="gitlab/logs/*" when: selected_containers|split(",")|length > 1 From a2272a39029fa97337f187f1b490913cd8adbd24 Mon Sep 17 00:00:00 2001 From: jaydee Date: Fri, 15 Nov 2024 15:41:25 +0100 Subject: [PATCH 374/374] bitwarden --- playbooks/stop_containers.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/playbooks/stop_containers.yaml b/playbooks/stop_containers.yaml index a6f6a7b..b3c480d 100644 --- a/playbooks/stop_containers.yaml +++ b/playbooks/stop_containers.yaml @@ -60,26 +60,27 @@ - mailu3-webmail-1 - mailu3-fts_attachments-1 when: '"mailu3" in selected_containers' + - name: Add elements to a list set_fact: docker_containers: "{{ docker_containers | default([]) + [item] }}" loop: - HomeAssistant when: '"homeassistant" in selected_containers' + - name: Add elements to a list set_fact: docker_containers: "{{ docker_containers | default([]) + [item] }}" loop: - webhub-web-1" when: '"webhub" in selected_containers' + - name: Add elements to a list set_fact: docker_containers: "{{ docker_containers | default([]) + [item] }}" loop: - - mosquitto-mosquitto-1" + - mosquitto-mosquitto-1 when: '"mosquitto" in selected_containers' -- name: Add elements to a list - - debug: msg: "{{ docker_containers }}"