mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-09-13 20:20:11 +02:00
Compare commits
7 Commits
3732db698e
...
b002c955ec
Author | SHA1 | Date | |
---|---|---|---|
b002c955ec | |||
468c7ac9f0 | |||
83ab1ffce5 | |||
466c23e7fa | |||
41e6a176aa | |||
3845ab304a | |||
6def5b14b7 |
@@ -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"
|
||||
@@ -71,17 +71,19 @@
|
||||
- zabbix-agent2
|
||||
- zabbix-agent2-plugin-mongodb
|
||||
- zabbix-agent2-plugin-postgresql
|
||||
# - zabbix-agent2-plugin-mysql
|
||||
#- 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
|
||||
- zabbix-agent2-plugin-mongodb
|
||||
- zabbix-agent2-plugin-postgresql
|
||||
# - zabbix-agent2-plugin-mysql
|
||||
#- 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:
|
||||
|
Reference in New Issue
Block a user