Compare commits

..

7 Commits

Author SHA1 Message Date
b002c955ec klal
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 0s
2025-07-08 19:43:51 +02:00
468c7ac9f0 klal 2025-07-08 19:21:49 +02:00
83ab1ffce5 klal 2025-07-08 19:20:24 +02:00
466c23e7fa klal 2025-07-08 19:03:03 +02:00
41e6a176aa klal 2025-07-08 18:54:44 +02:00
3845ab304a klal 2025-07-08 18:50:56 +02:00
6def5b14b7 klal 2025-07-08 18:45:50 +02:00

View File

@@ -8,7 +8,7 @@
- name: Get config for nas
ansible.builtin.set_fact:
zabbix_agent_cfg: "/opt/ZabbixAgent/etc/zabbix_agentd.conf"
zabbix_agent_cfg: "/opt/ZabbixAgent/etc/zabbix_agent2.conf"
when: inventory_hostname == 'nas.home.lan'
- name: Print all available facts
@@ -28,22 +28,22 @@
# ansible.builtin.copy:
# src: packages/zabbix-release_6.4-1+ubuntu22.04_all.deb
# dest: /tmp/
- name: Install a .deb package from the internet111
- name: Install a .deb package from the Ubuntu
ansible.builtin.apt:
deb: https://repo.zabbix.com/zabbix/7.2/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.2+ubuntu24.04_all.deb
deb: https://repo.zabbix.com/zabbix/7.4/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.4+ubuntu24.04_all.deb
when:
- ansible_facts.architecture != "armv7l" and ( ansible_distribution == "Ubuntu1" or ansible_distribution == "Linux Mint" )
- ansible_facts.architecture != "armv7l" and ( ansible_distribution == "Ubuntu" or ansible_distribution == "Linux Mint" )
- 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.2/release/raspbian/pool/main/z/zabbix-release/zabbix-release_latest_7.2+debian12_all.deb
retries: 5
delay: 5
when:
- ansible_facts.architecture == "armv7l" or ansible_facts.architecture == "aarch64"
register: command_result
failed_when: "'FAILED' in command_result.stderr"
# - 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.2/release/raspbian/pool/main/z/zabbix-release/zabbix-release_latest_7.2+debian12_all.deb
# retries: 5
# delay: 5
# when:
# - ansible_facts.architecture == "armv7l" or ansible_facts.architecture == "aarch64"
# register: command_result
# failed_when: "'FAILED' in command_result.stderr"
- name: Install a .deb package from the internet3
ansible.builtin.apt:
@@ -51,10 +51,10 @@
when:
- ansible_facts.architecture != "armv7l" and ansible_distribution == "Debian" and ansible_distribution_major_version == "11"
- name: Install a .deb package from the internet4
- name: Install a .deb package from the Debian 12
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
deb: https://repo.zabbix.com/zabbix/7.4/release/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.4+debian12_all.deb
when:
- ansible_facts.architecture != "armv7l"
- ansible_facts.architecture != "aarch64"
@@ -73,8 +73,9 @@
- zabbix-agent2-plugin-postgresql
#- zabbix-agent2-plugin-mysql
update_cache: true
when: inventory_hostname != 'nas.home.lan'
- name: Install zabbix packages
- name: Upgrade zabbix packages
ansible.builtin.apt:
name:
- zabbix-agent2
@@ -82,6 +83,7 @@
- zabbix-agent2-plugin-postgresql
#- zabbix-agent2-plugin-mysql
only_upgrade: true
state: latest
when: inventory_hostname != 'nas.home.lan'
- name: Reconfigure zabbix agent Server
@@ -110,6 +112,19 @@
# regexp: "^ListenIP=.*"
# line: "ListenIP=0.0.0.0"
- name: Reconfigure zabbix-agent2 HeartbeatFrequency
ansible.builtin.lineinfile:
path: "{{ zabbix_agent_cfg }}"
insertafter: '^# HeartbeatFrequency='
regexp: "^HeartbeatFrequency=.*"
line: "HeartbeatFrequency=30"
- name: Reconfigure zabbix-agent2 ForceActiveChecksOnStart
ansible.builtin.lineinfile:
path: "{{ zabbix_agent_cfg }}"
insertafter: '^# ForceActiveChecksOnStart='
regexp: "^ForceActiveChecksOnStart=.*"
line: "ForceActiveChecksOnStart=1"
- name: Reconfigure zabbix-agent2 hostname
ansible.builtin.lineinfile: