summaryrefslogtreecommitdiffstats
path: root/ansible_collections/community/zabbix
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:22:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:22:20 +0000
commit18bd2207b6c1977e99a93673a7be099e23f0f547 (patch)
tree40fd9e5913462a88be6ba24be6953383c5b39874 /ansible_collections/community/zabbix
parentReleasing progress-linux version 10.0.1+dfsg-1~progress7.99u1. (diff)
downloadansible-18bd2207b6c1977e99a93673a7be099e23f0f547.tar.xz
ansible-18bd2207b6c1977e99a93673a7be099e23f0f547.zip
Merging upstream version 10.1.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/community/zabbix')
-rw-r--r--ansible_collections/community/zabbix/.github/workflows/agent.yml3
-rw-r--r--ansible_collections/community/zabbix/.github/workflows/javagateway.yml3
-rw-r--r--ansible_collections/community/zabbix/.github/workflows/proxy.yml19
-rw-r--r--ansible_collections/community/zabbix/.github/workflows/server.yml6
-rw-r--r--ansible_collections/community/zabbix/.github/workflows/web.yml4
-rw-r--r--ansible_collections/community/zabbix/CHANGELOG.rst32
-rw-r--r--ansible_collections/community/zabbix/FILES.json606
-rw-r--r--ansible_collections/community/zabbix/MANIFEST.json4
-rw-r--r--ansible_collections/community/zabbix/README.md2
-rw-r--r--ansible_collections/community/zabbix/changelogs/.plugin-cache.yaml32
-rw-r--r--ansible_collections/community/zabbix/changelogs/changelog.yaml2059
-rw-r--r--ansible_collections/community/zabbix/docs/ZABBIX_AGENT_ROLE.md291
-rw-r--r--ansible_collections/community/zabbix/docs/ZABBIX_JAVAGATEWAY_ROLE.md1
-rw-r--r--ansible_collections/community/zabbix/docs/ZABBIX_PROXY_ROLE.md1
-rw-r--r--ansible_collections/community/zabbix/docs/ZABBIX_SERVER_ROLE.md1
-rw-r--r--ansible_collections/community/zabbix/docs/ZABBIX_WEB_ROLE.md1
-rw-r--r--ansible_collections/community/zabbix/molecule/requirements.txt4
-rw-r--r--ansible_collections/community/zabbix/molecule/zabbix_agent_tests/common/molecule.yml2
-rw-r--r--ansible_collections/community/zabbix/molecule/zabbix_agent_tests/molecule/agent2/molecule.yml3
-rw-r--r--ansible_collections/community/zabbix/molecule/zabbix_proxy/Dockerfile.debian.j23
-rw-r--r--ansible_collections/community/zabbix/molecule/zabbix_proxy/Dockerfile.redhat.j23
-rw-r--r--ansible_collections/community/zabbix/molecule/zabbix_proxy/molecule.yml11
-rw-r--r--ansible_collections/community/zabbix/molecule/zabbix_proxy/prepare.yml16
-rw-r--r--ansible_collections/community/zabbix/molecule/zabbix_server/molecule.yml9
-rw-r--r--ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml11
-rw-r--r--ansible_collections/community/zabbix/plugins/modules/zabbix_discoveryrule.py460
-rw-r--r--ansible_collections/community/zabbix/plugins/modules/zabbix_host_events_update.py244
-rw-r--r--ansible_collections/community/zabbix/plugins/modules/zabbix_item.py579
-rw-r--r--ansible_collections/community/zabbix/plugins/modules/zabbix_itemprototype.py609
-rw-r--r--ansible_collections/community/zabbix/plugins/modules/zabbix_script.py66
-rw-r--r--ansible_collections/community/zabbix/plugins/modules/zabbix_trigger.py444
-rw-r--r--ansible_collections/community/zabbix/plugins/modules/zabbix_triggerprototype.py448
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/README.md291
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/defaults/main.yml147
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Debian.yml45
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Linux.yml84
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows.yml58
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows_conf.yml5
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/api.yml45
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/main.yml98
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/psk_identity.yml84
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/psk_secret.yml112
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/selinux.yml2
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto.yml14
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2.yml14
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_common.yml53
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_linux.yml80
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_windows.yml66
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_common.yml52
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_linux.yml80
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_windows.yml67
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/templates/agent.conf.j2142
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/templates/zabbix_agent2.conf.j2140
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/templates/zabbix_agentd.conf.j2149
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/vars/Debian.yml7
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/vars/RedHat.yml3
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/vars/agent2_vars.yml9
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_agent/vars/agent_vars.yml10
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_javagateway/README.md1
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_javagateway/tasks/Debian.yml5
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_javagateway/vars/Debian.yml3
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/README.md1
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/defaults/main.yml2
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/Debian.yml106
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/RedHat.yml108
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-mysql.yml144
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-pgsql.yml73
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-sqlite3.yml62
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/main.yml68
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/mysql.yml172
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/postgresql.yml96
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/sqlite3.yml63
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/templates/zabbix_proxy.conf.j22
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/vars/Debian.yml31
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/vars/RedHat.yml34
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_proxy/vars/main.yml7
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_server/README.md1
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_server/defaults/main.yml12
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_server/tasks/RedHat.yml3
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-mysql.yml5
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-pgsql.yml16
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_server/tasks/selinux.yml116
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_server/vars/Debian.yml3
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_web/README.md1
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_web/templates/php-fpm.conf.j22
-rw-r--r--ansible_collections/community/zabbix/roles/zabbix_web/vars/Debian.yml3
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/meta/main.yml3
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/main.yml29
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_setup.yml25
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_teardown.yml9
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_tests.yml147
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/meta/main.yml3
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/main.yml13
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_setup.yml61
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_teardown.yml9
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_tests.yml59
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/meta/main.yml3
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/main.yml28
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_setup.yml25
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_teardown.yml9
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_tests.yml246
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/meta/main.yml3
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/main.yml30
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_setup.yml36
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_teardown.yml9
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_tests.yml248
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/meta/main.yml3
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/main.yml28
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_setup.yml47
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_teardown.yml21
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_tests.yml159
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/meta/main.yml3
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/main.yml44
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_setup.yml48
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_teardown.yml15
-rw-r--r--ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_tests.yml180
116 files changed, 7195 insertions, 3322 deletions
diff --git a/ansible_collections/community/zabbix/.github/workflows/agent.yml b/ansible_collections/community/zabbix/.github/workflows/agent.yml
index 55b7e1b72..e081e6721 100644
--- a/ansible_collections/community/zabbix/.github/workflows/agent.yml
+++ b/ansible_collections/community/zabbix/.github/workflows/agent.yml
@@ -22,6 +22,7 @@ jobs:
container:
- rockylinux9
- rockylinux8
+ - ubuntu2404
- ubuntu2204
- ubuntu2004
- ubuntu1804
@@ -40,6 +41,8 @@ jobs:
exclude:
- container: debian12
version: v62
+ - container: ubuntu2404
+ version: v62
steps:
- name: Check out code
diff --git a/ansible_collections/community/zabbix/.github/workflows/javagateway.yml b/ansible_collections/community/zabbix/.github/workflows/javagateway.yml
index 22bc5ede1..96ca2a8b7 100644
--- a/ansible_collections/community/zabbix/.github/workflows/javagateway.yml
+++ b/ansible_collections/community/zabbix/.github/workflows/javagateway.yml
@@ -23,6 +23,7 @@ jobs:
- rockylinux9
- rockylinux8
- centos7
+ - ubuntu2404
- ubuntu2204
- ubuntu2004
- ubuntu1804
@@ -40,6 +41,8 @@ jobs:
exclude:
- container: debian12
version: v62
+ - container: ubuntu2404
+ version: v62
collection_role:
- zabbix_javagateway
steps:
diff --git a/ansible_collections/community/zabbix/.github/workflows/proxy.yml b/ansible_collections/community/zabbix/.github/workflows/proxy.yml
index ad5f61b34..5618a0633 100644
--- a/ansible_collections/community/zabbix/.github/workflows/proxy.yml
+++ b/ansible_collections/community/zabbix/.github/workflows/proxy.yml
@@ -23,6 +23,7 @@ jobs:
- rockylinux9
- rockylinux8
- centos7
+ - ubuntu2404
- ubuntu2204
- ubuntu2004
- ubuntu1804
@@ -39,12 +40,13 @@ jobs:
- v64
- v62
- v60
- include:
- - interpreter: python3
- - interpreter: python
- container: centos7
exclude:
- - container: debian12
+ - container:
+ name: debian12
+ base_image: debian:12
+ os_family: debian
+ version: v62
+ - container: ubuntu2404
version: v62
steps:
- name: Check out code
@@ -78,10 +80,9 @@ jobs:
- name: Run role tests
run: >-
- MY_MOLECULE_CONTAINER=${{ matrix.container }}
- MY_MOLECULE_IMAGE=${{ matrix.container }}
+ MY_MOLECULE_CONTAINER=${{ matrix.container.name }}
+ MY_MOLECULE_IMAGE=${{ matrix.container.base_image }}
+ MY_MOLECULE_OS_FAMILY=${{ matrix.container.os_family }}
MY_MOLECULE_VERSION=${{ matrix.version }}
MY_MOLECULE_DATABASE=${{ matrix.database }}
- MY_MOLECULE_INTERPRETER=${{ matrix.interpreter }}
- MY_MOLECULE_DOCKER_COMMAND=${{ matrix.command }}
molecule test -s ${{ matrix.collection_role }}
diff --git a/ansible_collections/community/zabbix/.github/workflows/server.yml b/ansible_collections/community/zabbix/.github/workflows/server.yml
index 33f5cd5fd..9ca8f3761 100644
--- a/ansible_collections/community/zabbix/.github/workflows/server.yml
+++ b/ansible_collections/community/zabbix/.github/workflows/server.yml
@@ -22,6 +22,7 @@ jobs:
container:
- rockylinux9
- rockylinux8
+ - ubuntu2404
- ubuntu2204
- ubuntu2004
- ubuntu1804
@@ -37,13 +38,13 @@ jobs:
- v64
- v62
- v60
- include:
- - interpreter: python3
exclude:
- container: debian12
version: v62
- container: debian10
version: v62
+ - container: ubuntu2404
+ version: v62
- container: ubuntu1804
version: v62
- container: ubuntu1804
@@ -86,6 +87,5 @@ jobs:
MY_MOLECULE_IMAGE=${{ matrix.container }}
MY_MOLECULE_VERSION=${{ matrix.version }}
MY_MOLECULE_DATABASE=${{ matrix.database }}
- MY_MOLECULE_INTERPRETER=${{ matrix.interpreter }}
MY_MOLECULE_DOCKER_COMMAND=${{ matrix.command }}
molecule test -s ${{ matrix.collection_role }}
diff --git a/ansible_collections/community/zabbix/.github/workflows/web.yml b/ansible_collections/community/zabbix/.github/workflows/web.yml
index 0541a2457..ec60c540d 100644
--- a/ansible_collections/community/zabbix/.github/workflows/web.yml
+++ b/ansible_collections/community/zabbix/.github/workflows/web.yml
@@ -22,6 +22,7 @@ jobs:
container:
- rockylinux9
- rockylinux8
+ - ubuntu2404
- ubuntu2204
- ubuntu2004
- ubuntu1804
@@ -35,6 +36,7 @@ jobs:
- pgsql
web_server:
- nginx
+ - apache
version:
- v64
- v62
@@ -44,6 +46,8 @@ jobs:
exclude:
- container: debian10
version: v62
+ - container: ubuntu2404
+ version: v62
- container: ubuntu1804
version: v62
- container: debian10
diff --git a/ansible_collections/community/zabbix/CHANGELOG.rst b/ansible_collections/community/zabbix/CHANGELOG.rst
index 4675d1a5a..e108bccf4 100644
--- a/ansible_collections/community/zabbix/CHANGELOG.rst
+++ b/ansible_collections/community/zabbix/CHANGELOG.rst
@@ -4,6 +4,38 @@ community.zabbix Release Notes
.. contents:: Topics
+v2.5.1
+======
+
+Bugfixes
+-------------
+
+- zabbix_agent - Fix reading existing psk
+- zabbix_agent - Fix role when zabbix_agent_listenip is undefined
+
+v2.5.0
+======
+
+Minor Changes
+-------------
+
+- agent role - Standardized all configuration variables using the `zabbix_agent` prefix vs `zabbix_agent2`. Support for `zabbix_agent2` to be removed in 3.0.0
+- agent role - Standardized templating of agent.conf file
+- all roles - Added support for Ubuntu 24.04 (Noble Numbat)
+- zabbix_discoveryrule module added
+- zabbix_host_events_update module added
+- zabbix_item - add support for setting master items by name
+- zabbix_item module added
+- zabbix_itemprototype - add support for setting master items by name
+- zabbix_itemprototype module added
+- zabbix_trigger module added
+- zabbix_triggerprototype module added
+
+Bugfixes
+--------
+
+- zabbix_web - make the FPM socket group-writable so the web server can properly forward requests to the FPM process
+
v2.4.0
======
diff --git a/ansible_collections/community/zabbix/FILES.json b/ansible_collections/community/zabbix/FILES.json
index 694f37957..260909068 100644
--- a/ansible_collections/community/zabbix/FILES.json
+++ b/ansible_collections/community/zabbix/FILES.json
@@ -46,14 +46,14 @@
"name": ".github/workflows/agent.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "ab09e77c1cfb09d0ead5281bcfcd6cfb54d6eaa8380affbd53ec47c38c577855",
+ "chksum_sha256": "1a3f73038e09c3ca8fd53f6d8efaa24e465a1a08178521b22755ba7056394069",
"format": 1
},
{
"name": ".github/workflows/javagateway.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "5fece5724408d5a2170a22b1fdedf601451248c723f84066b7d1076dff06dbec",
+ "chksum_sha256": "dc04855a3440f2cf55603398b8d8706fa83d3e7932b9f38f166d2a08a7c98b58",
"format": 1
},
{
@@ -67,7 +67,7 @@
"name": ".github/workflows/proxy.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "f21f654a95b514e188c7cc090b21685521112a90610fef14bc487301141b17af",
+ "chksum_sha256": "6c52fb341cd0a40742fd5439bfe8e9712be2c6f8e010bbb6823e68600deeabee",
"format": 1
},
{
@@ -81,14 +81,14 @@
"name": ".github/workflows/server.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "1925557e00452541d0105523033dba1edd9e3ee8ca95b3373c006c1f96973380",
+ "chksum_sha256": "390206c1dc52ff10f3b070a6e3c7622a3739c3c20bddd1eff81452d10b7f0c12",
"format": 1
},
{
"name": ".github/workflows/web.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "b8665c7b983f6b76cba7da881ab0cd450439217a5bd519ae7f30933a3ded554a",
+ "chksum_sha256": "941a823245cc7a3a02b6ca32253be2ebe01cf508f528e30db8adc186da94cbce",
"format": 1
},
{
@@ -116,14 +116,14 @@
"name": "changelogs/.plugin-cache.yaml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "ddbed2431f771d0b08ec1059fcfc03df63768d78c59488ffadfddae737f52028",
+ "chksum_sha256": "1cfb6d46aa54a0ee195c96b60658034de0b050f738aa69088189fa7050795117",
"format": 1
},
{
"name": "changelogs/changelog.yaml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "25653a4be548f83eb8db9059d833a8298cc278f4ff812ff3b79abaa9fcb63f1e",
+ "chksum_sha256": "91af3d023ce10a9f731f26bbf291cff608e2d77e8ba8a6fd8536740eb7334207",
"format": 1
},
{
@@ -158,35 +158,35 @@
"name": "docs/ZABBIX_AGENT_ROLE.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "d256f34122a50d20bf5d074df98558de74774e591bb2bc309e858ab0f2c7a7b8",
+ "chksum_sha256": "78d04c48530cd39414bee760f67411ba56a003f0b367155248a0bf883a54d923",
"format": 1
},
{
"name": "docs/ZABBIX_JAVAGATEWAY_ROLE.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "168aae7236576e4baf77c7b056833d5c90527c99365d7c9487f05f7af4d7281a",
+ "chksum_sha256": "73778abc24b8eb27b6243c4d04bd38dc8030f8092bfde3297c15221ba565eec6",
"format": 1
},
{
"name": "docs/ZABBIX_PROXY_ROLE.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "5fb7298372379197055d9221660fa37ec078d7b2c5aaa4545ed09a943daa7baf",
+ "chksum_sha256": "830cf0d2a76423c1146ab807bee53a80bb9f5839ee4954b1cc804ae20207321c",
"format": 1
},
{
"name": "docs/ZABBIX_SERVER_ROLE.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "e7b83a2f01c4ef1388cba62476dbbe0596c483b345f4a79aabc2cd107cf16b61",
+ "chksum_sha256": "dd08d146c7fbbdef236be08abb9c035456e7d5f635a5748200fb7cbdb965f734",
"format": 1
},
{
"name": "docs/ZABBIX_WEB_ROLE.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "c52def2249d4416ac228eb03d6b57322578e2fb5c118967fb1e11634ff66f64f",
+ "chksum_sha256": "836bbcc7e6ca298e93435670eefa94582bb44bfc7abf6a42e76ee814d41b88cb",
"format": 1
},
{
@@ -319,7 +319,7 @@
"name": "molecule/zabbix_agent_tests/common/molecule.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "9ce9330c02c7d06dca39d7b31e1683ffd552bb341f35603fbb42659e3915a0ac",
+ "chksum_sha256": "7a4976cef41847257588e2004f9f8373cdbba1e59063335f5d4fcc531e964e4d",
"format": 1
},
{
@@ -375,7 +375,7 @@
"name": "molecule/zabbix_agent_tests/molecule/agent2/molecule.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "54630476f85b1859cf8f37f43b64631c0b6b87b1d1a151ae9f0ab8baaa7ce7ad",
+ "chksum_sha256": "40a1bfa5c04054e27b104891af91a489467b3cbc1b8c0c59f206a75a96154a74",
"format": 1
},
{
@@ -575,6 +575,20 @@
"format": 1
},
{
+ "name": "molecule/zabbix_proxy/Dockerfile.debian.j2",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "f98266549b4f1b7f99ae7054a70f01178b67f2490e7a32b5545fa0a162a5ee81",
+ "format": 1
+ },
+ {
+ "name": "molecule/zabbix_proxy/Dockerfile.redhat.j2",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "a1b4ae72a87e1e9e345c160fd67ef58426b17818be0c241e71f70456c57fd608",
+ "format": 1
+ },
+ {
"name": "molecule/zabbix_proxy/converge.yml",
"ftype": "file",
"chksum_type": "sha256",
@@ -592,14 +606,14 @@
"name": "molecule/zabbix_proxy/molecule.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "4800b75f49e7496f80ace71d84f8f07dc7b9335c8f158bc4155c44a8d8492cc1",
+ "chksum_sha256": "842bcdb7a60fc380948cb88038df9bf01b519339f43307ed294504acaad49f24",
"format": 1
},
{
"name": "molecule/zabbix_proxy/prepare.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "4495bcd19fac7b44c8d02c80133e37f554c1f66244a10c4a88e85c11ce97b814",
+ "chksum_sha256": "8fd3ba0ba2765ed0f99a4ebc6e67382df921b9b39e7f2eb2b8ff644a3c6cd3d0",
"format": 1
},
{
@@ -641,7 +655,7 @@
"name": "molecule/zabbix_server/molecule.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "7c0b54e3f4f40288f5a772263d1f56a44aebb39e70aad6ec542546b40d7653a9",
+ "chksum_sha256": "f3d361e2f88015820269ebb93c8ff98e0a399a67adf30d3ab38ff375a148fae1",
"format": 1
},
{
@@ -697,7 +711,7 @@
"name": "molecule/zabbix_web/prepare.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "7628246084a0692187d2408ee30afc478999d24c1e08d6fc0609f59ed828b23e",
+ "chksum_sha256": "63917b4d79946207e2ad7207270b94a11e25b058c7eafb040934f1b3560affc8",
"format": 1
},
{
@@ -711,7 +725,7 @@
"name": "molecule/requirements.txt",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "26a9987c8545a84ddf26c2774fc1bf16c0dc68fa790dde49b46ce17a1720700e",
+ "chksum_sha256": "ad376f71f1e8d1bcff190d8588e99e6840df2e7296451c4eda7ce7b6663c13a2",
"format": 1
},
{
@@ -862,6 +876,13 @@
"format": 1
},
{
+ "name": "plugins/modules/zabbix_discoveryrule.py",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "bc1a58588a502206fdfc5e4aa1858e276c4e3e6605a5493a314ce81f4b217be1",
+ "format": 1
+ },
+ {
"name": "plugins/modules/zabbix_globalmacro.py",
"ftype": "file",
"chksum_type": "sha256",
@@ -904,6 +925,13 @@
"format": 1
},
{
+ "name": "plugins/modules/zabbix_host_events_update.py",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "c83f644554957ef349547a69fa1c7e31b3a03ee5fc5813e94ca1ac16de580a4b",
+ "format": 1
+ },
+ {
"name": "plugins/modules/zabbix_host_info.py",
"ftype": "file",
"chksum_type": "sha256",
@@ -925,6 +953,20 @@
"format": 1
},
{
+ "name": "plugins/modules/zabbix_item.py",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "db8b030def44167e1055ec383657a9f36b3fadc94eaf1868b506affa4e019f51",
+ "format": 1
+ },
+ {
+ "name": "plugins/modules/zabbix_itemprototype.py",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "875437704fa98e70323feaf57e93a67b043f10e99d93eb1adfd4444b53260ed8",
+ "format": 1
+ },
+ {
"name": "plugins/modules/zabbix_maintenance.py",
"ftype": "file",
"chksum_type": "sha256",
@@ -970,7 +1012,7 @@
"name": "plugins/modules/zabbix_script.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "3fd732f7f929a0dbe91dbaa4ce1d2c7fcd86b0c5199ee9ca5d9db8e3f471b613",
+ "chksum_sha256": "f3f5e363e8f868bc48cbb55a1783bceb6d023994090c7e03aeff87032cca3a76",
"format": 1
},
{
@@ -1023,6 +1065,20 @@
"format": 1
},
{
+ "name": "plugins/modules/zabbix_trigger.py",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "d754c83db1214459d67ebefcab4143303dc057e87a9bf98ca3e9022ddee68eba",
+ "format": 1
+ },
+ {
+ "name": "plugins/modules/zabbix_triggerprototype.py",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "01a3cf27999c442150706f08c9b6b220a726672605e454cdbfce3bba620f7baf",
+ "format": 1
+ },
+ {
"name": "plugins/modules/zabbix_user.py",
"ftype": "file",
"chksum_type": "sha256",
@@ -1082,7 +1138,7 @@
"name": "roles/zabbix_agent/README.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "d256f34122a50d20bf5d074df98558de74774e591bb2bc309e858ab0f2c7a7b8",
+ "chksum_sha256": "78d04c48530cd39414bee760f67411ba56a003f0b367155248a0bf883a54d923",
"format": 1
},
{
@@ -1096,7 +1152,7 @@
"name": "roles/zabbix_agent/defaults/main.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "7465f741a1390bc62b1f30f3daf28f271ad94942c2f727fabfe576277fd4c1f3",
+ "chksum_sha256": "0e723f2914d13b84e8ca7411a5d7679a5a051c213a157862ba81456ba7103ae7",
"format": 1
},
{
@@ -1243,7 +1299,7 @@
"name": "roles/zabbix_agent/tasks/Debian.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "97c991dcccf9ab92bad90d36caf6e2d3bdd2b9eb9461aded42696b3e76c7b1ad",
+ "chksum_sha256": "90e5f8ceaae327a890c2c4a77b6d3a194442d27327344cf7f07d7487826a8913",
"format": 1
},
{
@@ -1257,7 +1313,7 @@
"name": "roles/zabbix_agent/tasks/Linux.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "4cbe916769cde150073a71e1ac8b5e9a3a531ba6a17782944e4e758433877ff8",
+ "chksum_sha256": "f547026740b272e5dc1b65993e088c876c6bb31d90c7a872af82f62f74ab6de2",
"format": 1
},
{
@@ -1271,21 +1327,21 @@
"name": "roles/zabbix_agent/tasks/Windows.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "709a0466886c5bf5ed5f560b987cf68d268fff906a6dd26b667c25654d37fe81",
+ "chksum_sha256": "d224fef134ce06d2723ea4f565e72f34dab2c890d2152374080ec67c23223bbd",
"format": 1
},
{
"name": "roles/zabbix_agent/tasks/Windows_conf.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "ba0da2675127cf58cfa66ba4e977f15f2f856654fb7583826865276fa10c6262",
+ "chksum_sha256": "626952830d71ad912b6007a647ce3c1f58129f26dee4cccb0f8d96b8338aedd6",
"format": 1
},
{
"name": "roles/zabbix_agent/tasks/api.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "8201b0dc1b00dd86383f272dd81f06e792f8bab1951aee62c03a46791ca5b4bb",
+ "chksum_sha256": "bf5750468e57278a4174ff2accecd2aac7431678cdc32b9f8822ab9f592e6eb5",
"format": 1
},
{
@@ -1299,77 +1355,35 @@
"name": "roles/zabbix_agent/tasks/main.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "7ceb0be05f5fb90c9d007ae64a43ca66fa855c484410df95c46e41853a44f5bd",
- "format": 1
- },
- {
- "name": "roles/zabbix_agent/tasks/remove.yml",
- "ftype": "file",
- "chksum_type": "sha256",
- "chksum_sha256": "a61614e0f51ef087ef82eb2319b8546f213c22aff785afdf56f007c442b6cb2c",
- "format": 1
- },
- {
- "name": "roles/zabbix_agent/tasks/selinux.yml",
- "ftype": "file",
- "chksum_type": "sha256",
- "chksum_sha256": "5b48575676d826c5e6321daddab3713fbbd76ba575400f29eeafc277017b9fe2",
- "format": 1
- },
- {
- "name": "roles/zabbix_agent/tasks/tlspsk_auto.yml",
- "ftype": "file",
- "chksum_type": "sha256",
- "chksum_sha256": "bcf8266fdd6b7d01d5a6bb97a3f4c1982ca7dc099dedcaa407390c69bbeaa7e6",
- "format": 1
- },
- {
- "name": "roles/zabbix_agent/tasks/tlspsk_auto_agent2.yml",
- "ftype": "file",
- "chksum_type": "sha256",
- "chksum_sha256": "1d0eafd6fefb287832c5b42c80c37c2b2e049b937aa50f44d7040ce56d81db86",
- "format": 1
- },
- {
- "name": "roles/zabbix_agent/tasks/tlspsk_auto_agent2_common.yml",
- "ftype": "file",
- "chksum_type": "sha256",
- "chksum_sha256": "3f194c4720b68b5eb4003effe148b6c379a650f91d5325147d3e43485d37ba7b",
- "format": 1
- },
- {
- "name": "roles/zabbix_agent/tasks/tlspsk_auto_agent2_linux.yml",
- "ftype": "file",
- "chksum_type": "sha256",
- "chksum_sha256": "3d651d820f7be9fd52d0b752f6ad07fc3e41a7ba52f178ae1221e1e2419980d9",
+ "chksum_sha256": "6b5494d41937dcbb34b1265a741f93d5a1f3731d969853b404394d6800256066",
"format": 1
},
{
- "name": "roles/zabbix_agent/tasks/tlspsk_auto_agent2_windows.yml",
+ "name": "roles/zabbix_agent/tasks/psk_identity.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "416c701d66781d97032e1104e5c25abe4157740f517fdcc5ffea5f5bb14fc9cf",
+ "chksum_sha256": "907f08566fb0f5f7f9c3b0e870372670668a736ad901992d9a8636b47bc419cf",
"format": 1
},
{
- "name": "roles/zabbix_agent/tasks/tlspsk_auto_common.yml",
+ "name": "roles/zabbix_agent/tasks/psk_secret.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "4be3dadd8bfa5cc2aae3de2b975040f6352fee46127b7ccba2b746f11cfdd39a",
+ "chksum_sha256": "eb90d955ee19eec7588a60aa07734565c56aa91d1ddc615b8624ca50e078b73d",
"format": 1
},
{
- "name": "roles/zabbix_agent/tasks/tlspsk_auto_linux.yml",
+ "name": "roles/zabbix_agent/tasks/remove.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "1b494062174c84263883f71ed50842255bc270246afbe12f8573bc2e81ea10a9",
+ "chksum_sha256": "a61614e0f51ef087ef82eb2319b8546f213c22aff785afdf56f007c442b6cb2c",
"format": 1
},
{
- "name": "roles/zabbix_agent/tasks/tlspsk_auto_windows.yml",
+ "name": "roles/zabbix_agent/tasks/selinux.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "bf3c3976e28fb3846de16e0a0e01eae0184d2cf57b79da0a342a5d5b35b187d8",
+ "chksum_sha256": "4e5323cf7121df09fffb2b53749f46bbd6fae95eb715febddc01a086330f55ee",
"format": 1
},
{
@@ -1408,17 +1422,10 @@
"format": 1
},
{
- "name": "roles/zabbix_agent/templates/zabbix_agent2.conf.j2",
- "ftype": "file",
- "chksum_type": "sha256",
- "chksum_sha256": "123866b68a1511d56e14a523035583e6a3adcf8d234abd086f4b7ba0e322df4b",
- "format": 1
- },
- {
- "name": "roles/zabbix_agent/templates/zabbix_agentd.conf.j2",
+ "name": "roles/zabbix_agent/templates/agent.conf.j2",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "d3c56ebbe34908eaa981e1838ee17ab90729814dce584c1b3e66ab2455ac6f0f",
+ "chksum_sha256": "25f9094a4ad3df674d6c2a69b70b2533931e5dc1a3fa5b96e9165583e3f0546f",
"format": 1
},
{
@@ -1432,14 +1439,14 @@
"name": "roles/zabbix_agent/vars/Debian.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "b3fdab5e28c143947f965aa38b670a83726994f8e6fb37b7fac24350c9471a28",
+ "chksum_sha256": "ac1d08f8f30dcacd8fb63cd281bb86864df6fc75fa64bb259c172351361ebf25",
"format": 1
},
{
"name": "roles/zabbix_agent/vars/RedHat.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "587c2d75417faa8978fdcc729a4b940b4530c5a02df59a049985ab684742e90c",
+ "chksum_sha256": "39a539d0a9c528df8dae3d18f2c39c567f335c40a0da40d3f0798734ad0b78fa",
"format": 1
},
{
@@ -1450,6 +1457,20 @@
"format": 1
},
{
+ "name": "roles/zabbix_agent/vars/agent2_vars.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "3fddc386eaaf3a02f856496a82ba80cfd55b5141be86e8065c1dfffd53d2c40b",
+ "format": 1
+ },
+ {
+ "name": "roles/zabbix_agent/vars/agent_vars.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "c685651c7d6a30c6f777b6e03b127415be7fa3c117ac92a8deadf143b30c0eda",
+ "format": 1
+ },
+ {
"name": "roles/zabbix_agent/vars/main.yml",
"ftype": "file",
"chksum_type": "sha256",
@@ -1467,7 +1488,7 @@
"name": "roles/zabbix_javagateway/README.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "168aae7236576e4baf77c7b056833d5c90527c99365d7c9487f05f7af4d7281a",
+ "chksum_sha256": "73778abc24b8eb27b6243c4d04bd38dc8030f8092bfde3297c15221ba565eec6",
"format": 1
},
{
@@ -1537,7 +1558,7 @@
"name": "roles/zabbix_javagateway/tasks/Debian.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "44f9adfe675690b1901bf67f5c60da034bbbc4448476f3a2d69993a180f9dedc",
+ "chksum_sha256": "374d257d5e917832cb625815075a3cb2f2c9fed5f84a78d66b357ce5b49590ed",
"format": 1
},
{
@@ -1579,7 +1600,7 @@
"name": "roles/zabbix_javagateway/vars/Debian.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "be7796f9ccb7e43552833863142669694201bba88e396406f29f8881e28f381a",
+ "chksum_sha256": "d10507c4456ec9dc27e7b7f40e30021b77c6fdeeda4a5d0d05c8e40c8e7130d7",
"format": 1
},
{
@@ -1607,7 +1628,7 @@
"name": "roles/zabbix_proxy/README.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "5fb7298372379197055d9221660fa37ec078d7b2c5aaa4545ed09a943daa7baf",
+ "chksum_sha256": "830cf0d2a76423c1146ab807bee53a80bb9f5839ee4954b1cc804ae20207321c",
"format": 1
},
{
@@ -1621,7 +1642,7 @@
"name": "roles/zabbix_proxy/defaults/main.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "33dcb508919b88bf2ef0b1c6bc5b121a67392553e54a58b55bf572bf00ea5d53",
+ "chksum_sha256": "8d5ca9ac229870d22e2dca4de415d75bfacab2b28936226e2de5287f15231064",
"format": 1
},
{
@@ -1677,49 +1698,49 @@
"name": "roles/zabbix_proxy/tasks/Debian.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "92c82d7303b5ec4b9e688bdb8017e5f213993f9c66007ad95846b2db30cfb414",
+ "chksum_sha256": "57390fe9245af2542ec93677de19af09d5a87bd49118e814a032d3890a7e0d31",
"format": 1
},
{
"name": "roles/zabbix_proxy/tasks/RedHat.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "4b521fd4998782a7fd2e5e8c4bea84d5436dd9e63b0732a0590034181e5c6329",
+ "chksum_sha256": "933044c1ae7c99784e5136f6bedb840df2db4a7c6b7ab294438dda1041e42251",
"format": 1
},
{
- "name": "roles/zabbix_proxy/tasks/main.yml",
+ "name": "roles/zabbix_proxy/tasks/initialize-mysql.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "3751caa6aaa36f2f878f60bd81a53ff4fb6dc1e45c0e9ec6c8c195fc3da765a1",
+ "chksum_sha256": "832de47bd3469c7c00fd3e5ec1550cf7a288b7e00b021b14e2e673231380bc2e",
"format": 1
},
{
- "name": "roles/zabbix_proxy/tasks/mysql.yml",
+ "name": "roles/zabbix_proxy/tasks/initialize-pgsql.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "ea5c5f6380e122e9b658d4acd5e8a382fa6c564673ec37c947a92f95f0b24ec5",
+ "chksum_sha256": "066bd0942f8b3e81ed6ef627f6ea8d15e4a487cdfcf94052c0cae32cefb04b92",
"format": 1
},
{
- "name": "roles/zabbix_proxy/tasks/postgresql.yml",
+ "name": "roles/zabbix_proxy/tasks/initialize-sqlite3.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "1b97ce83bb12d6f435c0363e4f39888c87d0be53db6561168771add354fdd41f",
+ "chksum_sha256": "039ea53c97e8493e8911b8cbec378fb88c960be4eb0c116b30ad75a45e9bc2ee",
"format": 1
},
{
- "name": "roles/zabbix_proxy/tasks/selinux.yml",
+ "name": "roles/zabbix_proxy/tasks/main.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "5fcaf2583198e89e108cc2b2a7b777fa6e2dac1a2a1efd88a6c44308d79a6362",
+ "chksum_sha256": "4302458bdf7683522790560b0d9f74c6f7ad3874ec3941e13516f556f26a63d5",
"format": 1
},
{
- "name": "roles/zabbix_proxy/tasks/sqlite3.yml",
+ "name": "roles/zabbix_proxy/tasks/selinux.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "4c3b276cddc6afa88a48224fa274ca8ea7b7b59d74655197bddec0545a38309d",
+ "chksum_sha256": "5fcaf2583198e89e108cc2b2a7b777fa6e2dac1a2a1efd88a6c44308d79a6362",
"format": 1
},
{
@@ -1733,7 +1754,7 @@
"name": "roles/zabbix_proxy/templates/zabbix_proxy.conf.j2",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "8133d6ef95a09b0e435324b3005c524745eb0e194cfa591cb3d6f4c36a312590",
+ "chksum_sha256": "491e64286da2b61338dffd1e5967dbdca598acdd16fb190b45f7d35046255791",
"format": 1
},
{
@@ -1747,21 +1768,14 @@
"name": "roles/zabbix_proxy/vars/Debian.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "0c3453870dcd59ed9f69f3fdac8a1b46bf683a87ab86e87cc69b28d3951cce43",
+ "chksum_sha256": "e1893711fa151d4072c1195d178fcaad62099e4d972220bece3ef76efc69f1c1",
"format": 1
},
{
"name": "roles/zabbix_proxy/vars/RedHat.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "50f4bb5b1ab62a8f1128dde98e820349b164ef4c1583e6f78d61279d19e56c48",
- "format": 1
- },
- {
- "name": "roles/zabbix_proxy/vars/main.yml",
- "ftype": "file",
- "chksum_type": "sha256",
- "chksum_sha256": "599afb847ce1287ea279d2f5864a6fc6eb240323ef2b92a408e11c8472b08189",
+ "chksum_sha256": "9ba0777a21b8a56b138adba0270f51603d5f95c3c10e82d4b6351cc08bb9a8cd",
"format": 1
},
{
@@ -1782,7 +1796,7 @@
"name": "roles/zabbix_server/README.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "e7b83a2f01c4ef1388cba62476dbbe0596c483b345f4a79aabc2cd107cf16b61",
+ "chksum_sha256": "dd08d146c7fbbdef236be08abb9c035456e7d5f635a5748200fb7cbdb965f734",
"format": 1
},
{
@@ -1796,7 +1810,7 @@
"name": "roles/zabbix_server/defaults/main.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "e77fe177f086c46a5fbce843360203fcd6b0bd3cb70cbce6582b73e50fb4f1d8",
+ "chksum_sha256": "da72f5ec897d8b46a5a73686d679955d63f7e50ca8877b8905beb1bd915adfb1",
"format": 1
},
{
@@ -1859,21 +1873,21 @@
"name": "roles/zabbix_server/tasks/RedHat.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "c843b63e5dc9c44dfa748b6f6b5524f796d1b7a7bbf6151f89e7726770c399ce",
+ "chksum_sha256": "04cf0ce5034e975fcfe02cefd9ba91e58bd1b89c224a26c17da0a569f9c12f7e",
"format": 1
},
{
"name": "roles/zabbix_server/tasks/initialize-mysql.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "f391750aff2b4e7c74c292036829fe7a44bb3fbfaed9bdb12393542b59132502",
+ "chksum_sha256": "5be33df40ae618c8bc7654155c7b2c697569c7cc16e5edecfd7805d3943fad24",
"format": 1
},
{
"name": "roles/zabbix_server/tasks/initialize-pgsql.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "df0005a12cc1d89f1a361f1d5f2764600a24527a567cce4b38f69490651f5541",
+ "chksum_sha256": "dcfebdf9a3d57022bfc9287c44933fdb1675ebc6cd51c874941d6d1385da0a7f",
"format": 1
},
{
@@ -1894,7 +1908,7 @@
"name": "roles/zabbix_server/tasks/selinux.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "f82baa01937f5e3e29b02be6fefd51f7c6cafcefebd44e9a3cf2a8c22d9c5e8c",
+ "chksum_sha256": "927e5e8dbd9766b738e96aa48c8282283e34d0a6a8b3887e73d6128af5c6b184",
"format": 1
},
{
@@ -1922,7 +1936,7 @@
"name": "roles/zabbix_server/vars/Debian.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "428c1f85055c5afdccf997e4c6ab8fd4b9999760f93517dcbea2f41c88f82cb5",
+ "chksum_sha256": "568d7280dc9153f941220ba07fc94d66f92669a6b64ca1fffc38c847e2748c77",
"format": 1
},
{
@@ -1957,7 +1971,7 @@
"name": "roles/zabbix_web/README.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "c52def2249d4416ac228eb03d6b57322578e2fb5c118967fb1e11634ff66f64f",
+ "chksum_sha256": "836bbcc7e6ca298e93435670eefa94582bb44bfc7abf6a42e76ee814d41b88cb",
"format": 1
},
{
@@ -2076,7 +2090,7 @@
"name": "roles/zabbix_web/templates/php-fpm.conf.j2",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "d81d68fe5d62c8199e5d360be16bf1b1f27d72c4a3926d1e45abe720bb458cb8",
+ "chksum_sha256": "ac3253913106eb5e48e15335f95f3a7cbd8fe40eec84ca35fc023f296fd9341f",
"format": 1
},
{
@@ -2097,7 +2111,7 @@
"name": "roles/zabbix_web/vars/Debian.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "42d65bb39698381f067773966ab6605f96b6b7ced0e5d63e217ac0877d7dc7ad",
+ "chksum_sha256": "8754339ac10bbedd824445da405c7725251784224922cfede41aa132ea302314",
"format": 1
},
{
@@ -2409,6 +2423,62 @@
"format": 1
},
{
+ "name": "tests/integration/targets/test_zabbix_discoveryrule",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_discoveryrule/meta",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_discoveryrule/meta/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "63ae23343a8854777c0e014be5fdd33db6a6b78f96d22a889ad78556dc0ffa81",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_discoveryrule/tasks",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_discoveryrule/tasks/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "4eec6e2f6d02642f42b6f8b8f1e82d1928d24d796a598d739ba43d6b61778835",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_setup.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "b452b8a9c1c973f25dd408e2cc94966005496f9398ad3b4caf0daf63f603e034",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_teardown.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "c0784486108c91c1c600e6fe9274fe41c74cfac179cc85a682a6f96a860fb33f",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_tests.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "ddd02d4b606be9ca946c00f373c9db8c205847555e1d73fd2cb9f65cc220e90a",
+ "format": 1
+ },
+ {
"name": "tests/integration/targets/test_zabbix_globalmacro",
"ftype": "dir",
"chksum_type": null,
@@ -2626,6 +2696,62 @@
"format": 1
},
{
+ "name": "tests/integration/targets/test_zabbix_host_events_update",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_host_events_update/meta",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_host_events_update/meta/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "63ae23343a8854777c0e014be5fdd33db6a6b78f96d22a889ad78556dc0ffa81",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_host_events_update/tasks",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_host_events_update/tasks/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "4a202829b4dcf0556eda80dcfdf315aa40540997e4286cfd441eac6ef95fa131",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_setup.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "3b0a0d8ba4b38321e60d42f0d93331473371e2dbd1e0e53a3f7a1ddce6cfa317",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_teardown.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "f37b00a4d8ab112a8b6d43378eb9fc0c2a334ef12811ed4c69e20fe466339594",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_tests.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "34d77f1f1cbb6e639aca44c1f91b55106091f8e2ac0c22f6fbb90ecaeb1b28f5",
+ "format": 1
+ },
+ {
"name": "tests/integration/targets/test_zabbix_host_info",
"ftype": "dir",
"chksum_type": null,
@@ -2731,6 +2857,118 @@
"format": 1
},
{
+ "name": "tests/integration/targets/test_zabbix_item",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_item/meta",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_item/meta/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "63ae23343a8854777c0e014be5fdd33db6a6b78f96d22a889ad78556dc0ffa81",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_item/tasks",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_item/tasks/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "88728d40518ddfcaba88ae038b478cbb6758c601b93c7e384c4fc69ab3561915",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_item/tasks/zabbix_setup.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "b452b8a9c1c973f25dd408e2cc94966005496f9398ad3b4caf0daf63f603e034",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_item/tasks/zabbix_teardown.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "c0784486108c91c1c600e6fe9274fe41c74cfac179cc85a682a6f96a860fb33f",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_item/tasks/zabbix_tests.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "bf05aaec5b1e5775d76151e653629c2fac4e5f28b73fb68e6a77faa2e20892ae",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_itemprototype",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_itemprototype/meta",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_itemprototype/meta/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "63ae23343a8854777c0e014be5fdd33db6a6b78f96d22a889ad78556dc0ffa81",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_itemprototype/tasks",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_itemprototype/tasks/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "eb08b68052b69e34134588369ffe3aed732f71416d7782a2a1148ac95a83e94d",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_setup.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "82f652382e99595d8c98490c12357554a80fb3f44e0d9266bbd7048f81b6683e",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_teardown.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "c0784486108c91c1c600e6fe9274fe41c74cfac179cc85a682a6f96a860fb33f",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_tests.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "0b0361125b18999c1b70bc8794c06759651b7c84dd9dba77c9ce2e3b88d8c55b",
+ "format": 1
+ },
+ {
"name": "tests/integration/targets/test_zabbix_maintenance",
"ftype": "dir",
"chksum_type": null,
@@ -3333,6 +3571,118 @@
"format": 1
},
{
+ "name": "tests/integration/targets/test_zabbix_trigger",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_trigger/meta",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_trigger/meta/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "63ae23343a8854777c0e014be5fdd33db6a6b78f96d22a889ad78556dc0ffa81",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_trigger/tasks",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_trigger/tasks/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "51268021168f4a1d99aedf7f8721ad5181edc8307b770daf5781b13193ce0849",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_trigger/tasks/zabbix_setup.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "ad14bba00c032393d931c90dc09d984ddae41f37b444ce60a5a6262148f7f029",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_trigger/tasks/zabbix_teardown.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "a8d4e25b566a1d73a8a5d60d4402836c129001a84c3b91091b8fd7ac7ec3b5f3",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_trigger/tasks/zabbix_tests.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "970d7065d3f99a4611ea746417e9a09c921821ab538e5911c4834f142d170dea",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_triggerprototype",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_triggerprototype/meta",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_triggerprototype/meta/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "63ae23343a8854777c0e014be5fdd33db6a6b78f96d22a889ad78556dc0ffa81",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_triggerprototype/tasks",
+ "ftype": "dir",
+ "chksum_type": null,
+ "chksum_sha256": null,
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_triggerprototype/tasks/main.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "d039addf6c1a402806568d87a796cc7c5cd65c84fe688e5a68b1fbb55a69f582",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_setup.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "d85a1ca01851714d4c4c4f5149ee6c414b553f062cb00ae1071f108e0cba3533",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_teardown.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "e0a57d0d626d8a91bb298104a2dad6504054134224057ba4371cb3c362d524da",
+ "format": 1
+ },
+ {
+ "name": "tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_tests.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "539f9a3ddec14e95a711e2622142d000ffd677cc77bf8f237d8ac196262e6986",
+ "format": 1
+ },
+ {
"name": "tests/integration/targets/test_zabbix_user",
"ftype": "dir",
"chksum_type": null,
@@ -3539,7 +3889,7 @@
"name": "CHANGELOG.rst",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "841378afa489d7ab18a26f89a6c8a91949c1fb0c05c54b00ab5518157d83f3fa",
+ "chksum_sha256": "4cb82a3565187516b368d9f5dfceeb756f5d9aff8eb9cd867bfea2bf96595cf7",
"format": 1
},
{
@@ -3581,7 +3931,7 @@
"name": "README.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "e78a31db573596c05c1b54e4da2ab59b53b57c8e19b41694e16fc8a600d366e8",
+ "chksum_sha256": "21818a52c2f3c431ee8614f87a2be5dcec3e8350b613d20028f83a3fe3085d8d",
"format": 1
},
{
diff --git a/ansible_collections/community/zabbix/MANIFEST.json b/ansible_collections/community/zabbix/MANIFEST.json
index 803b2a538..e4395622f 100644
--- a/ansible_collections/community/zabbix/MANIFEST.json
+++ b/ansible_collections/community/zabbix/MANIFEST.json
@@ -2,7 +2,7 @@
"collection_info": {
"namespace": "community",
"name": "zabbix",
- "version": "2.4.0",
+ "version": "2.5.1",
"authors": [
"Dusan Matejka (@D3DeFi)",
"sky-joker (@sky-joker)",
@@ -35,7 +35,7 @@
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "48923f5d0d4edaa37a77a0dda92c0f41f762a24a9d7ab4bd04c816cf9f3bd73a",
+ "chksum_sha256": "2240b795e1121857fa2806c32e30cfc339d18ffad8914f097414ceaba4733eac",
"format": 1
},
"format": 1
diff --git a/ansible_collections/community/zabbix/README.md b/ansible_collections/community/zabbix/README.md
index 889645483..6663beb2d 100644
--- a/ansible_collections/community/zabbix/README.md
+++ b/ansible_collections/community/zabbix/README.md
@@ -104,7 +104,7 @@ You can also include it in a `requirements.yml` file along with other required c
---
collections:
- name: community.zabbix
- version: 2.4.0
+ version: 2.5.1
- name: ansible.posix
version: 1.3.0
- name: community.general
diff --git a/ansible_collections/community/zabbix/changelogs/.plugin-cache.yaml b/ansible_collections/community/zabbix/changelogs/.plugin-cache.yaml
index 78da79cd3..1fd62c57e 100644
--- a/ansible_collections/community/zabbix/changelogs/.plugin-cache.yaml
+++ b/ansible_collections/community/zabbix/changelogs/.plugin-cache.yaml
@@ -47,6 +47,11 @@ plugins:
name: zabbix_discovery_rule
namespace: ''
version_added: null
+ zabbix_discoveryrule:
+ description: Create/delete Zabbix discovery rules
+ name: zabbix_discoveryrule
+ namespace: ''
+ version_added: null
zabbix_globalmacro:
description: Create/update/delete Zabbix Global macros
name: zabbix_globalmacro
@@ -77,6 +82,11 @@ plugins:
name: zabbix_host_events_info
namespace: ''
version_added: null
+ zabbix_host_events_update:
+ description: update the status of event(s).
+ name: zabbix_host_events_update
+ namespace: ''
+ version_added: null
zabbix_host_info:
description: Gather information about Zabbix host
name: zabbix_host_info
@@ -92,6 +102,16 @@ plugins:
name: zabbix_housekeeping
namespace: ''
version_added: 1.6.0
+ zabbix_item:
+ description: Create/delete Zabbix items
+ name: zabbix_item
+ namespace: ''
+ version_added: null
+ zabbix_itemprototype:
+ description: Create/delete Zabbix item prototypes
+ name: zabbix_itemprototype
+ namespace: ''
+ version_added: null
zabbix_maintenance:
description: Create Zabbix maintenance windows
name: zabbix_maintenance
@@ -162,6 +182,16 @@ plugins:
name: zabbix_token
namespace: ''
version_added: 2.1.0
+ zabbix_trigger:
+ description: Create/delete Zabbix triggers
+ name: zabbix_trigger
+ namespace: ''
+ version_added: null
+ zabbix_triggerprototype:
+ description: Create/delete Zabbix triggerprototypes
+ name: zabbix_triggerprototype
+ namespace: ''
+ version_added: null
zabbix_user:
description: Create/update/delete Zabbix users
name: zabbix_user
@@ -196,4 +226,4 @@ plugins:
shell: {}
strategy: {}
vars: {}
-version: 2.4.0
+version: 2.5.1
diff --git a/ansible_collections/community/zabbix/changelogs/changelog.yaml b/ansible_collections/community/zabbix/changelogs/changelog.yaml
index 608160c0b..e83d608fc 100644
--- a/ansible_collections/community/zabbix/changelogs/changelog.yaml
+++ b/ansible_collections/community/zabbix/changelogs/changelog.yaml
@@ -3,1150 +3,1187 @@ releases:
0.1.0:
changes:
bugfixes:
- - zabbix_action - allow str values for ``esc_period`` options (see `#66841 <https://github.com/ansible/ansible/pull/66841>`_).
- - zabbix_action - no longer requires ``esc_period`` and ``event_source`` arguments
- when ``state=absent``.
- - zabbix_host - now supports configuring user macros and host tags on the managed
- host (see `#66777 <https://github.com/ansible/ansible/pull/66777>`_).
- - zabbix_host_info - ``host_name`` based search results now include host groups.
- - zabbix_hostmacro - ``macro_name`` now accepts macros in zabbix native format
- as well (e.g. ``{$MACRO}``).
- - zabbix_hostmacro - ``macro_value`` is no longer required when ``state=absent``.
- - zabbix_proxy (module) - ``interface`` sub-options ``type`` and ``main`` are
- now deprecated and will be removed in community.general 3.0.0. Also, the values
- passed to ``interface`` are now checked for correct types and unexpected keys.
- - zabbix_proxy (module) - added option proxy_address for comma-delimited list
- of IP/CIDR addresses or DNS names to accept active proxy requests from.
- - zabbix_template - add new option omit_date to remove date from exported/dumped
- template (see `#67302 <https://github.com/ansible/ansible/pull/67302>`_).
- - zabbix_template - adding new update rule templateLinkage.deleteMissing for
- newer zabbix versions (see `#66747 <https://github.com/ansible/ansible/pull/66747>`_).
- - zabbix_template_info - add new option omit_date to remove date from exported/dumped
- template (see `#67302 <https://github.com/ansible/ansible/pull/67302>`_).
+ - zabbix_action - allow str values for ``esc_period`` options (see `#66841 <https://github.com/ansible/ansible/pull/66841>`_).
+ - zabbix_action - no longer requires ``esc_period`` and ``event_source`` arguments
+ when ``state=absent``.
+ - zabbix_host - now supports configuring user macros and host tags on the managed
+ host (see `#66777 <https://github.com/ansible/ansible/pull/66777>`_).
+ - zabbix_host_info - ``host_name`` based search results now include host groups.
+ - zabbix_hostmacro - ``macro_name`` now accepts macros in zabbix native format
+ as well (e.g. ``{$MACRO}``).
+ - zabbix_hostmacro - ``macro_value`` is no longer required when ``state=absent``.
+ - zabbix_proxy (module) - ``interface`` sub-options ``type`` and ``main`` are
+ now deprecated and will be removed in community.general 3.0.0. Also, the values
+ passed to ``interface`` are now checked for correct types and unexpected keys.
+ - zabbix_proxy (module) - added option proxy_address for comma-delimited list
+ of IP/CIDR addresses or DNS names to accept active proxy requests from.
+ - zabbix_template - add new option omit_date to remove date from exported/dumped
+ template (see `#67302 <https://github.com/ansible/ansible/pull/67302>`_).
+ - zabbix_template - adding new update rule templateLinkage.deleteMissing for
+ newer zabbix versions (see `#66747 <https://github.com/ansible/ansible/pull/66747>`_).
+ - zabbix_template_info - add new option omit_date to remove date from exported/dumped
+ template (see `#67302 <https://github.com/ansible/ansible/pull/67302>`_).
deprecated_features:
- - zabbix_proxy (module) - deprecates ``interface`` sub-options ``type`` and
- ``main`` when proxy type is set to passive via ``status=passive``. Make sure
- these suboptions are removed from your playbook as they were never supported
- by Zabbix in the first place.
+ - zabbix_proxy (module) - deprecates ``interface`` sub-options ``type`` and
+ ``main`` when proxy type is set to passive via ``status=passive``. Make sure
+ these suboptions are removed from your playbook as they were never supported
+ by Zabbix in the first place.
minor_changes:
- - zabbix inventory plugin now no longer prints DeprecationWarning when used
- with Python3 due to SafeConfigParser.
- - zabbix_action - arguments ``event_source`` and ``esc_period`` no longer required
- when ``state=absent``.
- - zabbix_host - fixed inventory_mode key error, which occurs with Zabbix 4.4.1
- or more (see `#65304 <https://github.com/ansible/ansible/issues/65304>`_).
- - zabbix_host - was not possible to update a host where visible_name was not
- set in zabbix.
- - zabbix_mediatype - Fixed to support zabbix 4.4 or more and python3 (see `#67693
- <https://github.com/ansible/ansible/pull/67693>`_).
- - zabbix_template - fixed error when providing empty ``link_templates`` to the
- module (see `#66417 <https://github.com/ansible/ansible/issues/66417>`_).
- - zabbix_template - fixed invalid (non-importable) output provided by exporting
- XML (see `#66466 <https://github.com/ansible/ansible/issues/66466>`_).
- - zabbix_user - Fixed an issue where module failed with zabbix 4.4 or above
- (see `#67475 <https://github.com/ansible/ansible/pull/67475>`_).
- release_summary: '| Release date: 2020-06-15
+ - zabbix inventory plugin now no longer prints DeprecationWarning when used
+ with Python3 due to SafeConfigParser.
+ - zabbix_action - arguments ``event_source`` and ``esc_period`` no longer required
+ when ``state=absent``.
+ - zabbix_host - fixed inventory_mode key error, which occurs with Zabbix 4.4.1
+ or more (see `#65304 <https://github.com/ansible/ansible/issues/65304>`_).
+ - zabbix_host - was not possible to update a host where visible_name was not
+ set in zabbix.
+ - zabbix_mediatype - Fixed to support zabbix 4.4 or more and python3 (see `#67693
+ <https://github.com/ansible/ansible/pull/67693>`_).
+ - zabbix_template - fixed error when providing empty ``link_templates`` to the
+ module (see `#66417 <https://github.com/ansible/ansible/issues/66417>`_).
+ - zabbix_template - fixed invalid (non-importable) output provided by exporting
+ XML (see `#66466 <https://github.com/ansible/ansible/issues/66466>`_).
+ - zabbix_user - Fixed an issue where module failed with zabbix 4.4 or above
+ (see `#67475 <https://github.com/ansible/ansible/pull/67475>`_).
+ release_summary: "| Release date: 2020-06-15
- '
+ "
fragments:
- - 010release.yml
- release_date: '2020-06-15'
+ - 010release.yml
+ release_date: "2020-06-15"
0.2.0:
changes:
bugfixes:
- - zabbix_action - documented ``value2`` parameter and ``notify_all_involved``
- option.
- - zabbix_maintenance - changing value of ``description`` parameter now actually
- updates maintenance's description.
- - zabbix_template - is now able to perform ``state=dump`` when using ``ansible-playbook
- --check``.
- - zabbix_template - no longer imports template from ``template_json`` or ``template_xml``
- when using ``ansible-playbook --check``.
+ - zabbix_action - documented ``value2`` parameter and ``notify_all_involved``
+ option.
+ - zabbix_maintenance - changing value of ``description`` parameter now actually
+ updates maintenance's description.
+ - zabbix_template - is now able to perform ``state=dump`` when using ``ansible-playbook
+ --check``.
+ - zabbix_template - no longer imports template from ``template_json`` or ``template_xml``
+ when using ``ansible-playbook --check``.
minor_changes:
- - Documentation for roles moved to ``docs/`` sub-directory in the collection.
- - New **role zabbix_agent** - previously known as dj-wasabi/zabbix-agent (also
- see `UPGRADE.md <https://github.com/ansible-collections/community.zabbix/blob/main/docs/UPGRADE.md>`_
- for each role).
- - New **role zabbix_javagateway** - previously known as dj-wasabi/zabbix-javagateway.
- - New **role zabbix_proxy** - previously known as dj-wasabi/zabbix-proxy.
- - New **role zabbix_server** - previously known as dj-wasabi/zabbix-server.
- - New **role zabbix_web** - previously known as dj-wasabi/zabbix-web.
- - zabbix_action - new alias ``update_operations`` for ``acknowledge_operations``
- parameter.
- - zabbix_host - ``macros`` now support new macro types ``text`` and ``secret``.
- - zabbix_host - new option ``details`` (additional SNMP details) for ``interfaces``
- parameter.
- - zabbix_host - now supports Zabbix 5.0.
- - zabbix_proxy (module) - now supports Zabbix 5.0.
- - zabbix_screen - ``host_group`` parameter now accepts multiple groups.
- release_summary: '| Release date: 2020-06-15 '
+ - Documentation for roles moved to ``docs/`` sub-directory in the collection.
+ - New **role zabbix_agent** - previously known as dj-wasabi/zabbix-agent (also
+ see `UPGRADE.md <https://github.com/ansible-collections/community.zabbix/blob/main/docs/UPGRADE.md>`_
+ for each role).
+ - New **role zabbix_javagateway** - previously known as dj-wasabi/zabbix-javagateway.
+ - New **role zabbix_proxy** - previously known as dj-wasabi/zabbix-proxy.
+ - New **role zabbix_server** - previously known as dj-wasabi/zabbix-server.
+ - New **role zabbix_web** - previously known as dj-wasabi/zabbix-web.
+ - zabbix_action - new alias ``update_operations`` for ``acknowledge_operations``
+ parameter.
+ - zabbix_host - ``macros`` now support new macro types ``text`` and ``secret``.
+ - zabbix_host - new option ``details`` (additional SNMP details) for ``interfaces``
+ parameter.
+ - zabbix_host - now supports Zabbix 5.0.
+ - zabbix_proxy (module) - now supports Zabbix 5.0.
+ - zabbix_screen - ``host_group`` parameter now accepts multiple groups.
+ release_summary: "| Release date: 2020-06-15 "
fragments:
- - 020release.yml
- release_date: '2020-06-15'
+ - 020release.yml
+ release_date: "2020-06-15"
0.3.0:
changes:
bugfixes:
- - zabbix_action - choices for the ``inventory`` paramter sub option in ``*operations``
- arguments have been clarified to ``manual`` and ``automatic``.
- - zabbix_action - fixed error on changed API fields ``*default_message`` and
- ``*default_subject`` for Zabbix 5.0 (see `#92 <https://github.com/ansible-collections/community.zabbix/pull/92>`_).
- - zabbix_action - module will no longer fail when searching for global script
- provided to ``script_name`` parameter.
- - zabbix_action - now correctly selects mediatype for the (normal|recovery|update)
- operations with Zabbix 4.4 and newer.
- - zabbix_agent - fixed installation of agent on Windows to directories with
- spaces.
- - zabbix_agent - role should no longer fail when looking for ``getenforce``
- binary.
- - zabbix_host - module will no longer convert context part of user macro to
- upper case.
- - zabbix_proxy (role) - will now correctly install python3-libsemanage on RHEL
- OS family.
- - zabbix_service - fixed the zabbix_service has no idempotency with Zabbix 5.0.
- - zabbix_web - now no longer fails when rendering apache vhost template.
+ - zabbix_action - choices for the ``inventory`` paramter sub option in ``*operations``
+ arguments have been clarified to ``manual`` and ``automatic``.
+ - zabbix_action - fixed error on changed API fields ``*default_message`` and
+ ``*default_subject`` for Zabbix 5.0 (see `#92 <https://github.com/ansible-collections/community.zabbix/pull/92>`_).
+ - zabbix_action - module will no longer fail when searching for global script
+ provided to ``script_name`` parameter.
+ - zabbix_action - now correctly selects mediatype for the (normal|recovery|update)
+ operations with Zabbix 4.4 and newer.
+ - zabbix_agent - fixed installation of agent on Windows to directories with
+ spaces.
+ - zabbix_agent - role should no longer fail when looking for ``getenforce``
+ binary.
+ - zabbix_host - module will no longer convert context part of user macro to
+ upper case.
+ - zabbix_proxy (role) - will now correctly install python3-libsemanage on RHEL
+ OS family.
+ - zabbix_service - fixed the zabbix_service has no idempotency with Zabbix 5.0.
+ - zabbix_web - now no longer fails when rendering apache vhost template.
minor_changes:
- - All roles now **support Zabbix 5.0** and by default install this version (see
- `#131 <https://github.com/ansible-collections/community.zabbix/pull/131>`_
- and `#121 <https://github.com/ansible-collections/community.zabbix/pull/121>`_).
- - Roles will now install gnupg on Debian OS family if not present.
- - zabbix_action - no longer requires ``password`` and ``ssh_*key_file`` parameters
- at the same time for ``remote_command`` operations of type SSH.
- - zabbix_action - parameter ``ssh_auth_type`` for SSH ``remote_command`` operation
- now correctly identifies which other parameters are required.
- - zabbix_discovery_rule - refactoring module to use ``module_utils`` classes
- and functions, adjust return values on success, add documentation for return
- values.
- - zabbix_discovery_rule - refactoring the module to remove unnecessary variables
- and fix a variable typo.
- - zabbix_mediatype - new options ``message_templates``, ``description`` and
- many more related to ``type=webhook``.
- - zabbix_mediatype - now supports new ``webhook`` media type.
- release_summary: '| Release date: 2020-07-26
+ - All roles now **support Zabbix 5.0** and by default install this version (see
+ `#131 <https://github.com/ansible-collections/community.zabbix/pull/131>`_
+ and `#121 <https://github.com/ansible-collections/community.zabbix/pull/121>`_).
+ - Roles will now install gnupg on Debian OS family if not present.
+ - zabbix_action - no longer requires ``password`` and ``ssh_*key_file`` parameters
+ at the same time for ``remote_command`` operations of type SSH.
+ - zabbix_action - parameter ``ssh_auth_type`` for SSH ``remote_command`` operation
+ now correctly identifies which other parameters are required.
+ - zabbix_discovery_rule - refactoring module to use ``module_utils`` classes
+ and functions, adjust return values on success, add documentation for return
+ values.
+ - zabbix_discovery_rule - refactoring the module to remove unnecessary variables
+ and fix a variable typo.
+ - zabbix_mediatype - new options ``message_templates``, ``description`` and
+ many more related to ``type=webhook``.
+ - zabbix_mediatype - now supports new ``webhook`` media type.
+ release_summary: "| Release date: 2020-07-26
- '
+ "
fragments:
- - 030release.yml
+ - 030release.yml
modules:
- - description: Create/delete/update Zabbix discovery rules
- name: zabbix_discovery_rule
- namespace: ''
- - description: Create/delete/update Zabbix user groups
- name: zabbix_usergroup
- namespace: ''
- release_date: '2020-07-26'
+ - description: Create/delete/update Zabbix discovery rules
+ name: zabbix_discovery_rule
+ namespace: ""
+ - description: Create/delete/update Zabbix user groups
+ name: zabbix_usergroup
+ namespace: ""
+ release_date: "2020-07-26"
1.0.0:
changes:
breaking_changes:
- - zabbix_javagateway - options ``javagateway_pidfile``, ``javagateway_listenip``,
- ``javagateway_listenport`` and ``javagateway_startpollers`` renamed to ``zabbix_javagateway_xyz``
- (see `UPGRADE.md <https://github.com/ansible-collections/community.zabbix/blob/main/docs/UPGRADE.md>`_).
+ - zabbix_javagateway - options ``javagateway_pidfile``, ``javagateway_listenip``,
+ ``javagateway_listenport`` and ``javagateway_startpollers`` renamed to ``zabbix_javagateway_xyz``
+ (see `UPGRADE.md <https://github.com/ansible-collections/community.zabbix/blob/main/docs/UPGRADE.md>`_).
bugfixes:
- - all roles - a ``handler`` is configured when ``zabbix_http(s)_proxy`` is defined
- which will remove the proxy line from the repository files. This results that
- execution of the roles are not idempotent anymore.
- - zabbix_proxy (role) - ``StartPreprocessors`` only works with version 4.2 or
- higher. When a lower version is used, it will not be added to the configuration.
- - zabbix_proxy (role) - only install the sql files that needs to be executed
- for when ``zabbix_repo`` is set to ``epel``.
- - zabbix_server - ``StartPreprocessors`` only works with version 4.2 or higher.
- When a lower version is used, it will not be added to the configuration.
- - zabbix_server - only install the sql files that needs to be executed for when
- ``zabbix_repo`` is set to ``epel``.
+ - all roles - a ``handler`` is configured when ``zabbix_http(s)_proxy`` is defined
+ which will remove the proxy line from the repository files. This results that
+ execution of the roles are not idempotent anymore.
+ - zabbix_proxy (role) - ``StartPreprocessors`` only works with version 4.2 or
+ higher. When a lower version is used, it will not be added to the configuration.
+ - zabbix_proxy (role) - only install the sql files that needs to be executed
+ for when ``zabbix_repo`` is set to ``epel``.
+ - zabbix_server - ``StartPreprocessors`` only works with version 4.2 or higher.
+ When a lower version is used, it will not be added to the configuration.
+ - zabbix_server - only install the sql files that needs to be executed for when
+ ``zabbix_repo`` is set to ``epel``.
minor_changes:
- - Added the possibility to configure the ``mode`` for the ``zabbix_{agent,server,proxy}_include``
- directories.
- - all roles - added the possibility to configure the ``mode`` for the ``yum``
- repositories files in case it contains credentials.
- - zabbix_agent - ``zabbix-sender`` and ``zabbix-get`` will not be installed
- when ``zabbix_repo`` is set to ``epel``, as they are not part of the repository.
- - zabbix_agent - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
- - zabbix_agent - can also install the zabbix-agent2 application when ``zabbix_agent2``
- is set to ``true``.
- - zabbix_proxy (role) - a user and group are created on the host when ``zabbix_repo``
- is set to ``epel``.
- - zabbix_proxy (role) - now supports ``startpreprocessors`` setting and encryption
- when connecting to database (see `#164 <https://github.com/ansible-collections/community.zabbix/pull/164>`_).
- - zabbix_server - a user and group are created on the host when ``zabbix_repo``
- is set to ``epel``.
- - zabbix_server - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
- - zabbix_server - now supports ``startpreprocessors`` setting and encryption
- when connecting to database (see `#164 <https://github.com/ansible-collections/community.zabbix/pull/164>`_).
- - zabbix_web - a property is added ``zabbix_web_doubleprecision`` which currently
- is set to ``false`` for default installations. For new installations this
- should be set to ``True``. For upgraded installations, please read database
- `upgrade notes <https://www.zabbix.com/documentation/current/manual/installation/upgrade_notes_500>`_
- (Paragraph "Enabling extended range of numeric (float) values") before enabling
- this option.
- - zabbix_web - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
- - zabbix_web - don't remove the files that Zabbix will install during installation
- when you don't want to configure a virtual host configuration.
- release_summary: '| Release date: 2020-08-16
+ - Added the possibility to configure the ``mode`` for the ``zabbix_{agent,server,proxy}_include``
+ directories.
+ - all roles - added the possibility to configure the ``mode`` for the ``yum``
+ repositories files in case it contains credentials.
+ - zabbix_agent - ``zabbix-sender`` and ``zabbix-get`` will not be installed
+ when ``zabbix_repo`` is set to ``epel``, as they are not part of the repository.
+ - zabbix_agent - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
+ - zabbix_agent - can also install the zabbix-agent2 application when ``zabbix_agent2``
+ is set to ``true``.
+ - zabbix_proxy (role) - a user and group are created on the host when ``zabbix_repo``
+ is set to ``epel``.
+ - zabbix_proxy (role) - now supports ``startpreprocessors`` setting and encryption
+ when connecting to database (see `#164 <https://github.com/ansible-collections/community.zabbix/pull/164>`_).
+ - zabbix_server - a user and group are created on the host when ``zabbix_repo``
+ is set to ``epel``.
+ - zabbix_server - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
+ - zabbix_server - now supports ``startpreprocessors`` setting and encryption
+ when connecting to database (see `#164 <https://github.com/ansible-collections/community.zabbix/pull/164>`_).
+ - zabbix_web - a property is added ``zabbix_web_doubleprecision`` which currently
+ is set to ``false`` for default installations. For new installations this
+ should be set to ``True``. For upgraded installations, please read database
+ `upgrade notes <https://www.zabbix.com/documentation/current/manual/installation/upgrade_notes_500>`_
+ (Paragraph "Enabling extended range of numeric (float) values") before enabling
+ this option.
+ - zabbix_web - added option to change between HTTP/HTTPS with ``zabbix_repo_yum_schema``.
+ - zabbix_web - don't remove the files that Zabbix will install during installation
+ when you don't want to configure a virtual host configuration.
+ release_summary: "| Release date: 2020-08-16
- '
+ "
fragments:
- - 100-release-prep.yaml
- - role-agent-supports-zabbix-agent2.yaml
- - role-all-configure-mode-include.yaml
- - role-all-configure-mode-with-handlers.yaml
- - role-all-fix-epel-installations.yaml
- - role-web-add-doubleprecision.yaml
- - role-web-zabbix_vhost-dont-remove-files.yaml
- release_date: '2020-08-16'
+ - 100-release-prep.yaml
+ - role-agent-supports-zabbix-agent2.yaml
+ - role-all-configure-mode-include.yaml
+ - role-all-configure-mode-with-handlers.yaml
+ - role-all-fix-epel-installations.yaml
+ - role-web-add-doubleprecision.yaml
+ - role-web-zabbix_vhost-dont-remove-files.yaml
+ release_date: "2020-08-16"
1.1.0:
changes:
bugfixes:
- - all roles - missing ``become`` set to ``true`` was added to each task that
- requires admin privleges.
- - zabbix_agent - added new properties and updated documentation to allow for
- correct Zabbix Agent2 configuration.
- - zabbix_agent - fixed bug where Nginx prevented Apache from working as it was
- part of the FPM configuration.
+ - all roles - missing ``become`` set to ``true`` was added to each task that
+ requires admin privleges.
+ - zabbix_agent - added new properties and updated documentation to allow for
+ correct Zabbix Agent2 configuration.
+ - zabbix_agent - fixed bug where Nginx prevented Apache from working as it was
+ part of the FPM configuration.
minor_changes:
- - all roles - added ``zabbix_{agent,web,server,proxy,javagateway}_conf_mode``
- option for configuring a mode of the configuration file for each Zabbix service.
- - zabbix_proxy (role) - added an option ``innodb_default_row_format`` for MariaDB/MySQL
- if it isn't set to ``dynamic``.
- - zabbix_server - fixed installation output when using MySQL database to not
- print PostgreSQL.
- - zabbix_user - ``passwd`` no longer required when ALL groups in ``usrgrps``
- use LDAP as ``gui_access`` (see `#240 <https://github.com/ansible-collections/community.zabbix/issues/232>`_).
- - zabbix_user - no longer requires ``usrgrps`` when ``state=absent`` (see `#240
- <https://github.com/ansible-collections/community.zabbix/issues/232>`_).
- - zabbix_web - added several configuration options for the PHP-FPM setup to
- configure the listen (socket) file.
- - zabbix_web - added support for configuring Zabbix Web with Nginx, same way
- as with Apache.
- release_summary: '| Release date: 2020-10-22
+ - all roles - added ``zabbix_{agent,web,server,proxy,javagateway}_conf_mode``
+ option for configuring a mode of the configuration file for each Zabbix service.
+ - zabbix_proxy (role) - added an option ``innodb_default_row_format`` for MariaDB/MySQL
+ if it isn't set to ``dynamic``.
+ - zabbix_server - fixed installation output when using MySQL database to not
+ print PostgreSQL.
+ - zabbix_user - ``passwd`` no longer required when ALL groups in ``usrgrps``
+ use LDAP as ``gui_access`` (see `#240 <https://github.com/ansible-collections/community.zabbix/issues/232>`_).
+ - zabbix_user - no longer requires ``usrgrps`` when ``state=absent`` (see `#240
+ <https://github.com/ansible-collections/community.zabbix/issues/232>`_).
+ - zabbix_web - added several configuration options for the PHP-FPM setup to
+ configure the listen (socket) file.
+ - zabbix_web - added support for configuring Zabbix Web with Nginx, same way
+ as with Apache.
+ release_summary: "| Release date: 2020-10-22
- '
+ "
fragments:
- - 240-zabbix-user-nopass-ldap.yaml
- - role-agent-correct-usage-acl.yaml
- - role-agent-zabbix-agent2-props.yaml
- - role-server-screen-output.yaml
- - role-web-add-support-for-nginx.yaml
- - role-web-added-some-properties.yaml
- - roles-all-add-become.yaml
- - roles-all-configure-conf-mode.yaml
- - roles-server-proxy-add-innodb-check.yaml
- release_date: '2020-10-22'
+ - 240-zabbix-user-nopass-ldap.yaml
+ - role-agent-correct-usage-acl.yaml
+ - role-agent-zabbix-agent2-props.yaml
+ - role-server-screen-output.yaml
+ - role-web-add-support-for-nginx.yaml
+ - role-web-added-some-properties.yaml
+ - roles-all-add-become.yaml
+ - roles-all-configure-conf-mode.yaml
+ - roles-server-proxy-add-innodb-check.yaml
+ release_date: "2020-10-22"
1.2.0:
changes:
bugfixes:
- - When installing the Zabbix packages, we disable all other yum repositories
- except the one for the Zabbix.
- - zabbix_agent - Agent 2 also be able to use userparameters file.
- - zabbix_agent - Also work on SLES 12 sp5
- - zabbix_agent - Documented the property 'zabbix_proxy_ip' in the documentation.
- - zabbix_agent - There was an task that wasn't able to use an http(s)_proxy
- environment while installing an package.
- - zabbix_agent - Windows - Able to create PSK file
- - zabbix_agent - Windows - Fixing download links to proper version/url
- - zabbix_agent - Windows - Removal of not working property
- - zabbix_agent - Zabbix packages were not able to install properly on Fedora.
- When the packages are installed, the version will be appended to the package
- name. This is eofr all RedHat related OS'es.
- - zabbix_agent - fixed issue with zabbix_agent2_tlspsk_auto having no effect
- when using zabbix_agent2
- - zabbix_agent - fixed issue with zabbix_api_create_hosts and TLS configuration
- when using zabbix_agent2, where zabbix_agent_tls* settings were used instead
- of zabbix_agent2_tls*
- - zabbix_host - module will no longer require ``interfaces`` to be present when
- creating host with Zabbix 5.2 (https://github.com/ansible-collections/community.zabbix/pull/291).
- - zabbix_host - should no longer fail with 'host cannot have more than one default
- interface' error (https://github.com/ansible-collections/community.zabbix/pull/309).
- - zabbix_proxy (role) - Added missing paragraph for the SQLite3 as database.
- - zabbix_proxy (role) - The become option was missing in some essential tasks
- when installing the Zabbix Proxy with SQLite3 as database.
- - zabbix_proxy (role) - Various documentation fixes removing the Zabbix Server
- and replaced it with actual Zabbix Proxy information.
- - zabbix_proxy - Added new property 'zabbix_proxy_ip' to determine ip for host
- running the Zabbix Proxy.
- - zabbix_proxy - The 'interface' option was missing when creating an Proxy via
- the API.
- - zabbix_template - fixed documentation for ``macros`` argument (https://github.com/ansible-collections/community.zabbix/pull/296).
- - zabbix_template - fixed encode error when using Python2 (https://github.com/ansible-collections/community.zabbix/pull/297).
- - zabbix_template - fixed issue when importing templates to zabbix version.
- >= 5.2
- - zabbix_template_info - fixed encode error when using Python2 (https://github.com/ansible-collections/community.zabbix/pull/297).
- - zabbix_user - disable no_log warning for option override_password.
- - zabbix_user - fixed issue where module couldn't create a user since Zabbix
- 5.2 (https://github.com/ansible-collections/community.zabbix/pull/260).
- - zabbix_web - fixed issue Role cannot install Zabbix web 5.0 on RHEL 7 (https://github.com/ansible-collections/community.zabbix/issues/202).
+ - When installing the Zabbix packages, we disable all other yum repositories
+ except the one for the Zabbix.
+ - zabbix_agent - Agent 2 also be able to use userparameters file.
+ - zabbix_agent - Also work on SLES 12 sp5
+ - zabbix_agent - Documented the property 'zabbix_proxy_ip' in the documentation.
+ - zabbix_agent - There was an task that wasn't able to use an http(s)_proxy
+ environment while installing an package.
+ - zabbix_agent - Windows - Able to create PSK file
+ - zabbix_agent - Windows - Fixing download links to proper version/url
+ - zabbix_agent - Windows - Removal of not working property
+ - zabbix_agent - Zabbix packages were not able to install properly on Fedora.
+ When the packages are installed, the version will be appended to the package
+ name. This is eofr all RedHat related OS'es.
+ - zabbix_agent - fixed issue with zabbix_agent2_tlspsk_auto having no effect
+ when using zabbix_agent2
+ - zabbix_agent - fixed issue with zabbix_api_create_hosts and TLS configuration
+ when using zabbix_agent2, where zabbix_agent_tls* settings were used instead
+ of zabbix_agent2_tls*
+ - zabbix_host - module will no longer require ``interfaces`` to be present when
+ creating host with Zabbix 5.2 (https://github.com/ansible-collections/community.zabbix/pull/291).
+ - zabbix_host - should no longer fail with 'host cannot have more than one default
+ interface' error (https://github.com/ansible-collections/community.zabbix/pull/309).
+ - zabbix_proxy (role) - Added missing paragraph for the SQLite3 as database.
+ - zabbix_proxy (role) - The become option was missing in some essential tasks
+ when installing the Zabbix Proxy with SQLite3 as database.
+ - zabbix_proxy (role) - Various documentation fixes removing the Zabbix Server
+ and replaced it with actual Zabbix Proxy information.
+ - zabbix_proxy - Added new property 'zabbix_proxy_ip' to determine ip for host
+ running the Zabbix Proxy.
+ - zabbix_proxy - The 'interface' option was missing when creating an Proxy via
+ the API.
+ - zabbix_template - fixed documentation for ``macros`` argument (https://github.com/ansible-collections/community.zabbix/pull/296).
+ - zabbix_template - fixed encode error when using Python2 (https://github.com/ansible-collections/community.zabbix/pull/297).
+ - zabbix_template - fixed issue when importing templates to zabbix version.
+ >= 5.2
+ - zabbix_template_info - fixed encode error when using Python2 (https://github.com/ansible-collections/community.zabbix/pull/297).
+ - zabbix_user - disable no_log warning for option override_password.
+ - zabbix_user - fixed issue where module couldn't create a user since Zabbix
+ 5.2 (https://github.com/ansible-collections/community.zabbix/pull/260).
+ - zabbix_web - fixed issue Role cannot install Zabbix web 5.0 on RHEL 7 (https://github.com/ansible-collections/community.zabbix/issues/202).
minor_changes:
- - Updated the roles to support Zabbix 5.2.
- - zabbix_agent - Added a new property `zabbix_agent_dont_detect_ip` when set
- to true, it won't detect the ips and no need to install the python module
- `netaddr`.
- - zabbix_agent - Added parameter `zabbix_agent_package_remove` when set to `true`
- and `zabbix_agent2` is set to `true` it will uninstall the `zabbix-agent`
- service and package.
- - zabbix_agent - added `zabbix_agent_install_agent_only` Will only install the
- Zabbix Agent package and not the `zabbix-sender` or `zabbix-get` packages.
- - zabbix_template - Fixed to decode Unicode Escape of multibyte strings in an
- importing template data(https://github.com/ansible-collections/community.zabbix/pull/226).
- - zabbix_user - added new parameters to set timezone and role_name for users
- (https://github.com/ansible-collections/community.zabbix/pull/260).
- - zabbix_user - user_medias now defaults to None and is optional (https://github.com/ansible-collections/community.zabbix/pull/264).
- - zabbix_web - added `zabbix_web_rhel_release` which enable scl on RHEL (https://github.com/ansible-collections/community.zabbix/pull/266).
- - zabbix_web - quality of life improvements when using Nginx (https://github.com/ansible-collections/community.zabbix/pull/304).
- release_summary: '| Release date: 2021-01-11 | Last major release to support
- Zabbix server 3.X versions in plugins.'
+ - Updated the roles to support Zabbix 5.2.
+ - zabbix_agent - Added a new property `zabbix_agent_dont_detect_ip` when set
+ to true, it won't detect the ips and no need to install the python module
+ `netaddr`.
+ - zabbix_agent - Added parameter `zabbix_agent_package_remove` when set to `true`
+ and `zabbix_agent2` is set to `true` it will uninstall the `zabbix-agent`
+ service and package.
+ - zabbix_agent - added `zabbix_agent_install_agent_only` Will only install the
+ Zabbix Agent package and not the `zabbix-sender` or `zabbix-get` packages.
+ - zabbix_template - Fixed to decode Unicode Escape of multibyte strings in an
+ importing template data(https://github.com/ansible-collections/community.zabbix/pull/226).
+ - zabbix_user - added new parameters to set timezone and role_name for users
+ (https://github.com/ansible-collections/community.zabbix/pull/260).
+ - zabbix_user - user_medias now defaults to None and is optional (https://github.com/ansible-collections/community.zabbix/pull/264).
+ - zabbix_web - added `zabbix_web_rhel_release` which enable scl on RHEL (https://github.com/ansible-collections/community.zabbix/pull/266).
+ - zabbix_web - quality of life improvements when using Nginx (https://github.com/ansible-collections/community.zabbix/pull/304).
+ release_summary:
+ "| Release date: 2021-01-11 | Last major release to support
+ Zabbix server 3.X versions in plugins."
fragments:
- - 226-zabbix_template.yaml
- - 254-disable-no-log-warning.yml
- - 260-zabbix_user.yml
- - 264-allow-user_medias-to-be-optional.yaml
- - 266-zabbix_web.yml
- - 297-zabbix_template_modules.yml
- - 309-host-interfaces.yaml
- - agent-missing-proxy-task.yaml
- - agent-not-detect-ips.yml
- - agent-use-version-for-rh.yml
- - agent2-psk-fixes.yml
- - module-zabbix_host-interfaces-not-required.yaml
- - module-zabbix_template-argspec-doc.yaml
- - proxy-able-to-use-interface.yaml
- - role-agent-allow-uninstall-agent.yaml
- - role-agent-userparameter.yaml
- - role-agent-windows-service-handling.yaml
- - role-agent-work-with-sles.yaml
- - role-proxy-sqlite3-zabbix-proxy.yaml
- - roles-all-enable-zabbix-disable-rest.yaml
- - roles-all-update-to-zabbix-52.yml
- - templatescreens-fix.yml
- release_date: '2021-01-11'
+ - 226-zabbix_template.yaml
+ - 254-disable-no-log-warning.yml
+ - 260-zabbix_user.yml
+ - 264-allow-user_medias-to-be-optional.yaml
+ - 266-zabbix_web.yml
+ - 297-zabbix_template_modules.yml
+ - 309-host-interfaces.yaml
+ - agent-missing-proxy-task.yaml
+ - agent-not-detect-ips.yml
+ - agent-use-version-for-rh.yml
+ - agent2-psk-fixes.yml
+ - module-zabbix_host-interfaces-not-required.yaml
+ - module-zabbix_template-argspec-doc.yaml
+ - proxy-able-to-use-interface.yaml
+ - role-agent-allow-uninstall-agent.yaml
+ - role-agent-userparameter.yaml
+ - role-agent-windows-service-handling.yaml
+ - role-agent-work-with-sles.yaml
+ - role-proxy-sqlite3-zabbix-proxy.yaml
+ - roles-all-enable-zabbix-disable-rest.yaml
+ - roles-all-update-to-zabbix-52.yml
+ - templatescreens-fix.yml
+ release_date: "2021-01-11"
1.3.0:
changes:
bugfixes:
- - zabbix_action - now properly filters discovery rule checks by name (https://github.com/ansible-collections/community.zabbix/pull/349).
- - zabbix_agent - corrected version for Windows agents (https://github.com/ansible-collections/community.zabbix/pull/316).
- - zabbix_agent - fixed download URL for MacOS (https://github.com/ansible-collections/community.zabbix/pull/325).
- - zabbix_server - now installs correct MySQL client packages on RHEL8 systems
- (https://github.com/ansible-collections/community.zabbix/pull/343).
- - zabbix_template - fixed an issue with Python2 where module wouldn't decode
- Unicode characters (https://github.com/ansible-collections/community.zabbix/pull/322).
- - zabbix_web - fixed installation of python3-libsemanage package RHEL7 and older
- systems (https://github.com/ansible-collections/community.zabbix/pull/330).
- - zabbix_web - role should now correctly determine naming of PHP packages on
- older systems (https://github.com/ansible-collections/community.zabbix/pull/344).
- - zabbix_web - updated default PHP version for Debian10 (https://github.com/ansible-collections/community.zabbix/pull/323).
+ - zabbix_action - now properly filters discovery rule checks by name (https://github.com/ansible-collections/community.zabbix/pull/349).
+ - zabbix_agent - corrected version for Windows agents (https://github.com/ansible-collections/community.zabbix/pull/316).
+ - zabbix_agent - fixed download URL for MacOS (https://github.com/ansible-collections/community.zabbix/pull/325).
+ - zabbix_server - now installs correct MySQL client packages on RHEL8 systems
+ (https://github.com/ansible-collections/community.zabbix/pull/343).
+ - zabbix_template - fixed an issue with Python2 where module wouldn't decode
+ Unicode characters (https://github.com/ansible-collections/community.zabbix/pull/322).
+ - zabbix_web - fixed installation of python3-libsemanage package RHEL7 and older
+ systems (https://github.com/ansible-collections/community.zabbix/pull/330).
+ - zabbix_web - role should now correctly determine naming of PHP packages on
+ older systems (https://github.com/ansible-collections/community.zabbix/pull/344).
+ - zabbix_web - updated default PHP version for Debian10 (https://github.com/ansible-collections/community.zabbix/pull/323).
minor_changes:
- - zabbix_agent - added support for installations on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
- - zabbix_proxy - now supports configuring StatsAllowedIP (https://github.com/ansible-collections/community.zabbix/pull/337).
- - zabbix_server - added support for installtions on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
- - zabbix_web - added support for installtions on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
- release_summary: '| Release date: 2021-03-20 | Last major release to support
- Zabbix server 3.X versions in plugins.'
+ - zabbix_agent - added support for installations on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
+ - zabbix_proxy - now supports configuring StatsAllowedIP (https://github.com/ansible-collections/community.zabbix/pull/337).
+ - zabbix_server - added support for installtions on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
+ - zabbix_web - added support for installtions on arm64 systems (https://github.com/ansible-collections/community.zabbix/pull/320).
+ release_summary:
+ "| Release date: 2021-03-20 | Last major release to support
+ Zabbix server 3.X versions in plugins."
security_fixes:
- - zabbix_action - no longer exposes remote SSH command password used in operations,
- recovery & acknowledge operations to system logs (https://github.com/ansible-collections/community.zabbix/pull/345).
- - zabbix_discovery_rule - no longer exposes SNMPv3 auth and priv passphrases
- to system logs (https://github.com/ansible-collections/community.zabbix/pull/345).
- - zabbix_host - no longer exposes SNMPv3 auth and priv passphrases to system
- logs (https://github.com/ansible-collections/community.zabbix/pull/345).
+ - zabbix_action - no longer exposes remote SSH command password used in operations,
+ recovery & acknowledge operations to system logs (https://github.com/ansible-collections/community.zabbix/pull/345).
+ - zabbix_discovery_rule - no longer exposes SNMPv3 auth and priv passphrases
+ to system logs (https://github.com/ansible-collections/community.zabbix/pull/345).
+ - zabbix_host - no longer exposes SNMPv3 auth and priv passphrases to system
+ logs (https://github.com/ansible-collections/community.zabbix/pull/345).
fragments:
- - 316-zbx-agent-windows-long-version.yaml
- - 322-zabbix_template.yml
- - 323-zabbix_web.yml
- - 325-zbx-agent-macos.yaml
- - 330-zabbix_web-selinux.yaml
- - 337-zabbix_proxy-statsAllowedIP.yaml
- - 343-zabbix_server-rhel8-mysql.yaml
- - 344-zabbix_web-legacyphp.yaml
- - 345-security-fixes-no_log.yaml
- - 349-zabbix_action-dcheck-filter.yaml
- - raspberry-server.yaml
- - raspberry.yaml
- release_date: '2021-03-20'
+ - 316-zbx-agent-windows-long-version.yaml
+ - 322-zabbix_template.yml
+ - 323-zabbix_web.yml
+ - 325-zbx-agent-macos.yaml
+ - 330-zabbix_web-selinux.yaml
+ - 337-zabbix_proxy-statsAllowedIP.yaml
+ - 343-zabbix_server-rhel8-mysql.yaml
+ - 344-zabbix_web-legacyphp.yaml
+ - 345-security-fixes-no_log.yaml
+ - 349-zabbix_action-dcheck-filter.yaml
+ - raspberry-server.yaml
+ - raspberry.yaml
+ release_date: "2021-03-20"
1.4.0:
changes:
bugfixes:
- - zabbix_agent - StatusPort will be configured only when `zabbix_agent2_statusport`
- is defined (https://github.com/ansible-collections/community.zabbix/pull/378)
- - zabbix_agent - fixed issue preventing installation of zabbix-agent 4.2 on
- Ubuntu Focal 20.04 (https://github.com/ansible-collections/community.zabbix/pull/390)
- - zabbix_agent - role will now configure correct port for hostinterface in Zabbix
- Server if `zabbix_agent2_listenport` is defined (https://github.com/ansible-collections/community.zabbix/pull/400)
- - zabbix_agent - should no longer be failing on Windows platform due to re-running
- all of the tasks for the 2nd time (https://github.com/ansible-collections/community.zabbix/pull/376)
- - zabbix_agent - should no longer fail while cleaning up zabbix_agent installation
- if Zabbix Agent2 is being used (https://github.com/ansible-collections/community.zabbix/pull/409)
- - zabbix_agent - will no longer install zabbix_get package on Debian systems
- when `zabbix_agent_install_agent_only` is defined (https://github.com/ansible-collections/community.zabbix/pull/363)
- - zabbix_host - fixed issue where module was idempotent when multiple host interfaces
- of the same type were present (https://github.com/ansible-collections/community.zabbix/pull/391)
- - zabbix_proxy (role) - will no longer fail on proxy creation in Zabbix Server
- when TLS parameters are used (https://github.com/ansible-collections/community.zabbix/pull/388)
- - zabbix_server - Removed the removal everything from /tmp directory command
- as it removes things that it shouldnt do.
- - zabbix_template - first time import of template now works with Zabbix 5.4
- (https://github.com/ansible-collections/community.zabbix/pull/407), please
- note that rerunning the task will fail as there are breaking changes in Zabbix
- 5.4 API that module not yet covers.
- - zabbix_user - now works with Zabbix 5.4 (https://github.com/ansible-collections/community.zabbix/pull/406)
+ - zabbix_agent - StatusPort will be configured only when `zabbix_agent2_statusport`
+ is defined (https://github.com/ansible-collections/community.zabbix/pull/378)
+ - zabbix_agent - fixed issue preventing installation of zabbix-agent 4.2 on
+ Ubuntu Focal 20.04 (https://github.com/ansible-collections/community.zabbix/pull/390)
+ - zabbix_agent - role will now configure correct port for hostinterface in Zabbix
+ Server if `zabbix_agent2_listenport` is defined (https://github.com/ansible-collections/community.zabbix/pull/400)
+ - zabbix_agent - should no longer be failing on Windows platform due to re-running
+ all of the tasks for the 2nd time (https://github.com/ansible-collections/community.zabbix/pull/376)
+ - zabbix_agent - should no longer fail while cleaning up zabbix_agent installation
+ if Zabbix Agent2 is being used (https://github.com/ansible-collections/community.zabbix/pull/409)
+ - zabbix_agent - will no longer install zabbix_get package on Debian systems
+ when `zabbix_agent_install_agent_only` is defined (https://github.com/ansible-collections/community.zabbix/pull/363)
+ - zabbix_host - fixed issue where module was idempotent when multiple host interfaces
+ of the same type were present (https://github.com/ansible-collections/community.zabbix/pull/391)
+ - zabbix_proxy (role) - will no longer fail on proxy creation in Zabbix Server
+ when TLS parameters are used (https://github.com/ansible-collections/community.zabbix/pull/388)
+ - zabbix_server - Removed the removal everything from /tmp directory command
+ as it removes things that it shouldnt do.
+ - zabbix_template - first time import of template now works with Zabbix 5.4
+ (https://github.com/ansible-collections/community.zabbix/pull/407), please
+ note that rerunning the task will fail as there are breaking changes in Zabbix
+ 5.4 API that module not yet covers.
+ - zabbix_user - now works with Zabbix 5.4 (https://github.com/ansible-collections/community.zabbix/pull/406)
minor_changes:
- - all roles were updated to support Zabbix 5.4 release (https://github.com/ansible-collections/community.zabbix/pull/405)
- - new inventory plugin zabbix_inventory (https://github.com/ansible-collections/community.zabbix/pull/373)
- - new module plugin zabbix_globalmacro (https://github.com/ansible-collections/community.zabbix/pull/377)
- - zabbix_agent - `zabbix_agent_src_reinstall` now defaults to `False` (https://github.com/ansible-collections/community.zabbix/pull/403)
- - zabbix_agent - now supports setting AllowKey (https://github.com/ansible-collections/community.zabbix/pull/358)
- - zabbix_globalmacros - it is now possible to create global macros using this
- module (https://github.com/ansible-collections/community.zabbix/pull/377).
- - zabbix_inventory - Created Ansible - Zabbix inventory plugin to create dynamic
- inventory from Zabbix.
- - zabbix_maintenance - it is now possible to target hosts by their technical
- name if it differs from the visible name
- - zabbix_proxy - Add MySQL Python 3 package installation.
- - zabbix_server - Add MySQL Python 3 package installation.
- - zabbix_server - now supports setting StartLLDProcessors (https://github.com/ansible-collections/community.zabbix/pull/361)
- - zabbix_user - now supports parameter `username` as an alternative to `alias`
- (https://github.com/ansible-collections/community.zabbix/pull/406)
- - zabbix_user - removed some of the default values because a configuration should
- be changed only if specified as a parameter (https://github.com/ansible-collections/community.zabbix/pull/382).
- - zabbix_web - now supports setting SAML certificates (https://github.com/ansible-collections/community.zabbix/pull/408)
+ - all roles were updated to support Zabbix 5.4 release (https://github.com/ansible-collections/community.zabbix/pull/405)
+ - new inventory plugin zabbix_inventory (https://github.com/ansible-collections/community.zabbix/pull/373)
+ - new module plugin zabbix_globalmacro (https://github.com/ansible-collections/community.zabbix/pull/377)
+ - zabbix_agent - `zabbix_agent_src_reinstall` now defaults to `False` (https://github.com/ansible-collections/community.zabbix/pull/403)
+ - zabbix_agent - now supports setting AllowKey (https://github.com/ansible-collections/community.zabbix/pull/358)
+ - zabbix_globalmacros - it is now possible to create global macros using this
+ module (https://github.com/ansible-collections/community.zabbix/pull/377).
+ - zabbix_inventory - Created Ansible - Zabbix inventory plugin to create dynamic
+ inventory from Zabbix.
+ - zabbix_maintenance - it is now possible to target hosts by their technical
+ name if it differs from the visible name
+ - zabbix_proxy - Add MySQL Python 3 package installation.
+ - zabbix_server - Add MySQL Python 3 package installation.
+ - zabbix_server - now supports setting StartLLDProcessors (https://github.com/ansible-collections/community.zabbix/pull/361)
+ - zabbix_user - now supports parameter `username` as an alternative to `alias`
+ (https://github.com/ansible-collections/community.zabbix/pull/406)
+ - zabbix_user - removed some of the default values because a configuration should
+ be changed only if specified as a parameter (https://github.com/ansible-collections/community.zabbix/pull/382).
+ - zabbix_web - now supports setting SAML certificates (https://github.com/ansible-collections/community.zabbix/pull/408)
fragments:
- - 350-zabbix_maintenance-visible_name.yaml
- - 373-create_zabbix_inventory.yaml
- - 377-create_globalmacros_module.yaml
- - 382-zabbix_user.yml
- - 391-zabbix_host-intf_idempotency_fix.yml
- - zabbix-proxy-package-installation.yaml
- - zabbix-server-tmp-dir.yml
- - zbx-catch-all.yml
+ - 350-zabbix_maintenance-visible_name.yaml
+ - 373-create_zabbix_inventory.yaml
+ - 377-create_globalmacros_module.yaml
+ - 382-zabbix_user.yml
+ - 391-zabbix_host-intf_idempotency_fix.yml
+ - zabbix-proxy-package-installation.yaml
+ - zabbix-server-tmp-dir.yml
+ - zbx-catch-all.yml
modules:
- - description: Create/update/delete Zabbix Global macros
- name: zabbix_globalmacro
- namespace: ''
+ - description: Create/update/delete Zabbix Global macros
+ name: zabbix_globalmacro
+ namespace: ""
plugins:
inventory:
- - description: Zabbix Inventory Plugin
- name: zabbix_inventory
- namespace: null
- release_date: '2021-06-29'
+ - description: Zabbix Inventory Plugin
+ name: zabbix_inventory
+ namespace: null
+ release_date: "2021-06-29"
1.5.0:
changes:
breaking_changes:
- - all roles now reference other roles and modules via their fully qualified
- collection names, which makes Ansible 2.10 minimum supported version for roles
- (See https://github.com/ansible-collections/community.zabbix/pull/477).
+ - all roles now reference other roles and modules via their fully qualified
+ collection names, which makes Ansible 2.10 minimum supported version for roles
+ (See https://github.com/ansible-collections/community.zabbix/pull/477).
bugfixes:
- - all roles now support installing zabbix 4.0 version on Ubuntu 20.04.
- - all roles now supports installations on Debian 11.
- - zabbix inventory - Change default value for host_zapi_query from list "[]"
- to dict "{}".
- - zabbix_action - should no longer fail with Zabbix version 5.4.
- - zabbix_agent - `zabbix_win_install_dir` no longer ignored for zabbix_agentd.d
- and zabbix log directories.
- - zabbix_agent - auto-recovery for Windows installation has been fixed (https://github.com/ansible-collections/community.zabbix/pull/470).
- - zabbix_agent - deploying zabbix_agent2 under Windows should now be possible
- (Thanks to https://github.com/ansible-collections/community.zabbix/pull/433
- and https://github.com/ansible-collections/community.zabbix/pull/453).
- - zabbix_agent - fixed AutoPSK for Windows deployments (https://github.com/ansible-collections/community.zabbix/pull/450).
- - zabbix_host - Fix error when updating hosts caused by Zabbix bug not returning
- the inventory_mode field for hosts(https://github.com/ansible-collections/community.zabbix/issues/385).
- - zabbix_host - will not break when `tls_psk*` parameters are set with Zabbix
- version 5.4.
- - zabbix_proxy (module) - now supports configuring `tls_psk*` parameters.
- - zabbix_proxy (role) - TLS config should now properly configure certificates.
- - zabbix_proxy (role) - should no longer fail on permission problems wren configured
- to use SQLite database and now installs correct package sqlite3 on Debian
- systems.
- - zabbix_web - `zabbix_nginx_vhost_*` parameters are no longer ignored.
- - zabbix_web - executing role with `--tags` should now correctly include distribution
- specific variables (https://github.com/ansible-collections/community.zabbix/pull/448).
- - zabbix_web - now correctly restarts php-fpm service (https://github.com/ansible-collections/community.zabbix/pull/427).
- - zabbix_web - permissions for accesing php-fpm socket has been fixed (See https://github.com/ansible-collections/community.zabbix/pull/426).
+ - all roles now support installing zabbix 4.0 version on Ubuntu 20.04.
+ - all roles now supports installations on Debian 11.
+ - zabbix inventory - Change default value for host_zapi_query from list "[]"
+ to dict "{}".
+ - zabbix_action - should no longer fail with Zabbix version 5.4.
+ - zabbix_agent - `zabbix_win_install_dir` no longer ignored for zabbix_agentd.d
+ and zabbix log directories.
+ - zabbix_agent - auto-recovery for Windows installation has been fixed (https://github.com/ansible-collections/community.zabbix/pull/470).
+ - zabbix_agent - deploying zabbix_agent2 under Windows should now be possible
+ (Thanks to https://github.com/ansible-collections/community.zabbix/pull/433
+ and https://github.com/ansible-collections/community.zabbix/pull/453).
+ - zabbix_agent - fixed AutoPSK for Windows deployments (https://github.com/ansible-collections/community.zabbix/pull/450).
+ - zabbix_host - Fix error when updating hosts caused by Zabbix bug not returning
+ the inventory_mode field for hosts(https://github.com/ansible-collections/community.zabbix/issues/385).
+ - zabbix_host - will not break when `tls_psk*` parameters are set with Zabbix
+ version 5.4.
+ - zabbix_proxy (module) - now supports configuring `tls_psk*` parameters.
+ - zabbix_proxy (role) - TLS config should now properly configure certificates.
+ - zabbix_proxy (role) - should no longer fail on permission problems wren configured
+ to use SQLite database and now installs correct package sqlite3 on Debian
+ systems.
+ - zabbix_web - `zabbix_nginx_vhost_*` parameters are no longer ignored.
+ - zabbix_web - executing role with `--tags` should now correctly include distribution
+ specific variables (https://github.com/ansible-collections/community.zabbix/pull/448).
+ - zabbix_web - now correctly restarts php-fpm service (https://github.com/ansible-collections/community.zabbix/pull/427).
+ - zabbix_web - permissions for accesing php-fpm socket has been fixed (See https://github.com/ansible-collections/community.zabbix/pull/426).
minor_changes:
- - Added requirements.txt to collection root to be used with Ansible Builder.
- See https://ansible-builder.readthedocs.io/en/latest/collection_metadata.html
- - some roles are now using new naming for API connection parameters (https://github.com/ansible-collections/community.zabbix/pull/492
- and https://github.com/ansible-collections/community.zabbix/pull/495).
- - some roles can now utilize an option `zabbix_repo_yum_gpgcheck` to enable/disable
- GPG check for YUM repository (https://github.com/ansible-collections/community.zabbix/pull/438).
- - zabbix inventory - Enabled the usage of environment variables in zabbix inventory
- plugin.
- - zabbix inventory plugin - can now use environment variables ZABBIX_SERVER,
- ZABBIX_USERNAME and ZABBIX_PASSWORD for connection purposes to the Zabbix
- API.
- - zabbix_agent - `zabbix_agent_loadmodule` can also be configured with a list.
- - zabbix_agent - new `zabbix_api_timeout` option.
- - zabbix_agent - now supports DenyKeys configuration.
- - zabbix_hostmacro - now supports creating macros of type secret and vault.
- - zabbix_proxy (role) - new `zabbix_api_timeout` option.
- - zabbix_proxy_info - new module that allows to retrieve information about configured
- Zabbix Proxies.
- - zabbix_server - added support for TimescaleDB (https://github.com/ansible-collections/community.zabbix/pull/428).
+ - Added requirements.txt to collection root to be used with Ansible Builder.
+ See https://ansible-builder.readthedocs.io/en/latest/collection_metadata.html
+ - some roles are now using new naming for API connection parameters (https://github.com/ansible-collections/community.zabbix/pull/492
+ and https://github.com/ansible-collections/community.zabbix/pull/495).
+ - some roles can now utilize an option `zabbix_repo_yum_gpgcheck` to enable/disable
+ GPG check for YUM repository (https://github.com/ansible-collections/community.zabbix/pull/438).
+ - zabbix inventory - Enabled the usage of environment variables in zabbix inventory
+ plugin.
+ - zabbix inventory plugin - can now use environment variables ZABBIX_SERVER,
+ ZABBIX_USERNAME and ZABBIX_PASSWORD for connection purposes to the Zabbix
+ API.
+ - zabbix_agent - `zabbix_agent_loadmodule` can also be configured with a list.
+ - zabbix_agent - new `zabbix_api_timeout` option.
+ - zabbix_agent - now supports DenyKeys configuration.
+ - zabbix_hostmacro - now supports creating macros of type secret and vault.
+ - zabbix_proxy (role) - new `zabbix_api_timeout` option.
+ - zabbix_proxy_info - new module that allows to retrieve information about configured
+ Zabbix Proxies.
+ - zabbix_server - added support for TimescaleDB (https://github.com/ansible-collections/community.zabbix/pull/428).
fragments:
- - 0-copy_ignore_txt.yml
- - 415-inventory_mode-fix.yaml
- - 456-zabbix-hostmacro-secret-vault.yml
- - 505-awx_compatibility-fixes.yml
- - zbx-missing-1.5.0.yml
- - zbx-proxy-info.yaml
+ - 0-copy_ignore_txt.yml
+ - 415-inventory_mode-fix.yaml
+ - 456-zabbix-hostmacro-secret-vault.yml
+ - 505-awx_compatibility-fixes.yml
+ - zbx-missing-1.5.0.yml
+ - zbx-proxy-info.yaml
modules:
- - description: Gather information about Zabbix proxy
- name: zabbix_proxy_info
- namespace: ''
- release_date: '2021-11-02'
+ - description: Gather information about Zabbix proxy
+ name: zabbix_proxy_info
+ namespace: ""
+ release_date: "2021-11-02"
1.5.1:
changes:
bugfixes:
- - template - use templateid property when linking templates for ``template.create``
- and ``template.update`` API calls.
- - zabbix inventory - Moved ZABBIX_VALIDATE_CERTS to correct option, validate_certs.
- - zabbix_agent - Create the actual configuration file for Windows setups.
- - zabbix_agent - Fix typo for correct using the zabbix_windows_service.exists
- - zabbix_agent - tlspsk_auto to support become on Linux and ignore on windows
- - zabbix_user - fix zabbix_user require password only on internal.
+ - template - use templateid property when linking templates for ``template.create``
+ and ``template.update`` API calls.
+ - zabbix inventory - Moved ZABBIX_VALIDATE_CERTS to correct option, validate_certs.
+ - zabbix_agent - Create the actual configuration file for Windows setups.
+ - zabbix_agent - Fix typo for correct using the zabbix_windows_service.exists
+ - zabbix_agent - tlspsk_auto to support become on Linux and ignore on windows
+ - zabbix_user - fix zabbix_user require password only on internal.
minor_changes:
- - Enabled usage of environment variables for modules by adding a fallback lookup
- in the module_utils/helpers.py - zabbix_common_argument_spec
+ - Enabled usage of environment variables for modules by adding a fallback lookup
+ in the module_utils/helpers.py - zabbix_common_argument_spec
fragments:
- - 508-zabbix-env-vars.yml
- - 512-inventory-bugfix.yaml
- - 521-agent-typo.yaml
- - 523-templateid-property.yml
- - 527-agent-windows-config-creation.yaml
- - 537-TLSPSK.yaml
- - 543-internal-user.yaml
- release_date: '2021-12-05'
+ - 508-zabbix-env-vars.yml
+ - 512-inventory-bugfix.yaml
+ - 521-agent-typo.yaml
+ - 523-templateid-property.yml
+ - 527-agent-windows-config-creation.yaml
+ - 537-TLSPSK.yaml
+ - 543-internal-user.yaml
+ release_date: "2021-12-05"
1.6.0:
changes:
bugfixes:
- - 'Various modules and plugins - use vendored version of ``distutils.version``
- instead of the deprecated Python standard library ``distutils`` (https://github.com/ansible-collections/community.zabbix/pull/603).
- This superseedes #597.'
- - ZapiWrapper (module_utils) - fix only partial zabbix version is returned.
- - zabbix_agent - Install Zabbix packages when zabbix_repo == other is used with
- yum.
- - zabbix_agent - Install the Agent for MacOSX sooner than its configuration.
- - zabbix_agent - The ``Install gpg key`` task for Debian did not work when a
- http proxy is configured.
- - zabbix_agent - Use the correct URL with correct version.
- - zabbix_agent - Use the correct path to determine Zabbix Agent 2 installation
- on Windows.
- - zabbix_agent - Using the correct hostgroup as default now.
- - zabbix_agent - fix for the autopsk, incl. tests with Molecule.
- - zabbix_host - Added small notification that an user should have read access
- to get hostgroups overview.
- - zabbix_host - adapter changed properties for interface comparisson
- - zabbix_maintenance - should now work when creating maintenace on Zabbix 6.0
- server
- - zabbix_proxy - 'zcat' the zipped sql files to /tmp before executing it.
- - zabbix_proxy - Check MySQL version before settings mysql_innodb_default_row_format
- value.
- - zabbix_proxy - Install Zabbix packages when zabbix_repo == other is used with
- yum.
- - zabbix_server - 'zcat' the zipped sql files to /tmp before executing it.
- - zabbix_server - Check MySQL version before settings mysql_innodb_default_row_format
- value.
- - zabbix_server - Install Zabbix packages when zabbix_repo == other is used
- with yum.
- - zabbix_template - setting correct null values to fix unintentional changes
- - zabbix_web - Added some default variables if the geerlingguys apache role
- is not used.
- - zabbix_web - Specified the correct versions for php.
+ - "Various modules and plugins - use vendored version of ``distutils.version``
+ instead of the deprecated Python standard library ``distutils`` (https://github.com/ansible-collections/community.zabbix/pull/603).
+ This superseedes #597."
+ - ZapiWrapper (module_utils) - fix only partial zabbix version is returned.
+ - zabbix_agent - Install Zabbix packages when zabbix_repo == other is used with
+ yum.
+ - zabbix_agent - Install the Agent for MacOSX sooner than its configuration.
+ - zabbix_agent - The ``Install gpg key`` task for Debian did not work when a
+ http proxy is configured.
+ - zabbix_agent - Use the correct URL with correct version.
+ - zabbix_agent - Use the correct path to determine Zabbix Agent 2 installation
+ on Windows.
+ - zabbix_agent - Using the correct hostgroup as default now.
+ - zabbix_agent - fix for the autopsk, incl. tests with Molecule.
+ - zabbix_host - Added small notification that an user should have read access
+ to get hostgroups overview.
+ - zabbix_host - adapter changed properties for interface comparisson
+ - zabbix_maintenance - should now work when creating maintenace on Zabbix 6.0
+ server
+ - zabbix_proxy - 'zcat' the zipped sql files to /tmp before executing it.
+ - zabbix_proxy - Check MySQL version before settings mysql_innodb_default_row_format
+ value.
+ - zabbix_proxy - Install Zabbix packages when zabbix_repo == other is used with
+ yum.
+ - zabbix_server - 'zcat' the zipped sql files to /tmp before executing it.
+ - zabbix_server - Check MySQL version before settings mysql_innodb_default_row_format
+ value.
+ - zabbix_server - Install Zabbix packages when zabbix_repo == other is used
+ with yum.
+ - zabbix_template - setting correct null values to fix unintentional changes
+ - zabbix_web - Added some default variables if the geerlingguys apache role
+ is not used.
+ - zabbix_web - Specified the correct versions for php.
minor_changes:
- - all modules - prepare for deprecation of distutils LooseVersion.
- - collection - Add dependencies to other collections. This helps Ansible Galaxy
- automatically downloading collections that this collection relies on to run.
- - connection.httpapi (plugin) - add initial httpapi connection plugin.
- - httpapi.jsonrpc (plugin) - add initial httpapi for future handling of json-rpc.
- - new module zabbix authentication for configuring global authentication settings
- in Zabbix Server's Settings section of GUI.
- - new module zabbix_autoregister for configuring global autoregistration settings
- in Zabbix Server's Settings section of GUI.
- - new module zabbix_housekeeping for configuring global housekeeping settings
- in Zabbix Server's Settings section of GUI.
- - test_zabbix_host_info - fix Template/Group names for 5.4
- - test_zabbix_screen - disable testing for screen in 5.4 (deprecated)
- - zabbix_action - additional fixes to make module work with Zabbix 6.0 (https://github.com/ansible-collections/community.zabbix/pull/664)
- - zabbix_action - module ported to work with Zabbix 6.0 (https://github.com/ansible-collections/community.zabbix/pull/648,
- https://github.com/ansible-collections/community.zabbix/pull/653)
- - zabbix_action - should now correctly actions with maintenance_status conditions
- (https://github.com/ansible-collections/community.zabbix/pull/667)
- - zabbix_agent - Check if 'firewalld' exist and is running when handler is executed.
- - zabbix_agent - Fixed use of bare variables in conditions (https://github.com/ansible-collections/community.zabbix/pull/663)
- - zabbix_agent - Install the correct Python libxml2 package on SLES15
- - zabbix_agent - Move inclusion of the apache.yml tasks to later stage during
- execution of role.
- - zabbix_agent - Prepare for Zabbix 6.0.
- - zabbix_agent - Specify a minor version with zabbix_agent_version_minor for
- RH systems.
- - zabbix_agent - There was no way to configure a specific type for the macro.
- - zabbix_agent - Use multiple aliases in the configuration file with ``zabbix_agent_zabbix_alias``
- or ``zabbix_agent2_zabbix_alias``.
- - zabbix_maintenance - added new module parameter `tags`, which allows configuring
- Problem Tags on maintenances.
- - zabbix_maintenance - fixed to work with Zabbix 6.0+ and Python 3.9+ (https://github.com/ansible-collections/community.zabbix/pull/665)
- - zabbix_proxy - Prepare for Zabbix 6.0.
- - zabbix_proxy - Specify a minor version with zabbix_proxy_version_minor for
- RH systems.
- - zabbix_proxy - Support for Sangoma and treat it like a RHEL system.
- - zabbix_server - Check the 'zabbix_server_install_database_client' variable
- in RedHat tasks.
- - zabbix_server - Prepare for Zabbix 6.0.
- - zabbix_server - Specify a minor version with zabbix_server_version_minor for
- RH systems.
- - zabbix_user - change alias property to username (changed in 5.4) (alias is
- now an alias for username)
- - zabbix_user_info - change alias property to username (changed in 5.4) (alias
- is now an alias for username)
- - zabbix_web - Change format ENCRYPTION, VERIFY_HOST from string to boolean.
- - zabbix_web - Specify a minor version with zabbix_web_version_minor for RH
- systems.
+ - all modules - prepare for deprecation of distutils LooseVersion.
+ - collection - Add dependencies to other collections. This helps Ansible Galaxy
+ automatically downloading collections that this collection relies on to run.
+ - connection.httpapi (plugin) - add initial httpapi connection plugin.
+ - httpapi.jsonrpc (plugin) - add initial httpapi for future handling of json-rpc.
+ - new module zabbix authentication for configuring global authentication settings
+ in Zabbix Server's Settings section of GUI.
+ - new module zabbix_autoregister for configuring global autoregistration settings
+ in Zabbix Server's Settings section of GUI.
+ - new module zabbix_housekeeping for configuring global housekeeping settings
+ in Zabbix Server's Settings section of GUI.
+ - test_zabbix_host_info - fix Template/Group names for 5.4
+ - test_zabbix_screen - disable testing for screen in 5.4 (deprecated)
+ - zabbix_action - additional fixes to make module work with Zabbix 6.0 (https://github.com/ansible-collections/community.zabbix/pull/664)
+ - zabbix_action - module ported to work with Zabbix 6.0 (https://github.com/ansible-collections/community.zabbix/pull/648,
+ https://github.com/ansible-collections/community.zabbix/pull/653)
+ - zabbix_action - should now correctly actions with maintenance_status conditions
+ (https://github.com/ansible-collections/community.zabbix/pull/667)
+ - zabbix_agent - Check if 'firewalld' exist and is running when handler is executed.
+ - zabbix_agent - Fixed use of bare variables in conditions (https://github.com/ansible-collections/community.zabbix/pull/663)
+ - zabbix_agent - Install the correct Python libxml2 package on SLES15
+ - zabbix_agent - Move inclusion of the apache.yml tasks to later stage during
+ execution of role.
+ - zabbix_agent - Prepare for Zabbix 6.0.
+ - zabbix_agent - Specify a minor version with zabbix_agent_version_minor for
+ RH systems.
+ - zabbix_agent - There was no way to configure a specific type for the macro.
+ - zabbix_agent - Use multiple aliases in the configuration file with ``zabbix_agent_zabbix_alias``
+ or ``zabbix_agent2_zabbix_alias``.
+ - zabbix_maintenance - added new module parameter `tags`, which allows configuring
+ Problem Tags on maintenances.
+ - zabbix_maintenance - fixed to work with Zabbix 6.0+ and Python 3.9+ (https://github.com/ansible-collections/community.zabbix/pull/665)
+ - zabbix_proxy - Prepare for Zabbix 6.0.
+ - zabbix_proxy - Specify a minor version with zabbix_proxy_version_minor for
+ RH systems.
+ - zabbix_proxy - Support for Sangoma and treat it like a RHEL system.
+ - zabbix_server - Check the 'zabbix_server_install_database_client' variable
+ in RedHat tasks.
+ - zabbix_server - Prepare for Zabbix 6.0.
+ - zabbix_server - Specify a minor version with zabbix_server_version_minor for
+ RH systems.
+ - zabbix_user - change alias property to username (changed in 5.4) (alias is
+ now an alias for username)
+ - zabbix_user_info - change alias property to username (changed in 5.4) (alias
+ is now an alias for username)
+ - zabbix_web - Change format ENCRYPTION, VERIFY_HOST from string to boolean.
+ - zabbix_web - Specify a minor version with zabbix_web_version_minor for RH
+ systems.
fragments:
- - 144-check-if-service-is-running.yml
- - 329-only-do-apache-stuff.yml
- - 356-zbx-maint-tags.yml
- - 360-fix-macos-install.yml
- - 367-add-dependencies.yml
- - 414-specify-minor-version.yml
- - 444-add-initial-httpapi.yml
- - 560-prepare-zabbix-60-roles.yml
- - 570-fix-autopsk.yml
- - 574-fix-windows-url.yml
- - 583-change-var-type.yml
- - 587-host-cannot-have-same-type.yml
- - 588-template-not-found.yml
- - 589-failed-to-get-screen.yml
- - 591-invalid-parameter.yml
- - 592-has-no-attribute.yml
- - 597-prepare-distutils.yml
- - 599-multiple-aliases.yml
- - 603-vendor-distutils.yml
- - 612-use-correct-value.yml
- - 620-add-macro-type.yml
- - 622-fix-environmentsettings.yml
- - 630-zabbix-autoreg.yml
- - 638-sangoma-rhel.yml
- - 645-zabbix-authentication.yml
- - 647-zabbix-housekeeping.yml
- - 648-653-zbx_action.yaml
- - 654-check-zabbix_server_install_database_client-rhel.yml
- - 664-zbx_action.yaml
- - 665-zbx_maint.yaml
- - 668-zabbix_agent-sles15.yml
- - various-wd.yml
+ - 144-check-if-service-is-running.yml
+ - 329-only-do-apache-stuff.yml
+ - 356-zbx-maint-tags.yml
+ - 360-fix-macos-install.yml
+ - 367-add-dependencies.yml
+ - 414-specify-minor-version.yml
+ - 444-add-initial-httpapi.yml
+ - 560-prepare-zabbix-60-roles.yml
+ - 570-fix-autopsk.yml
+ - 574-fix-windows-url.yml
+ - 583-change-var-type.yml
+ - 587-host-cannot-have-same-type.yml
+ - 588-template-not-found.yml
+ - 589-failed-to-get-screen.yml
+ - 591-invalid-parameter.yml
+ - 592-has-no-attribute.yml
+ - 597-prepare-distutils.yml
+ - 599-multiple-aliases.yml
+ - 603-vendor-distutils.yml
+ - 612-use-correct-value.yml
+ - 620-add-macro-type.yml
+ - 622-fix-environmentsettings.yml
+ - 630-zabbix-autoreg.yml
+ - 638-sangoma-rhel.yml
+ - 645-zabbix-authentication.yml
+ - 647-zabbix-housekeeping.yml
+ - 648-653-zbx_action.yaml
+ - 654-check-zabbix_server_install_database_client-rhel.yml
+ - 664-zbx_action.yaml
+ - 665-zbx_maint.yaml
+ - 668-zabbix_agent-sles15.yml
+ - various-wd.yml
modules:
- - description: Update Zabbix authentication
- name: zabbix_authentication
- namespace: ''
- - description: Update Zabbix autoregistration
- name: zabbix_autoregister
- namespace: ''
- - description: Update Zabbix housekeeping
- name: zabbix_housekeeping
- namespace: ''
+ - description: Update Zabbix authentication
+ name: zabbix_authentication
+ namespace: ""
+ - description: Update Zabbix autoregistration
+ name: zabbix_autoregister
+ namespace: ""
+ - description: Update Zabbix housekeeping
+ name: zabbix_housekeeping
+ namespace: ""
plugins:
connection:
- - description: Use httpapi to run command on network appliances
- name: httpapi
- namespace: null
+ - description: Use httpapi to run command on network appliances
+ name: httpapi
+ namespace: null
httpapi:
- - description: HttpApi Plugin for Zabbix
- name: jsonrpc
- namespace: null
- release_date: '2022-03-21'
+ - description: HttpApi Plugin for Zabbix
+ name: jsonrpc
+ namespace: null
+ release_date: "2022-03-21"
1.7.0:
changes:
bugfixes:
- - Include ``PSF-license.txt`` file for ``plugins/module_utils/_version.py``.
- - zabbix_action - will no longer wipe `esc_step_to` and `esc_step_from` (https://github.com/ansible-collections/community.zabbix/issues/692)
- - zabbix_agent - added support for zabbix-agent on Ubuntu 22.04 (https://github.com/ansible-collections/community.zabbix/pull/681)
- - zabbix_agent - now properly creates webroot for issuing LE certificates (https://github.com/ansible-collections/community.zabbix/pull/677,
- https://github.com/ansible-collections/community.zabbix/pull/682)
- - zabbix_proxy (module) - passive proxy should be now correctly created in Zabbix
- 6.0 (https://github.com/ansible-collections/community.zabbix/pull/697)
- - zabbix_proxy (role) - fixed accidental regression of TLS psk file being generated
- for passive agent (#528) caused in (#663) (https://github.com/ansible-collections/community.zabbix/issues/680)
+ - Include ``PSF-license.txt`` file for ``plugins/module_utils/_version.py``.
+ - zabbix_action - will no longer wipe `esc_step_to` and `esc_step_from` (https://github.com/ansible-collections/community.zabbix/issues/692)
+ - zabbix_agent - added support for zabbix-agent on Ubuntu 22.04 (https://github.com/ansible-collections/community.zabbix/pull/681)
+ - zabbix_agent - now properly creates webroot for issuing LE certificates (https://github.com/ansible-collections/community.zabbix/pull/677,
+ https://github.com/ansible-collections/community.zabbix/pull/682)
+ - zabbix_proxy (module) - passive proxy should be now correctly created in Zabbix
+ 6.0 (https://github.com/ansible-collections/community.zabbix/pull/697)
+ - zabbix_proxy (role) - fixed accidental regression of TLS psk file being generated
+ for passive agent (#528) caused in (#663) (https://github.com/ansible-collections/community.zabbix/issues/680)
minor_changes:
- - helpers.helper_compare_lists() changed logic to not consider the order of
- elements in lists. (https://github.com/ansible-collections/community.zabbix/pull/683)
- - zabbix_action, zabbix_maintenance, zabbix_mediatype, zabbix_proxy, zabbix_service
- - updated to work with Zabbix 6.0. (https://github.com/ansible-collections/community.zabbix/pull/683)
- - zabbix_script module added (https://github.com/ansible-collections/community.zabbix/issues/634)
+ - helpers.helper_compare_lists() changed logic to not consider the order of
+ elements in lists. (https://github.com/ansible-collections/community.zabbix/pull/683)
+ - zabbix_action, zabbix_maintenance, zabbix_mediatype, zabbix_proxy, zabbix_service
+ - updated to work with Zabbix 6.0. (https://github.com/ansible-collections/community.zabbix/pull/683)
+ - zabbix_script module added (https://github.com/ansible-collections/community.zabbix/issues/634)
fragments:
- - 1.7.0-missing-fragments.yml
- - 683-zbx60.yml
- - 685-zabbix-script.yml
- - 699-proxy-role-regression.yml
- - psf-license.yml
+ - 1.7.0-missing-fragments.yml
+ - 683-zbx60.yml
+ - 685-zabbix-script.yml
+ - 699-proxy-role-regression.yml
+ - psf-license.yml
modules:
- - description: Create/update/delete Zabbix scripts
- name: zabbix_script
- namespace: ''
- release_date: '2022-05-24'
+ - description: Create/update/delete Zabbix scripts
+ name: zabbix_script
+ namespace: ""
+ release_date: "2022-05-24"
1.8.0:
changes:
bugfixes:
- - zabbix_host - fixed idempotency of the module when hostmacros or snmp interfaces
- are used
- - zabbix_script - fix compatibility with Zabbix <5.4.
- - zabbix_script - should no longer fail when description is not set
+ - zabbix_host - fixed idempotency of the module when hostmacros or snmp interfaces
+ are used
+ - zabbix_script - fix compatibility with Zabbix <5.4.
+ - zabbix_script - should no longer fail when description is not set
minor_changes:
- - roles - Minimized the config templates for the zabbix_agent, zabbix_javagateway,
- zabbix_proxy, and zabbix_server roles to make them version independent.
- - roles - Support for Zabbix 6.2 has been added
- - roles - Updated the version defaults to select the latest version supported
- by an operating system.
- - zabbix_action - added another condition operator naming options (contains,
- does not contain,...)
- - zabbix_agent - Set a ansible_python_interpreter to localhost based on the
- env the playbook is executed from.
- - zabbix_agent - add option to set host tags using ``zabbix_agent_tags``.
- - zabbix_agent - add possiblity to set include file pattern using ``zabbix_agent(2)_include_pattern``
- variable.
- - zabbix_agent - is now able to manage directories and upload files for TLS
- PSK configuration used with Windows operating systems
- - zabbix_agent - new options for Windows installations zabbix_win_install_dir_conf/bin
- - zabbix_agent - when configuring firewalld, make sure the new rule is applied
- immediately
- - zabbix_authentication - module updated to support Zabbix 6.2
- - zabbix_host - using ``tls_psk_identity`` or ``tls_psk`` parameters with Zabbix
- >= 5.4 makes this module non-idempotent
- - zabbix_host - will no longer wipe tls_connect en tls_accept settings when
- not specified on update
- - zabbix_mediatype - added support for time units in ``attempt_interval`` parameter
- - zabbix_template - added support for template groups (Zabbix >= 6.2)
- - zabbix_template_info - add template_id return value
- - zabbix_template_info - add yaml and none formats
- - zabbix_user_directory - added new module to support multiple sources for LDAP
- authentication
+ - roles - Minimized the config templates for the zabbix_agent, zabbix_javagateway,
+ zabbix_proxy, and zabbix_server roles to make them version independent.
+ - roles - Support for Zabbix 6.2 has been added
+ - roles - Updated the version defaults to select the latest version supported
+ by an operating system.
+ - zabbix_action - added another condition operator naming options (contains,
+ does not contain,...)
+ - zabbix_agent - Set a ansible_python_interpreter to localhost based on the
+ env the playbook is executed from.
+ - zabbix_agent - add option to set host tags using ``zabbix_agent_tags``.
+ - zabbix_agent - add possiblity to set include file pattern using ``zabbix_agent(2)_include_pattern``
+ variable.
+ - zabbix_agent - is now able to manage directories and upload files for TLS
+ PSK configuration used with Windows operating systems
+ - zabbix_agent - new options for Windows installations zabbix_win_install_dir_conf/bin
+ - zabbix_agent - when configuring firewalld, make sure the new rule is applied
+ immediately
+ - zabbix_authentication - module updated to support Zabbix 6.2
+ - zabbix_host - using ``tls_psk_identity`` or ``tls_psk`` parameters with Zabbix
+ >= 5.4 makes this module non-idempotent
+ - zabbix_host - will no longer wipe tls_connect en tls_accept settings when
+ not specified on update
+ - zabbix_mediatype - added support for time units in ``attempt_interval`` parameter
+ - zabbix_template - added support for template groups (Zabbix >= 6.2)
+ - zabbix_template_info - add template_id return value
+ - zabbix_template_info - add yaml and none formats
+ - zabbix_user_directory - added new module to support multiple sources for LDAP
+ authentication
fragments:
- - 602-change-intrepeter.yml
- - 711-minimize-role-config-templates.yml
- - 727-script-compatibility.yml
- - 731-template-info-formats.yml
- - 738-template-groups.yml
- - 741-host-tls-psk-fix.yml
- - 743-agent-tags.yml
- - 744-mediatype-attemptinterval-timeunits.yml
- - 749-action-operator-naming.yml
- - 753-host-tls-settings.yml
- - 755-user-directory-module.yml
- - 770-agent-include-pattern.yml
- - 771-auto-select-version.yml
- - firewalld_immediate.yaml
- - missing.yml
- release_date: '2022-08-15'
+ - 602-change-intrepeter.yml
+ - 711-minimize-role-config-templates.yml
+ - 727-script-compatibility.yml
+ - 731-template-info-formats.yml
+ - 738-template-groups.yml
+ - 741-host-tls-psk-fix.yml
+ - 743-agent-tags.yml
+ - 744-mediatype-attemptinterval-timeunits.yml
+ - 749-action-operator-naming.yml
+ - 753-host-tls-settings.yml
+ - 755-user-directory-module.yml
+ - 770-agent-include-pattern.yml
+ - 771-auto-select-version.yml
+ - firewalld_immediate.yaml
+ - missing.yml
+ release_date: "2022-08-15"
1.9.0:
changes:
bugfixes:
- - The inventory script had insufficient error handling in case the Zabbix API
- provided an empty interfaces list. This bugfix checks for an exisiting interfaces
- element, then for the minimal length of 1 so that the first interface will
- only be accessed when it really exists in the api response. (https://github.com/ansible-collections/community.zabbix/issues/826)
- - zabbix-proxy - updated to install correct sources for Debian arm64 family
- - zabbix_agent - Filter IPv6 addresses from list of IP as Zabbix host creation
- expects IPv4
- - zabbix_agent - installation on Windows will no longer fail when zabbix_agent2
- is used
- - zabbix_host - fix updating of host without interfaces
- - zabbix_proxy - correctly provision tls_accept and tls_connect on Zabbix backend
- - zabbix_proxy - updated the datafiles_path fact for the zabbix_proxy and zabbix_server
- roles due to upstream change
- - zabbix_server - move location of the fping(6) variables to distribution specific
- files (https://github.com/ansible-collections/community.zabbix/issues/812)
- - zabbix_server - updated the datafiles_path fact for the zabbix_proxy and zabbix_server
- roles due to upstream change
+ - The inventory script had insufficient error handling in case the Zabbix API
+ provided an empty interfaces list. This bugfix checks for an exisiting interfaces
+ element, then for the minimal length of 1 so that the first interface will
+ only be accessed when it really exists in the api response. (https://github.com/ansible-collections/community.zabbix/issues/826)
+ - zabbix-proxy - updated to install correct sources for Debian arm64 family
+ - zabbix_agent - Filter IPv6 addresses from list of IP as Zabbix host creation
+ expects IPv4
+ - zabbix_agent - installation on Windows will no longer fail when zabbix_agent2
+ is used
+ - zabbix_host - fix updating of host without interfaces
+ - zabbix_proxy - correctly provision tls_accept and tls_connect on Zabbix backend
+ - zabbix_proxy - updated the datafiles_path fact for the zabbix_proxy and zabbix_server
+ roles due to upstream change
+ - zabbix_server - move location of the fping(6) variables to distribution specific
+ files (https://github.com/ansible-collections/community.zabbix/issues/812)
+ - zabbix_server - updated the datafiles_path fact for the zabbix_proxy and zabbix_server
+ roles due to upstream change
major_changes:
- - all modules are opting away from zabbix-api and using httpapi ansible.netcommon
- plugin. We will support zabbix-api for backwards compatibility until next
- major release. See our README.md for more information about how to migrate
- - zabbix_agent and zabbix_proxy roles are opting away from zabbix-api and use
- httpapi ansible.netcommon plugin. We will support zabbix-api for backwards
- compatibility until next major release. See our README.md for more information
- about how to migrate
+ - all modules are opting away from zabbix-api and using httpapi ansible.netcommon
+ plugin. We will support zabbix-api for backwards compatibility until next
+ major release. See our README.md for more information about how to migrate
+ - zabbix_agent and zabbix_proxy roles are opting away from zabbix-api and use
+ httpapi ansible.netcommon plugin. We will support zabbix-api for backwards
+ compatibility until next major release. See our README.md for more information
+ about how to migrate
minor_changes:
- - ansible_zabbix_url_path introduced to be able to specify non-default Zabbix
- WebUI path, e.g. http://<FQDN>/zabbixeu
- - collection now supports creating ``module_defaults`` for ``group/community.zabbix.zabbix``
- (see https://github.com/ansible-collections/community.zabbix/issues/326)
- - fixed ``zabbix_server`` role failure running in check_mode (see https://github.com/ansible-collections/community.zabbix/issues/804)
- - zabbix_agent - give Zabbix Agent access to the Linux DMI table allowing system.hw.chassis
- info to populate.
- - zabbix_template - add support for template tags
- - zabbix_user_role module added
- - zabbix_web - add support for Ubuntu 22.04 jammy
+ - ansible_zabbix_url_path introduced to be able to specify non-default Zabbix
+ WebUI path, e.g. http://<FQDN>/zabbixeu
+ - collection now supports creating ``module_defaults`` for ``group/community.zabbix.zabbix``
+ (see https://github.com/ansible-collections/community.zabbix/issues/326)
+ - fixed ``zabbix_server`` role failure running in check_mode (see https://github.com/ansible-collections/community.zabbix/issues/804)
+ - zabbix_agent - give Zabbix Agent access to the Linux DMI table allowing system.hw.chassis
+ info to populate.
+ - zabbix_template - add support for template tags
+ - zabbix_user_role module added
+ - zabbix_web - add support for Ubuntu 22.04 jammy
fragments:
- - 326-module_defaults-group.yml
- - 526-swap-tls-accept-connect-in-proxy.yaml
- - 778-zbx-agent2-win.yml
- - 784-allow-system.hw.chassis-to-populate-on-linux.yml
- - 786-web-add-ubuntu-22-04-support.yml
- - 792-update-host-without-iface-fix.yml
- - 795-zbx-agent-win-ipv6.yml
- - 800-add-template-tags.yml
- - 806-httpapi-connection-plugin.yml
- - 812-fping-binary-location.yml
- - 813-sql-scripts-moved-to-usr-share.yml
- - 821-zabbix-proxy-debian-arm64.yml
- - 822-roles-to-httpapi.yml
- - 823-zabbix_server-role-in-check-mode.yml
- - 827-fixing-bug-for-empty-interfaces-list.yml
- - module_zabbix-user-role.yml
- - modules-url-path.yml
- release_date: '2022-11-07'
+ - 326-module_defaults-group.yml
+ - 526-swap-tls-accept-connect-in-proxy.yaml
+ - 778-zbx-agent2-win.yml
+ - 784-allow-system.hw.chassis-to-populate-on-linux.yml
+ - 786-web-add-ubuntu-22-04-support.yml
+ - 792-update-host-without-iface-fix.yml
+ - 795-zbx-agent-win-ipv6.yml
+ - 800-add-template-tags.yml
+ - 806-httpapi-connection-plugin.yml
+ - 812-fping-binary-location.yml
+ - 813-sql-scripts-moved-to-usr-share.yml
+ - 821-zabbix-proxy-debian-arm64.yml
+ - 822-roles-to-httpapi.yml
+ - 823-zabbix_server-role-in-check-mode.yml
+ - 827-fixing-bug-for-empty-interfaces-list.yml
+ - module_zabbix-user-role.yml
+ - modules-url-path.yml
+ release_date: "2022-11-07"
1.9.1:
changes:
bugfixes:
- - all modules - remove deprecation warnings for modules parameters related to
- zabbix-api when these parapmeters are not explicetely defined
- - all roles and modules integration tests - replace deprecated include module
- whith include_tasks
- - zabbix_agent, zabbix_proxy roles, all modules - make httpapi connection work
- with HTTP Basic Authorization
- - zabbix_proxy - do not set ServerPort config parameter which was removed in
- Zabbix 6.0
- - 'zabbix_server role Debian.yml task - remove warn: arg for shell module as
- the arg is deprecated since ansible-core above 2.13'
- - zabbix_user_role module - creation of a User Role with Super Admin type
+ - all modules - remove deprecation warnings for modules parameters related to
+ zabbix-api when these parapmeters are not explicetely defined
+ - all roles and modules integration tests - replace deprecated include module
+ whith include_tasks
+ - zabbix_agent, zabbix_proxy roles, all modules - make httpapi connection work
+ with HTTP Basic Authorization
+ - zabbix_proxy - do not set ServerPort config parameter which was removed in
+ Zabbix 6.0
+ - "zabbix_server role Debian.yml task - remove warn: arg for shell module as
+ the arg is deprecated since ansible-core above 2.13"
+ - zabbix_user_role module - creation of a User Role with Super Admin type
minor_changes:
- - zabbix suport for rhel 9
+ - zabbix suport for rhel 9
fragments:
- - 845-rhel-9-support.yml
- - 850-proxy-serverport.yml
- - 857-deprecation-warnings.yml
- - 859-remove-warn-arg.yml
- - 866-user-role-superadmin.yml
- - 868-include-to-include-tasks.yml
- - fix-httpapi-http-auth.yml
- release_date: '2023-01-09'
+ - 845-rhel-9-support.yml
+ - 850-proxy-serverport.yml
+ - 857-deprecation-warnings.yml
+ - 859-remove-warn-arg.yml
+ - 866-user-role-superadmin.yml
+ - 868-include-to-include-tasks.yml
+ - fix-httpapi-http-auth.yml
+ release_date: "2023-01-09"
1.9.2:
changes:
bugfixes:
- - zabbix_agent and zabbix_proxy roles - fixed a bug whith ansible_python_interpreter
- not being set correctly in some corner cases
- - zabbix_agent role - Fix MacOS install never executed because of the missing
- include_tasks "Darwin.yml" in the "main.yml" task file and wrong user permission
- on folder/files.
- - zabbix_agent, zabbix_proxy and zabbix_server roles - make Ansible 2.14 compatible
- by removing warn parameter
+ - zabbix_agent and zabbix_proxy roles - fixed a bug whith ansible_python_interpreter
+ not being set correctly in some corner cases
+ - zabbix_agent role - Fix MacOS install never executed because of the missing
+ include_tasks "Darwin.yml" in the "main.yml" task file and wrong user permission
+ on folder/files.
+ - zabbix_agent, zabbix_proxy and zabbix_server roles - make Ansible 2.14 compatible
+ by removing warn parameter
fragments:
- - 897.yml
- - missing.yml
- release_date: '2023-02-11'
+ - 897.yml
+ - missing.yml
+ release_date: "2023-02-11"
1.9.3:
changes:
bugfixes:
- - compatibility with ansible.netcommon 5.0.0
- - treat sendto parameter in module zabbix_user according to real media type,
- do not rely on media name
- - zabbix-proxy role - fix tags for postgresql task.
- - zabbix_agent role - Fix MacOS install never executed because of the missing
- include_tasks "Darwin.yml" in the "main.yml" task file and wrong user permission
- on folder/files.
- - zabbix_user module - ability to specify several e-mail addresses in Zabbix
- User's media
+ - compatibility with ansible.netcommon 5.0.0
+ - treat sendto parameter in module zabbix_user according to real media type,
+ do not rely on media name
+ - zabbix-proxy role - fix tags for postgresql task.
+ - zabbix_agent role - Fix MacOS install never executed because of the missing
+ include_tasks "Darwin.yml" in the "main.yml" task file and wrong user permission
+ on folder/files.
+ - zabbix_user module - ability to specify several e-mail addresses in Zabbix
+ User's media
minor_changes:
- - httpapi plugin - updated to work with Zabbix 6.4.
- - zabbix_action, zabbix_authentication, zabbix_discovery_rule, zabbix_mediatype,
- zabbix_user, zabbix_user_directory, zabbix_usergroup - updated to work with
- Zabbix 6.4.
- - zabbix_agent role - Add support for SUSE Linux Enterprise Server for SAP Applications
- ("SLES_SAP").
- - zabbix_host - add missing variants for SNMPv3 authprotocol and privprotocol
- introduced by Zabbix 6
- - zabbix_proxy role - Add variable zabbix_proxy_dbpassword_hash_method to control
- whether you want postgresql user password to be hashed with md5 or want to
- use db default. When zabbix_proxy_dbpassword_hash_method is set to anything
- other than md5 then do not hash the password with md5 so you could use postgresql
- scram-sha-256 hashing method.
- - zabbix_server role - Add variable zabbix_server_dbpassword_hash_method to
- control whether you want postgresql user password to be hashed with md5 or
- want to use db default. When zabbix_server_dbpassword_hash_method is set to
- anything other than md5 then do not hash the password with md5 so you could
- use postgresql scram-sha-256 hashing method.
- - zabbix_usergroup module - userdirectory, hostgroup_rights and templategroup_rights
- parameters added (Zabbix >= 6.2)
- - zabbix_web role - possibility to add custom includes in apache vhost config
+ - httpapi plugin - updated to work with Zabbix 6.4.
+ - zabbix_action, zabbix_authentication, zabbix_discovery_rule, zabbix_mediatype,
+ zabbix_user, zabbix_user_directory, zabbix_usergroup - updated to work with
+ Zabbix 6.4.
+ - zabbix_agent role - Add support for SUSE Linux Enterprise Server for SAP Applications
+ ("SLES_SAP").
+ - zabbix_host - add missing variants for SNMPv3 authprotocol and privprotocol
+ introduced by Zabbix 6
+ - zabbix_proxy role - Add variable zabbix_proxy_dbpassword_hash_method to control
+ whether you want postgresql user password to be hashed with md5 or want to
+ use db default. When zabbix_proxy_dbpassword_hash_method is set to anything
+ other than md5 then do not hash the password with md5 so you could use postgresql
+ scram-sha-256 hashing method.
+ - zabbix_server role - Add variable zabbix_server_dbpassword_hash_method to
+ control whether you want postgresql user password to be hashed with md5 or
+ want to use db default. When zabbix_server_dbpassword_hash_method is set to
+ anything other than md5 then do not hash the password with md5 so you could
+ use postgresql scram-sha-256 hashing method.
+ - zabbix_usergroup module - userdirectory, hostgroup_rights and templategroup_rights
+ parameters added (Zabbix >= 6.2)
+ - zabbix_web role - possibility to add custom includes in apache vhost config
fragments:
- - 871.yml
- - 880.yml
- - 886.yml
- - 890.yml
- - 897.yml
- - 899.yml
- - 910-postgres-proxy.yml
- - 935-custom-includes-apache.yml
- - netcommon50-fix.yaml
- - zabbix64.yml
- - zabbix_user_media_mailto.yml
- - zabbix_user_sendto.yaml
- release_date: '2023-04-03'
+ - 871.yml
+ - 880.yml
+ - 886.yml
+ - 890.yml
+ - 897.yml
+ - 899.yml
+ - 910-postgres-proxy.yml
+ - 935-custom-includes-apache.yml
+ - netcommon50-fix.yaml
+ - zabbix64.yml
+ - zabbix_user_media_mailto.yml
+ - zabbix_user_sendto.yaml
+ release_date: "2023-04-03"
2.0.0:
changes:
breaking_changes:
- - agent role - removed support for Darwin, Amazon, Fedora, XCP-ng, Suse, Mint,
- and Sangoma operating systems
- - agent role - removed support for zabbix_create_host and replaced it with zabbix_agent_host_state
- - agent role - removed support for zabbix_create_hostgroup and replaced it with
- zabbix_agent_hostgroups_state
- - agent role - removed support for zabbix_http_password, zabbix_api_http_password,
- zabbix_api_pass, and zabbix_api_login_pass and replaced it with zabbix_api_login_pass
- - agent role - removed support for zabbix_http_user, zabbix_api_http_user, zabbix_api_user,
- and zabbix_api_login_user and replaced it with zabbix_api_login_user
- - agent role - removed support for zabbix_inventory_mode and replaced it with
- zabbix_agent_inventory_mode
- - agent role - removed support for zabbix_link_templates adn replaced it with
- zabbix_agent_link_templates
- - agent role - removed support for zabbix_macros and replaced it with zabbix_agent_macros
- - agent role - removed support for zabbix_proxy and replaced it with zabbix_agent_proxy
- - agent role - removed support for zabbix_update_host and replaced it with zabbix_agent_host_update
- - all modules - dropped support of Zabbix versions < 6.0
- - all roles - removed support for the zabbix_version variable.
- - all roles - removed support for all versions of Zabbix < 6.0.
- - all roles - removed support for installation from epel and non-standard repositories
- - dropped support of zabbix-api to make REST API calls to Zabbix
- - proxy role - removed support for zabbix_database_creation and replaced it
- with zabbix_proxy_database_creation
- - proxy role - removed support for zabbix_database_sqlload and replaced it
- with zabbix_proxy_database_sqlload
- - proxy role - removed support for zabbix_selinux and replaced it with zabbix_proxy_selinux
- - server role - removed support for zabbix_server_mysql_login_password and replaced
- with zabbix_server_dbpassword
- - server role - removed support for zabbix_server_mysql_login_user and replaced
- with zabbix_server_dbuser
- - stopped supporting Ansible < 2.12
- - stopped supporting Python < 3.9
- - zabbix_action - message parameter renamed to op_message
- - zabbix_group_facts module - removed in favour of zabbix_group_info
- - zabbix_host_facts module - removed in favour of zabbix_host_info
+ - agent role - removed support for Darwin, Amazon, Fedora, XCP-ng, Suse, Mint,
+ and Sangoma operating systems
+ - agent role - removed support for zabbix_create_host and replaced it with zabbix_agent_host_state
+ - agent role - removed support for zabbix_create_hostgroup and replaced it with
+ zabbix_agent_hostgroups_state
+ - agent role - removed support for zabbix_http_password, zabbix_api_http_password,
+ zabbix_api_pass, and zabbix_api_login_pass and replaced it with zabbix_api_login_pass
+ - agent role - removed support for zabbix_http_user, zabbix_api_http_user, zabbix_api_user,
+ and zabbix_api_login_user and replaced it with zabbix_api_login_user
+ - agent role - removed support for zabbix_inventory_mode and replaced it with
+ zabbix_agent_inventory_mode
+ - agent role - removed support for zabbix_link_templates adn replaced it with
+ zabbix_agent_link_templates
+ - agent role - removed support for zabbix_macros and replaced it with zabbix_agent_macros
+ - agent role - removed support for zabbix_proxy and replaced it with zabbix_agent_proxy
+ - agent role - removed support for zabbix_update_host and replaced it with zabbix_agent_host_update
+ - all modules - dropped support of Zabbix versions < 6.0
+ - all roles - removed support for the zabbix_version variable.
+ - all roles - removed support for all versions of Zabbix < 6.0.
+ - all roles - removed support for installation from epel and non-standard repositories
+ - dropped support of zabbix-api to make REST API calls to Zabbix
+ - proxy role - removed support for zabbix_database_creation and replaced it
+ with zabbix_proxy_database_creation
+ - proxy role - removed support for zabbix_database_sqlload and replaced it
+ with zabbix_proxy_database_sqlload
+ - proxy role - removed support for zabbix_selinux and replaced it with zabbix_proxy_selinux
+ - server role - removed support for zabbix_server_mysql_login_password and replaced
+ with zabbix_server_dbpassword
+ - server role - removed support for zabbix_server_mysql_login_user and replaced
+ with zabbix_server_dbuser
+ - stopped supporting Ansible < 2.12
+ - stopped supporting Python < 3.9
+ - zabbix_action - message parameter renamed to op_message
+ - zabbix_group_facts module - removed in favour of zabbix_group_info
+ - zabbix_host_facts module - removed in favour of zabbix_host_info
minor_changes:
- - Replaced usage of deprecated apt key management in Debian based distros -
- See https://wiki.debian.org/DebianRepository/UseThirdParty
- - Standardized tags across all roles.
- - Updated all roles to default to version 6.4 for install.
- - all roles - removed unused variables from defaults
- - all roles - standardized testing matrix to check all supported versions and
- operating systems.
- - all roles - temporarily disable epel repo on zabbix installation tasks
- - all roles - updated documentation.
- - inventory plugin - switched from using zabbix-api to custom implementation
- adding authentication with tokens
- - inventory script - re-coded to stop using zabbix-api. API tokens support added.
- - web role - removed support for htpasswd
+ - Replaced usage of deprecated apt key management in Debian based distros -
+ See https://wiki.debian.org/DebianRepository/UseThirdParty
+ - Standardized tags across all roles.
+ - Updated all roles to default to version 6.4 for install.
+ - all roles - removed unused variables from defaults
+ - all roles - standardized testing matrix to check all supported versions and
+ operating systems.
+ - all roles - temporarily disable epel repo on zabbix installation tasks
+ - all roles - updated documentation.
+ - inventory plugin - switched from using zabbix-api to custom implementation
+ adding authentication with tokens
+ - inventory script - re-coded to stop using zabbix-api. API tokens support added.
+ - web role - removed support for htpasswd
removed_features:
- - agent role - removed support to configure firewall
- - web role - removed installation of apache, debian, and php
+ - agent role - removed support to configure firewall
+ - web role - removed installation of apache, debian, and php
fragments:
- - 2_0_update.yml
- - 941_github_runner.yml
- - 963-drop-zabbix-api.yml
- - 964_tag_cleanup.yml
- - 969_replace_apt_key.yml
- - 976_old_zabbix_versions_removal.yml
- - default_ver.yml
- - inventory_script.yml
- - python-ansible.yml
- release_date: '2023-05-04'
+ - 2_0_update.yml
+ - 941_github_runner.yml
+ - 963-drop-zabbix-api.yml
+ - 964_tag_cleanup.yml
+ - 969_replace_apt_key.yml
+ - 976_old_zabbix_versions_removal.yml
+ - default_ver.yml
+ - inventory_script.yml
+ - python-ansible.yml
+ release_date: "2023-05-04"
2.0.1:
changes:
bugfixes:
- - Proxy and Agent Roles - Added `zabbix_api_use_ssl` variable to allow secure
- API connections
- - Web Role - Added defaults and documentation for `zabbix_apache_custom_includes`
- - agent - Handled undefined variable error for Windows default versions
- - all roles - Added option to selectively disable a repo on Redhat installs
+ - Proxy and Agent Roles - Added `zabbix_api_use_ssl` variable to allow secure
+ API connections
+ - Web Role - Added defaults and documentation for `zabbix_apache_custom_includes`
+ - agent - Handled undefined variable error for Windows default versions
+ - all roles - Added option to selectively disable a repo on Redhat installs
fragments:
- - 986.yml
- - 990.yml
- - api_ssl.yml
- - disable_repo.yml
- release_date: '2023-05-26'
+ - 986.yml
+ - 990.yml
+ - api_ssl.yml
+ - disable_repo.yml
+ release_date: "2023-05-26"
2.1.0:
changes:
bugfixes:
- - agent role - Added missing become statement to allow run to role as nonroot
- - zabbix_host module - fix updating hosts that were discovered via LLD
- - zabbix_proxy role - failed at version validation. Fix adds cast of zabbix_proxy_version
- to float, similarly to the other roles.
- - zabbix_proxy role - undefined vars at updating proxy definition. Fix adds
- null defaults for zabbix_proxy_tlsaccept and zabbix_proxy_tlsconnect.
- - zabbix_web role - removed 'ssl on;' nginx configuration, which is no longer
- supported since nginx version 1.25.1.
+ - agent role - Added missing become statement to allow run to role as nonroot
+ - zabbix_host module - fix updating hosts that were discovered via LLD
+ - zabbix_proxy role - failed at version validation. Fix adds cast of zabbix_proxy_version
+ to float, similarly to the other roles.
+ - zabbix_proxy role - undefined vars at updating proxy definition. Fix adds
+ null defaults for zabbix_proxy_tlsaccept and zabbix_proxy_tlsconnect.
+ - zabbix_web role - removed 'ssl on;' nginx configuration, which is no longer
+ supported since nginx version 1.25.1.
minor_changes:
- - Multiple Roles - Replaced depricated 'include' statements with 'include_tasks'
- - Update action_groups variable in runtime.yml
- - all roles - Added support for Debian 12 (Bookworm)
- - all roles - Delete gpg ids variable.
- - all roles - Modified to allow a non-root user to run the role.
- - all roles - Updated testing to account for the correct version of Zabbix
- - zabbix_hostmacro module - Add description property for Host macro creation/update.
- Allow to set/update description of Zabbix host macros.
- - zabbix_proxy - Added installation of PyMySQL pip package
- - zabbix_proxy - Modified installation of Centos 7 MySQL client
- - zabbix_proxy - Standardized MySQL client installed on Debian and Ubuntu
- - zabbix_regexp module added
- - zabbix_settings module added
- - zabbix_token module added
+ - Multiple Roles - Replaced depricated 'include' statements with 'include_tasks'
+ - Update action_groups variable in runtime.yml
+ - all roles - Added support for Debian 12 (Bookworm)
+ - all roles - Delete gpg ids variable.
+ - all roles - Modified to allow a non-root user to run the role.
+ - all roles - Updated testing to account for the correct version of Zabbix
+ - zabbix_hostmacro module - Add description property for Host macro creation/update.
+ Allow to set/update description of Zabbix host macros.
+ - zabbix_proxy - Added installation of PyMySQL pip package
+ - zabbix_proxy - Modified installation of Centos 7 MySQL client
+ - zabbix_proxy - Standardized MySQL client installed on Debian and Ubuntu
+ - zabbix_regexp module added
+ - zabbix_settings module added
+ - zabbix_token module added
fragments:
- - 1025-delete_vars_zabbix.yml
- - 1029-update_action_groups.yml
- - 732-zabbix-regexp.yml
- - 991-zabbix-token.yml
- - 993-zabbix-settings.yml
- - agent_become.yml
- - debian12.yml
- - discovered_hosts_update.yml
- - hostmacro_modules.yml
- - include_tasks.yml
- - missing.yml
- - nginx_ssl_fix.yml
- - non_root.yml
- - proxy_role_fix.yml
+ - 1025-delete_vars_zabbix.yml
+ - 1029-update_action_groups.yml
+ - 732-zabbix-regexp.yml
+ - 991-zabbix-token.yml
+ - 993-zabbix-settings.yml
+ - agent_become.yml
+ - debian12.yml
+ - discovered_hosts_update.yml
+ - hostmacro_modules.yml
+ - include_tasks.yml
+ - missing.yml
+ - nginx_ssl_fix.yml
+ - non_root.yml
+ - proxy_role_fix.yml
modules:
- - description: Create/update/delete Zabbix regular expression
- name: zabbix_regexp
- namespace: ''
- - description: Update Zabbix global settings.
- name: zabbix_settings
- namespace: ''
- - description: Create/Update/Generate/Delete Zabbix token.
- name: zabbix_token
- namespace: ''
- release_date: '2023-06-01'
+ - description: Create/update/delete Zabbix regular expression
+ name: zabbix_regexp
+ namespace: ""
+ - description: Update Zabbix global settings.
+ name: zabbix_settings
+ namespace: ""
+ - description: Create/Update/Generate/Delete Zabbix token.
+ name: zabbix_token
+ namespace: ""
+ release_date: "2023-06-01"
2.2.0:
changes:
bugfixes:
- - zabbix_inventory - fixed handeling of add_zabbix_groups option
- - zabbix_template - fix template export when template's content has "error"
- word
- - zabbix_web role - fix variable naming issues (undefined) to zabbix_web_version
- and zabbix_web_apt_repository
+ - zabbix_inventory - fixed handeling of add_zabbix_groups option
+ - zabbix_template - fix template export when template's content has "error"
+ word
+ - zabbix_web role - fix variable naming issues (undefined) to zabbix_web_version
+ and zabbix_web_apt_repository
minor_changes:
- - Added zabbix_group_events_info module
- - action module - Added notify_if_canceled property
- - agent and proxy roles - Set default `zabbix_api_server_port` to 80 or 443
- based on `zabbix_api_use_ssl`
- - agent role - Removed duplicative Windows agent task
- - agent role - Standardized default yum priority to 99
- - all roles - Re-added ability to override Debian repo source
- - all roles - Updated Debian repository format to 822 standard
- - various - updated testing modules
- - various - updated to fully qualified module names
- - zabbix agent - Added capability to add additional configuration includes
- - zabbix_api_info module added
- - zabbix_user module - add current_passwd optional parameter to enable password
- updating of the currently logged in user (https://www.zabbix.com/documentation/6.4/en/manual/api/reference/user/update)
+ - Added zabbix_group_events_info module
+ - action module - Added notify_if_canceled property
+ - agent and proxy roles - Set default `zabbix_api_server_port` to 80 or 443
+ based on `zabbix_api_use_ssl`
+ - agent role - Removed duplicative Windows agent task
+ - agent role - Standardized default yum priority to 99
+ - all roles - Re-added ability to override Debian repo source
+ - all roles - Updated Debian repository format to 822 standard
+ - various - updated testing modules
+ - various - updated to fully qualified module names
+ - zabbix agent - Added capability to add additional configuration includes
+ - zabbix_api_info module added
+ - zabbix_user module - add current_passwd optional parameter to enable password
+ updating of the currently logged in user (https://www.zabbix.com/documentation/6.4/en/manual/api/reference/user/update)
fragments:
- - 1058-zabbix_template_corner_case.yml
- - 1081_fqmn.yml
- - 733-zabbix-api_info.yml
- - 921-action_notify_if_cancled.yml
- - additional_includes.yml
- - api-port.yml
- - current_passwd_user_module.yml
- - deb822.yml
- - duplicate-windows-agent.yml
- - module_group_events_info.yml
- - web_role_vars_fix.yml
- - yum-priority.yml
- release_date: '2023-10-06'
+ - 1058-zabbix_template_corner_case.yml
+ - 1081_fqmn.yml
+ - 733-zabbix-api_info.yml
+ - 921-action_notify_if_cancled.yml
+ - additional_includes.yml
+ - api-port.yml
+ - current_passwd_user_module.yml
+ - deb822.yml
+ - duplicate-windows-agent.yml
+ - module_group_events_info.yml
+ - web_role_vars_fix.yml
+ - yum-priority.yml
+ release_date: "2023-10-06"
2.3.0:
changes:
bugfixes:
- - api module - Fixed certificiate errors
- - proxy and server roles - Defaulted location of fping and fping6 based on OS.
- - proxy role - Removed requirement for mysql group definition.
- - server role - typo in configuration var StasAllowedIP to StatsAllowedIP
- - zabbix-{agent, javagateway, proxy, server, web} - support raspberry pi without
- repository url specification
+ - api module - Fixed certificiate errors
+ - proxy and server roles - Defaulted location of fping and fping6 based on OS.
+ - proxy role - Removed requirement for mysql group definition.
+ - server role - typo in configuration var StasAllowedIP to StatsAllowedIP
+ - zabbix-{agent, javagateway, proxy, server, web} - support raspberry pi without
+ repository url specification
minor_changes:
- - api_requests - Handled error from depricated CertificateError class
- - multiple roles - Removed unneeded Apt Clean commands.
- - proxy role - Updated MariaDB version for Centos 7 to 10.11
- - zabbix web - Allowed the independent configuration of php-fpm without creating
- vhost.
- - zabbix_host_info - added ability to get all the hosts configured in Zabbix
- - zabbix_proxy role - Add variable zabbix_proxy_dbpassword_hash_method to control
- whether you want postgresql user password to be hashed with md5 or want to
- use db default. When zabbix_proxy_dbpassword_hash_method is set to anything
- other than md5 then do not hash the password with md5 so you could use postgresql
- scram-sha-256 hashing method.
- - zabbix_server role - Add variable zabbix_server_dbpassword_hash_method to
- control whether you want postgresql user password to be hashed with md5 or
- want to use db default. When zabbix_server_dbpassword_hash_method is set to
- anything other than md5 then do not hash the password with md5 so you could
- use postgresql scram-sha-256 hashing method.
- - zabbix_templategroup module added
+ - api_requests - Handled error from depricated CertificateError class
+ - multiple roles - Removed unneeded Apt Clean commands.
+ - proxy role - Updated MariaDB version for Centos 7 to 10.11
+ - zabbix web - Allowed the independent configuration of php-fpm without creating
+ vhost.
+ - zabbix_host_info - added ability to get all the hosts configured in Zabbix
+ - zabbix_proxy role - Add variable zabbix_proxy_dbpassword_hash_method to control
+ whether you want postgresql user password to be hashed with md5 or want to
+ use db default. When zabbix_proxy_dbpassword_hash_method is set to anything
+ other than md5 then do not hash the password with md5 so you could use postgresql
+ scram-sha-256 hashing method.
+ - zabbix_server role - Add variable zabbix_server_dbpassword_hash_method to
+ control whether you want postgresql user password to be hashed with md5 or
+ want to use db default. When zabbix_server_dbpassword_hash_method is set to
+ anything other than md5 then do not hash the password with md5 so you could
+ use postgresql scram-sha-256 hashing method.
+ - zabbix_templategroup module added
fragments:
- - 1134.yml
- - 1136.yml
- - 1142.yml
- - fping.yml
- - host_info_all_hosts.yml
- - php_fpm_config.yml
- - pr_1104.yml
- - pr_647.yml
- - proxy_mysql.yml
- - pymysql.yml
- - raspberrypi.yml
- release_date: '2024-01-02'
+ - 1134.yml
+ - 1136.yml
+ - 1142.yml
+ - fping.yml
+ - host_info_all_hosts.yml
+ - php_fpm_config.yml
+ - pr_1104.yml
+ - pr_647.yml
+ - proxy_mysql.yml
+ - pymysql.yml
+ - raspberrypi.yml
+ release_date: "2024-01-02"
2.3.1:
changes:
bugfixes:
- - Avoid to update user-directory configuration in dry run.
+ - Avoid to update user-directory configuration in dry run.
fragments:
- - 1156-bugfix_zabbix_user_directory_dryrun.yml
- release_date: '2024-01-10'
+ - 1156-bugfix_zabbix_user_directory_dryrun.yml
+ release_date: "2024-01-10"
2.4.0:
changes:
bugfixes:
- - zabbix_agent - Fixed IPMI authentication algorithm default setting
- - zabbix_agent - Fixed issue to where scripts can be deployed alongside userparameters
- - zabbix_host - Don't reset IPMI setting when update inventory data of a host
- - zabbix_host - Finish task with failed if host_group parameter is empty list
- - zabbix_server - proper indentaion of become in selinux.yaml
- - zabbix_web - Added missing semicolon to nginx vhost template.
- - zabbix_web role, Add missing selinux.yml tasks.
+ - zabbix_agent - Fixed IPMI authentication algorithm default setting
+ - zabbix_agent - Fixed issue to where scripts can be deployed alongside userparameters
+ - zabbix_host - Don't reset IPMI setting when update inventory data of a host
+ - zabbix_host - Finish task with failed if host_group parameter is empty list
+ - zabbix_server - proper indentaion of become in selinux.yaml
+ - zabbix_web - Added missing semicolon to nginx vhost template.
+ - zabbix_web role, Add missing selinux.yml tasks.
minor_changes:
- - Add slash at the end of the location directives, to prevent path traversal
- attacks.
- - Added active_since and active_till in zabbix_maintenance
- - Added content_type for email in zabbix_mediatypes
- - Introduce flag `enable_version_check` to allow installations on non-supported
- platforms.
- - agent, javagateway, proxy, server, and web role - added the http_proxy and
- https_proxy environment variables to "Debian | Download gpg key" analog to
- other tasks
- - agent, javagateway, proxy, server, and web role - introduced default variable
- zabbix_repo_deb_gpg_key_url with value http://repo.zabbix.com/zabbix-official-repo.key
- - agent, javagateway, proxy, server, and web role - introduced default variable
- zabbix_repo_deb_include_deb_src with value true
- - agent, javagateway, proxy, server, and web role - removed superfluous slash
- in zabbix_gpg_key of the Debian vars and renamed key to zabbix-repo instead
- of zabbix-official-repo
- - agent, javagateway, proxy, server, and web role - used variable zabbix_repo_deb_include_deb_src
- in "Debian | Installing repository" to determine whether deb-src should be
- added to /etc/apt/sources.list.d/zabbix.sources
- - agent, javagateway, proxy, server, and web role - used zabbix_repo_deb_gpg_key_url
- in "Debian | Download gpg key" instead of hardcoded url
- - zabbix_correlation module added
- - zabbix_service_info module added
- - zabbix_template - Add template_yaml parameter.
- - zabbix_web role, Refactored zabbix_selinux variable names to correlate with
- selinux boolean names.
+ - Add slash at the end of the location directives, to prevent path traversal
+ attacks.
+ - Added active_since and active_till in zabbix_maintenance
+ - Added content_type for email in zabbix_mediatypes
+ - Introduce flag `enable_version_check` to allow installations on non-supported
+ platforms.
+ - agent, javagateway, proxy, server, and web role - added the http_proxy and
+ https_proxy environment variables to "Debian | Download gpg key" analog to
+ other tasks
+ - agent, javagateway, proxy, server, and web role - introduced default variable
+ zabbix_repo_deb_gpg_key_url with value http://repo.zabbix.com/zabbix-official-repo.key
+ - agent, javagateway, proxy, server, and web role - introduced default variable
+ zabbix_repo_deb_include_deb_src with value true
+ - agent, javagateway, proxy, server, and web role - removed superfluous slash
+ in zabbix_gpg_key of the Debian vars and renamed key to zabbix-repo instead
+ of zabbix-official-repo
+ - agent, javagateway, proxy, server, and web role - used variable zabbix_repo_deb_include_deb_src
+ in "Debian | Installing repository" to determine whether deb-src should be
+ added to /etc/apt/sources.list.d/zabbix.sources
+ - agent, javagateway, proxy, server, and web role - used zabbix_repo_deb_gpg_key_url
+ in "Debian | Download gpg key" instead of hardcoded url
+ - zabbix_correlation module added
+ - zabbix_service_info module added
+ - zabbix_template - Add template_yaml parameter.
+ - zabbix_web role, Refactored zabbix_selinux variable names to correlate with
+ selinux boolean names.
fragments:
- - 1157-add_template_yaml.yml
- - 1162-do_not_update_ipmi_options.yml
- - 1165-indent-become.yml
- - 1168-finish-task-with-failed-if-host_group-parameter-is-empty_list.yml
- - 1169-add_zabbix_correlation.yml
- - 1176-content_type-in-mediatype.yml
- - 1180-active_since-in-maintenance.yml
- - 1183-nginx-fix-against-path-traversal.yml
- - 1186-custom_gpg_key_url.yml
- - 1188-agent_ipmi_authtype_fix.yml
- - 1205-fix-zabbix-agent-scripts.yml
- - 1206-fix-nginx-template-ssl-params.yml
- - 1210-add_zabbix_service_info.yml
- - 1220-refactor_selinux_tasks_and_variable_names_role_zabbix_web.yml
- - 1224-enable-version-check.yml
+ - 1157-add_template_yaml.yml
+ - 1162-do_not_update_ipmi_options.yml
+ - 1165-indent-become.yml
+ - 1168-finish-task-with-failed-if-host_group-parameter-is-empty_list.yml
+ - 1169-add_zabbix_correlation.yml
+ - 1176-content_type-in-mediatype.yml
+ - 1180-active_since-in-maintenance.yml
+ - 1183-nginx-fix-against-path-traversal.yml
+ - 1186-custom_gpg_key_url.yml
+ - 1188-agent_ipmi_authtype_fix.yml
+ - 1205-fix-zabbix-agent-scripts.yml
+ - 1206-fix-nginx-template-ssl-params.yml
+ - 1210-add_zabbix_service_info.yml
+ - 1220-refactor_selinux_tasks_and_variable_names_role_zabbix_web.yml
+ - 1224-enable-version-check.yml
modules:
- - description: Create/update/delete Zabbix correlation
- name: zabbix_correlation
- namespace: ''
- release_date: '2024-05-13'
+ - description: Create/update/delete Zabbix correlation
+ name: zabbix_correlation
+ namespace: ""
+ release_date: "2024-05-13"
+ 2.5.0:
+ changes:
+ bugfixes:
+ - zabbix_web - make the FPM socket group-writable so the web server can properly
+ forward requests to the FPM process
+ minor_changes:
+ - agent role - Standardized all configuration variables using the `zabbix_agent`
+ prefix vs `zabbix_agent2`. Support for `zabbix_agent2` to be removed in 3.0.0
+ - agent role - Standardized templating of agent.conf file
+ - all roles - Added support for Ubuntu 24.04 (Noble Numbat)
+ - zabbix_discoveryrule module added
+ - zabbix_host_events_update module added
+ - zabbix_item - add support for setting master items by name
+ - zabbix_item module added
+ - zabbix_itemprototype - add support for setting master items by name
+ - zabbix_itemprototype module added
+ - zabbix_trigger module added
+ - zabbix_triggerprototype module added
+ fragments:
+ - 1221-add_support_for_ubuntu_24.04.yml
+ - 1227-fpm-socket-permissions.yml
+ - agent.yml
+ - pr_1222.yml
+ - pr_1234.yml
+ - pr_1238.yml
+ release_date: "2024-05-30"
+ 2.5.1:
+ changes:
+ bugfixes:
+ - zabbix_agent - Fix reading existing psk
+ - zabbix_agent - Fix role when zabbix_agent_listenip is undefined
+ fragments:
+ - pr_1245.yml
+ - pr_1246.yml
+ release_date: "2024-05-30"
diff --git a/ansible_collections/community/zabbix/docs/ZABBIX_AGENT_ROLE.md b/ansible_collections/community/zabbix/docs/ZABBIX_AGENT_ROLE.md
index fe4a601b3..f9a2fb5a5 100644
--- a/ansible_collections/community/zabbix/docs/ZABBIX_AGENT_ROLE.md
+++ b/ansible_collections/community/zabbix/docs/ZABBIX_AGENT_ROLE.md
@@ -28,7 +28,6 @@
* [proxy](#proxy)
- [Dependencies](#dependencies)
- [Example Playbook](#example-playbook)
- * [zabbix_agent2_plugins](#zabbix-agent2-plugins)
* [agent_interfaces](#agent-interfaces)
* [Other interfaces](#other-interfaces)
* [Vars in role configuration](#vars-in-role-configuration)
@@ -95,6 +94,7 @@ See the following list of supported Operating systems with the Zabbix releases:
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Red Hat Fam 7 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | V | V | V |
@@ -104,24 +104,6 @@ See the following list of supported Operating systems with the Zabbix releases:
You can bypass this matrix by setting `enable_version_check: false`
-# Getting started
-
-## Minimal Configuration
-
-In order to get the Zabbix Agent running, you'll have to define the following properties before executing the role:
-
-* `zabbix_agent_version`
-* `zabbix_agent(2)_server`
-* `zabbix_agent(2)_serveractive` (When using active checks)
-
-The `zabbix_agent_version` is optional. The latest available major.minor version of Zabbix will be installed on the host(s). If you want to use an older version, please specify this in the major.minor format. Example: `zabbix_agent_version: 6.0`.
-
-The `zabbix_agent(2)_server` (and `zabbix_agent(2)_serveractive`) should contain the ip or fqdn of the host running the Zabbix Server.
-
-## Issues
-
-Due to issue discussed on [#291](https://github.com/dj-wasabi/ansible-zabbix-agent/issues/291), the Ansible Version 2.9.{0,1,2} isn't working correctly on Windows related targets.
-
# Role Variables
## Main variables
@@ -133,114 +115,66 @@ The following is an overview of all available configuration default for this rol
* `zabbix_agent_version`: This is the version of zabbix. Default: The highest supported version for the operating system. Can be overridden to 6.4, 6.2, or 6.0
* `zabbix_agent_version_minor`: When you want to specify a minor version to be installed. Is also used for `zabbix_sender` and `zabbix_get`. RedHat only. Default set to: `*` (latest available)
* `zabbix_repo_yum`: A list with Yum repository configuration.
+* `zabbix_repo_yum_gpgcheck`: If Yum should check GPG keys on installation
* `zabbix_repo_yum_schema`: Default: `https`. Option to change the web schema for the yum repository(http/https)
* `zabbix_agent_disable_repo`: A list of repos to disable during install. Default `epel`.
* `zabbix_repo_deb_url`: The URL to the Zabbix repository. Default `http://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/{{ ansible_distribution.lower() }}`
* `zabbix_repo_deb_component`: The repository component for Debian installs. Default `main`.
-* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key`.
+* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key.
* `zabbix_repo_deb_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default `true`.
### SElinux
* `zabbix_selinux`: Default: `False`. Enables an SELinux policy so that the server will run.
+* `selinux_allow_zabbix_run_sudo`: Default: `False`. Enable Zabbix root access on system.
### Zabbix Agent
-* `zabbix_agent_ip`: The IP address of the host. When not provided, it will be determined via the `ansible_default_ipv4` fact.
* `zabbix_agent2`: Default: `False`. When you want to install the `Zabbix Agent2` instead of the "old" `Zabbix Agent`.zabbix_agent_version
+* `zabbix_agent_apt_priority`: Add a weight (`Pin-Priority`) for the APT repository.
+* `zabbix_agent_chassis`: Default: `false`. When set to `true`, it will give Zabbix Agent access to the Linux DMI table allowing system.hw.chassis info to populate.
+* `zabbix_agent_conf_mode`: Default: `0644`. The "mode" for the Zabbix configuration file.
+* `zabbix_agent_dont_detect_ip`: Default `false`. When set to `true`, it won't detect available ip addresses on the host and no need for the Python module `netaddr` to be installed.
+* `zabbix_agent_get_package`: The name of the zabbix-get package. Default: `zabbix-get`.
+* `zabbix_agent_include_mode`: The mode for the directory mentioned above.
+* `zabbix_agent_install_agent_only`: Only install the Zabbix Agent and not the `zabbix-sender` and `zabbix-get` packages. Default: `False`
* `zabbix_agent_listeninterface`: Interface zabbix-agent listens on. Leave blank for all.
* `zabbix_agent_package_remove`: If `zabbix_agent2: True` and you want to remove the old installation. Default: `False`.
-* `zabbix_agent_package`: The name of the zabbix-agent package. Default: `zabbix-agent`. In case for EPEL, it is automatically renamed.
-* `zabbix_sender_package`: The name of the zabbix-sender package. Default: `zabbix-sender`. In case for EPEL, it is automatically renamed.
-* `zabbix_get_package`: The name of the zabbix-get package. Default: `zabbix-get`. In case for EPEL, it is automatically renamed.
-* `zabbix_agent_package_state`: If Zabbix-agent needs to be `present` or `latest`.
-* `zabbix_agent_interfaces`: A list that configured the interfaces you can use when configuring via API.
-* `zabbix_agent_install_agent_only`: Only install the Zabbix Agent and not the `zabbix-sender` and `zabbix-get` packages. Default: `False`
+* `zabbix_agent_package_state`: If Zabbix-agent needs to be `present` (default) or `latest`.
+* `zabbix_agent_package`: The name of the zabbix-agent package. Default: `zabbix-agent` if `zabbix_agent2` is fale and `zabbix-agent2` if `true`.
+* `zabbix_agent_sender_package`: The name of the zabbix-sender package. Default: `zabbix-sender`.
* `zabbix_agent_userparameters`: Default: `[]]`. List of userparameter names and scripts (if any). Detailed description is given in the [Deploying Userparameters](#deploying-userparameters) section.
- * `name`: Userparameter name (should be the same with userparameter template file name)
- * `scripts_dir`: Directory name of the custom scripts needed for userparameters
-* `zabbix_agent_userparameters_templates_src`: indicates the relative path (from `templates/`) where userparameter templates are searched
+ * `name`: Userparameter name (should be the same with userparameter template file name)
+ * `scripts_dir`: Directory name of the custom scripts needed for userparameters
* `zabbix_agent_userparameters_scripts_src`: indicates the relative path (from `files/`) where userparameter scripts are searched
-* `zabbix_agent_runas_user`: Drop privileges to a specific, existing user on the system. Only has effect if run as 'root' and AllowRoot is disabled.
-* `zabbix_agent_become_on_localhost`: Default: `True`. Set to `False` if you don't need to elevate privileges on localhost to install packages locally with pip.
-* `zabbix_agent_apt_priority`: Add a weight (`Pin-Priority`) for the APT repository.
-* `zabbix_agent_conf_mode`: Default: `0644`. The "mode" for the Zabbix configuration file.
-* `zabbix_agent_dont_detect_ip`: Default `false`. When set to `true`, it won't detect available ip addresses on the host and no need for the Python module `netaddr` to be installed.
-* `zabbix_agent_chassis`: Default: `false`. When set to `true`, it will give Zabbix Agent access to the Linux DMI table allowing system.hw.chassis info to populate.
-
-### Zabbix Agent vs Zabbix Agent 2 configuration
-
-The following provides an overview of all the properties that can be set in the Zabbix Agent configuration file. When `(2)` is used in the name of the property, like `zabbix_agent(2)_pidfile`, it will show that you can configure `zabbix_agent_pidfile` for the Zabbix Agent configuration file and `zabbix_agent2_pidfile` for the Zabbix Agent 2 configuration file.
-
-Otherwise it just for the Zabbix Agent or for the Zabbix Agent 2.
-
-* `zabbix_agent(2)_server`: The ip address for the zabbix-server or zabbix-proxy.
-* `zabbix_agent(2)_serveractive`: The ip address for the zabbix-server or zabbix-proxy for active checks.
-* `zabbix_agent(2)_allow_key`: list of AllowKey configurations.
-* `zabbix_agent(2)_deny_key`: list of DenyKey configurations.
-* `zabbix_agent(2)_pidfile`: name of pid file.
-* `zabbix_agent(2)_logfile`: name of log file.
-* `zabbix_agent(2)_logfilesize`: maximum size of log file in mb.
-* `zabbix_agent(2)_additional_include`: A list of additional complete paths to include in configuration
-* `zabbix_agent(2)_logtype`: Specifies where log messages are written to
-* `zabbix_agent(2)_debuglevel`: specifies debug level
-* `zabbix_agent(2)_sourceip`: source ip address for outgoing connections.
-* `zabbix_agent_enableremotecommands`: whether remote commands from zabbix server are allowed.
-* `zabbix_agent_logremotecommands`: enable logging of executed shell commands as warnings.
-* `zabbix_agent(2)_listenport`: agent will listen on this port for connections from the server.
-* `zabbix_agent2_statusport`: Agent will listen on this port for HTTP status requests.
-* `zabbix_agent(2)_listenip`: list of comma delimited ip addresses that the agent should listen on.
-* `zabbix_agent_startagents`: number of pre-forked instances of zabbix_agentd that process passive checks.
-* `zabbix_agent(2)_hostname`: unique, case sensitive hostname.
-* `zabbix_agent(2)_hostnameitem`: item used for generating hostname if it is undefined.
-* `zabbix_agent(2)_hostmetadata`: optional parameter that defines host metadata.
-* `zabbix_agent(2)_hostmetadataitem`: optional parameter that defines an item used for getting the metadata.
-* `zabbix_agent(2)_refreshactivechecks`: how often list of active checks is refreshed, in seconds.
-* `zabbix_agent(2)_buffersend`: do not keep data longer than n seconds in buffer.
-* `zabbix_agent(2)_buffersize`: maximum number of values in a memory buffer. the agent will send all collected data to zabbix server or proxy if the buffer is full.
-* `zabbix_agent2_enablepersistentbuffer`: 0 - disabled, in-memory buffer is used (default); 1 - use persistent buffer
-* `zabbix_agent2_persistentbufferperiod`: Zabbix Agent2 will keep data for this time period in case of no connectivity with Zabbix server or proxy. Older data will be lost. Log data will be preserved.
-* `zabbix_agent2_persistentbufferfile`: Zabbix Agent2 will keep SQLite database in this file * n is valid if `EnablePersistentBuffer=1`
-* `zabbix_agent_maxlinespersecond`: maximum number of new lines the agent will send per second to zabbix server or proxy processing 'log' and 'logrt' active checks.
-* `zabbix_agent_allowroot`: allow the agent to run as 'root'. if disabled and the agent is started by 'root', the agent will try to switch to user 'zabbix' instead. has no effect if started under a regular user.
-* `zabbix_agent(2)_zabbix_alias`: sets an alias for parameter. it can be useful to substitute long and complex parameter name with a smaller and simpler one. Can be both a string as an list.
-* `zabbix_agent(2)_timeout`: spend no more than timeout seconds on processing
-* `zabbix_agent(2)_include`: you may include individual files or all files in a directory in the configuration file.
-* `zabbix_agent(2)_include_pattern`: Optional file pattern used for included files.
-* `zabbix_agent(2)_include_mode`: The mode for the directory mentioned above.
-* `zabbix_agent(2)_unsafeuserparameters`: allow all characters to be passed in arguments to user-defined parameters.
-* `zabbix_agent_loadmodulepath`: Full path to location of agent modules.
-* `zabbix_agent_loadmodule`: Module to load at agent startup. Modules are used to extend functionality of the agent.
-* `zabbix_agent2_controlsocket`: The control socket, used to send runtime commands with '-R' option.
-* `zabbix_agent_allowroot`: Allow the agent to run as 'root'. 0 - do not allow, 1 - allow
-* `zabbix_agent2_plugins`: A list containing plugin configuration.
-* `zabbix_agent(2)_listenbacklog`: The maximum number of pending connections in the queue.
+* `zabbix_agent_userparameters_templates_src`: indicates the relative path (from `templates/`) where userparameter templates are searched
## TLS Specific configuration
+* `zabbix_agent_tlspsk_auto`: Enables auto generation and storing of individual pre-shared keys and identities on clients. Is false by default. If set to true and if `zabbix_agent_tlspskfile` and `zabbix_agent_tlspsk_secret` are undefined, it generates the files `/etc/zabbix/tls_psk_auto.identity` and `/etc/zabbix/tls_psk_auto.secret`, which are populated by values automatically (identity is set to hostname, underscore and 4 random alphanumeric digits; secret is 64 random alphanumeric digits) in such a way that the values are generated once and are never overwritten.
-These variables are specific for Zabbix 3.0 and higher. When `(2)` is used in the name of the property, like `zabbix_agent(2)_tlsconnect`, it will show that you can configure `zabbix_agent_tlsconnect` for the Zabbix Agent configuration file and `zabbix_agent2_tlsconnect` for the Zabbix Agent 2 configuration file.
-
-* `zabbix_agent(2)_tlsconnect`: How the agent should connect to server or proxy. Used for active checks.
+* `zabbix_agent_tlsconnect`: How the agent should connect to server or proxy. Used for active checks.
Possible values:
* unencrypted
* psk
* cert
-* `zabbix_agent(2)_tlsaccept`: What incoming connections to accept.
+* `zabbix_agent_tlsaccept`: What incoming connections to accept.
Possible values:
* unencrypted
* psk
* cert
-* `zabbix_agent(2)_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification.
-* `zabbix_agent(2)_tlscrlfile`: Full pathname of a file containing revoked certificates.
-* `zabbix_agent(2)_tlsservercertissuer`: Allowed server certificate issuer.
-* `zabbix_agent(2)_tlsservercertsubject`: Allowed server certificate subject.
-* `zabbix_agent(2)_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain.
-* `zabbix_agent(2)_tlskeyfile`: Full pathname of a file containing the agent private key.
-* `zabbix_agent(2)_tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key.
-* `zabbix_agent(2)_tlspskidentity_file`: Full pathname of a file containing the pre-shared key identity.
-* `zabbix_agent(2)_tlspskfile`: Full pathname of a file containing the pre-shared key.
-* `zabbix_agent(2)_tlspsk_secret`: The pre-shared secret key that should be placed in the file configured with `agent_tlspskfile`.
-* `zabbix_agent(2)_tlspsk_auto`: Enables auto generation and storing of individual pre-shared keys and identities on clients. Is false by default. If set to true and if `zabbix_agent_tlspskfile` and `zabbix_agent_tlspsk_secret` are undefined, it generates the files `/etc/zabbix/tls_psk_auto.identity` and `/etc/zabbix/tls_psk_auto.secret`, which are populated by values automatically (identity is set to hostname, underscore and 4 random alphanumeric digits; secret is 64 random alphanumeric digits) in such a way that the values are generated once and are never overwritten.
+
+* `zabbix_agent_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification.
+* `zabbix_agent_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain.
+* `zabbix_agent_tlscrlfile`: Full pathname of a file containing revoked certificates.
+* `zabbix_agent_tlskeyfile`: Full pathname of a file containing the agent private key.
+* `zabbix_agent_tlspskfile`: Full pathname of a file containing the pre-shared key.
+* `zabbix_agent_tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key.
+* `zabbix_agent_tlspskidentity_file`: Full pathname of a file containing the pre-shared key identity.
+* `zabbix_agent_tlspsk_secret`: The pre-shared secret key for the agent.
+* `zabbix_agent_tlsservercertissuer`: Allowed server certificate issuer.
+* `zabbix_agent_tlsservercertsubject`: Allowed server certificate subject.
+* `zabbix_agent_tls_subject`: The subject of the TLS certificate.
+* `zabbix_agent_visible_hostname` : Configure Zabbix visible name inside Zabbix web UI for the node.
The results are stored in the Ansible variables `zabbix_agent_tlspskidentity` and `zabbix_agent_tlspsk_secret`, so that they may be used later in the code, for example with [zabbix_host](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html) to configure the Zabbix server or with `debug: msg:` to display them to the user.
@@ -250,51 +184,49 @@ These variables need to be overridden when you want to make use of the Zabbix AP
Host encryption configuration will be set to match agent configuration.
-* `zabbix_api_server_host`: The IP or hostname/FQDN of Zabbix server. Example: zabbix.example.com
-* `zabbix_api_use_ssl`: Is SSL required to connect to the Zabbix API server? Default: `false`
-* `zabbix_api_server_port`: 80 if `zabbix_api_use_ssl` is `false` and 443 if `true` (Default) TCP port to use to connect to Zabbix server. Example: 8080
-* `zabbix_api_login_user`: Username of user which has API access.
-* `zabbix_api_login_pass`: Password for the user which has API access.
-* `zabbix_api_http_user`: The http user to access zabbix url with Basic Auth (if your Zabbix is behind a proxy with HTTP Basic Auth).
-* `zabbix_api_http_password`: The http password to access zabbix url with Basic Auth (if your Zabbix is behind a proxy with HTTP Basic Auth).
-* `zabbix_api_validate_certs`: yes (Default) if we need to validate tls certificates of the API. Use `no` in case self-signed certificates are used.
-* `zabbix_api_timeout`: How many seconds to wait for API response (default 30s).
-* `zabbix_api_create_hosts`: Default: `False`. When you want to enable the Zabbix API to create/delete the host. This has to be set to `True` if you want to make use of `zabbix_agent_host_state`.
-* `zabbix_api_create_hostgroup`: When you want to enable the Zabbix API to create/delete the hostgroups. This has to be set to `True` if you want to make use of `zabbix_agent_hostgroups_state`.Default: `False`
-* `ansible_zabbix_url_path`: URL path if Zabbix WebUI running on non-default (zabbix) path, e.g. if http://<FQDN>/zabbixeu then set to `zabbixeu`
-* `zabbix_agent_hostgroups_state`: present (Default) if the hostgroup needs to be created or absent if you want to delete it. This only works when `zabbix_api_create_hostgroup` is set to `True`.
-* `zabbix_host_status`: enabled (Default) when host in monitored, disabled when host is disabled for monitoring.
+* `zabbix_agent_description`: Description of the host in Zabbix.
* `zabbix_agent_host_state`: present (Default) if the host needs to be created or absent is you want to delete it. This only works when `zabbix_api_create_hosts` is set to `True`.
* `zabbix_agent_host_update`: yes (Default) if the host should be updated if already present. This only works when `zabbix_api_create_hosts` is set to `True`.
-* `zabbix_useuip`: 1 if connection to zabbix-agent is made via ip, 0 for fqdn.
-* `zabbix_host_groups`: A list of hostgroups which this host belongs to.
-* `zabbix_agent_link_templates`: A list of templates which needs to be link to this host. The templates should exist.
+* `zabbix_agent_interfaces`: A list of interfaces and their configurations you can use when configuring via API.
+* `zabbix_agent_inventory_mode`: Configure Zabbix inventory mode. Needed for building inventory data, manually when configuring a host or automatically by using some automatic population options. This has to be set to `automatic` if you want to make automatically building inventory data. Default `disabled`
+* `zabbix_agent_inventory_zabbix`: Adds Facts for a zabbix inventory. Default `{}`
+* `zabbix_agent_ip`: The IP address of the host. When not provided, it will be determined via the `ansible_default_ipv4` fact.
+* `zabbix_agent_link_templates`: A list of templates which needs to be link to this host. The templates should exist. Default: "Templated Linux by Zabbix agent"
* `zabbix_agent_macros`: A list with macro_key and macro_value for creating hostmacro's.
+* `zabbix_agent_proxy`: The name of the Zabbix proxy (if used). Default `null`
* `zabbix_agent_tags`: A list with tag and (optionally) value for creating host tags.
-* `zabbix_agent_inventory_mode`: Configure Zabbix inventory mode. Needed for building inventory data, manually when configuring a host or automatically by using some automatic population options. This has to be set to `automatic` if you want to make automatically building inventory data.
-* `zabbix_agent_visible_hostname` : Configure Zabbix visible name inside Zabbix web UI for the node.
-* `zabbix_agent_description`: Description of the host in Zabbix.
-* `zabbix_agent_inventory_zabbix`: Adds Facts for a zabbix inventory
+* `zabbix_api_create_hostgroup`: When you want to enable the Zabbix API to create/delete the hostgroups. Default: `False`
+* `zabbix_api_create_hosts`: Default: `False`. When you want to enable the Zabbix API to create/delete the host. This has to be set to `True` if you want to make use of `zabbix_agent_host_state`.
+* `zabbix_api_http_password`: The http password to access zabbix url with Basic Auth (if your Zabbix is behind a proxy with HTTP Basic Auth).
+* `zabbix_api_http_user`: The http user to access zabbix url with Basic Auth (if your Zabbix is behind a proxy with HTTP Basic Auth).
+* `zabbix_api_login_pass`: Password for the user which has API access.
+* `zabbix_api_login_user`: Username of user which has API access.
+* `zabbix_api_server_host`: The IP or hostname/FQDN of Zabbix server. Example: zabbix.example.com
+* `zabbix_api_server_port`: 80 if `zabbix_api_use_ssl` is `false` and 443 if `true` (Default) TCP port to use to connect to Zabbix server. Example: 8080
+* `zabbix_api_use_ssl`: Is SSL required to connect to the Zabbix API server? Default: `false`
+* `zabbix_api_validate_certs`: `True` if we need to validate tls certificates of the API. Use `False` in case self-signed certificates are used. Default: `False`
+* `zabbix_host_groups`: A list of hostgroups which this host belongs to. Default: "Linux Servers"
+* `zabbix_host_status`: enabled (Default) when host in monitored, disabled when host is disabled for monitoring.
+* `zabbix_useuip`: 1 if connection to zabbix-agent is made via ip, 0 for fqdn.
## Windows Variables
**NOTE**
-_Supporting Windows is a best effort (We don't have the possibility to either test/verify changes on the various amount of available Windows instances). PRs specific to Windows will almost immediately be merged, unless someone is able to provide a Windows test mechanism via Travis for Pull Requests._
-When `(2)` is used in the name of the property, like `zabbix_agent(2)_win_logfile`, it will show that you can configure `zabbix_agent_win_logfile` for the Zabbix Agent configuration file and `zabbix_agent2_win_logfile` for the Zabbix Agent 2 configuration file.
+Supporting Windows is a best effort (We don't have the possibility to either test/verify changes on the various amount of available Windows instances). PRs specific to Windows will almost immediately be merged, unless someone is able to provide a Windows test mechanism via Travis for Pull Requests._
+When `` is used in the name of the property, like `zabbix_agent_win_logfile`, it will show that you can configure `zabbix_agent_win_logfile` for the Zabbix Agent configuration file and `zabbix_agent2_win_logfile` for the Zabbix Agent 2 configuration file.
Otherwise it just for the Zabbix Agent or for the Zabbix Agent 2.
-* `zabbix(2)_win_package`: file name pattern (zip only). This will be used to generate the `zabbix(2)_win_download_link` variable.
-* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix(2)_win_package` and `zabbix(2)_win_download_link` variables. This takes precedence over `zabbix_agent_version`.
-* `zabbix(2)_win_download_link`: The download url to the `win.zip` file.
+* `zabbix_agent_win_include`: The directory in which the Zabbix Agent specific configuration files are stored.
+* `zabbix_agent_win_logfile`: The full path to the logfile for the Zabbix Agent.
+* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_win_package` and `zabbix_win_download_link` variables. This takes precedence over `zabbix_agent_version`.
+* `zabbix_win_download_link`: The download url to the `win.zip` file.
+* `zabbix_win_firewall_management`: Enable Windows firewall management (add service and port to allow rules). Default: `True`
* `zabbix_win_install_dir`: The directory where Zabbix needs to be installed.
* `zabbix_win_install_dir_conf`: The directory where Zabbix configuration file needs to be installed.
* `zabbix_win_install_dir_bin`: The directory where Zabbix binary file needs to be installed.
-* `zabbix_agent(2)_win_logfile`: The full path to the logfile for the Zabbix Agent.
-* `zabbix_agent_win_include`: The directory in which the Zabbix Agent specific configuration files are stored.
-* `zabbix_agent_win_svc_recovery`: Enable Zabbix Agent service auto-recovery settings.
-* `zabbix_win_firewall_management`: Enable Windows firewall management (add service and port to allow rules). Default: `True`
+* `zabbix_win_package`: file name pattern (zip only). This will be used to generate the `zabbix_win_download_link` variable.
## macOS Variables
@@ -302,8 +234,10 @@ Otherwise it just for the Zabbix Agent or for the Zabbix Agent 2.
_Supporting Windows is a best effort (We don't have the possibility to either test/verify changes on the various amount of available Windows instances). PRs specific to Windows will almost immediately be merged, unless someone is able to provide a Windows test mechanism via Travis for Pull Requests._
-* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_mac_download_link` link.
* `zabbix_mac_download_link`: The download url to the `pkg` file.
+* `zabbix_mac_download_url`: The download url. Default `https://cdn.zabbix.com/zabbix/binaries/stable`
+* `zabbix_mac_package`: The name of the mac install package. Default `zabbix_agent-{{ zabbix_version_long }}-macos-amd64-openssl.pkg`
+* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_mac_download_link` link.
## Docker Variables
@@ -324,19 +258,19 @@ The following directories are mounted in the Container:
Keep in mind that using the Zabbix Agent in a Container requires changes to the Zabbix Template for Linux as `/proc`, `/sys` and `/etc` are mounted in a directory `/hostfs`.
* `zabbix_agent_docker`: Default: `False`. When set to `True`, it will install a Docker container on the target host instead of installation on the target.
-* `zabbix_agent_docker_state`: Default: `started`
-* `zabbix_agent_docker_name`: The name of the Container. Default: `zabbix-agent`
+* `zabbix_agent_docker_env`: A dict with all environment variables that needs to be set for the Container.
* `zabbix_agent_docker_image`: The name of the Docker image. Default: `zabbix/zabbix-agent`
* `zabbix_agent_docker_image_tag`: The tag of the Docker image.
-* `zabbix_agent_docker_user_gid`: The group id of the zabbix user in the Container.
-* `zabbix_agent_docker_user_uid`: The user id of the zabbix user in the Container.
+* `zabbix_agent_docker_name`: The name of the Container. Default: `zabbix-agent`
* `zabbix_agent_docker_network_mode`: The name of the (Docker) network that should be used for the Container. Default `host`.
* `zabbix_agent_docker_restart_policy`: Default: `unless-stopped`. The restart policy of the Container.
-* `zabbix_agent_docker_privileged`: When set to `True`, the container is running in privileged mode.
-* `zabbix_agent_docker_ports`: A list with `<PORT>:<PORT>` values to open ports to the container.
+* `zabbix_agent_docker_ports`: A list with `<PORT>:<PORT>` values to open ports to the container. Default `10050`
+* `zabbix_agent_docker_privileged`: When set to `True`, the container is running in privileged mode. Default `false`
* `zabbix_agent_docker_security_opts`: A list with available security options.
+* `zabbix_agent_docker_state`: Default: `started`
+* `zabbix_agent_docker_user_gid`: The group id of the zabbix user in the Container.
+* `zabbix_agent_docker_user_uid`: The user id of the zabbix user in the Container.
* `zabbix_agent_docker_volumes`: A list with all directories that needs to be available in the Container.
-* `zabbix_agent_docker_env`: A dict with all environment variables that needs to be set for the Container.
## IPMI variables
@@ -345,6 +279,77 @@ Keep in mind that using the Zabbix Agent in a Container requires changes to the
* `zabbix_agent_ipmi_privilege`: IPMI privilege level. Possible values are 1 (callback), 2 (user), 3 (operator), 4 (admin), 5 (OEM), with 2 being the API default.
* `zabbix_agent_ipmi_username`: IPMI username.
+## Configuration Variables
+The following table lists all variables that are exposed to modify the configuration of the zabbix_agent.conf file. Specific details of each variable can be found in the Zabbix documentation.
+
+**NOTE**: Only variables with a default value appear in the defaults file, all others must be added.
+
+| Zabbix Name | Variable Name | Default Value | Notes |
+|-----------|------------------|--------|--------|
+| Alias | zabbix_agent_aliases | | Can be a string or list |
+| AllowKey | zabbix_agent_allowkeys | | |
+| AllowRoot | zabbix_agent_allowroot | | Linux Systems Only |
+| BufferSend | zabbix_agent_buffersend | 5 | |
+| BufferSize | zabbix_agent_buffersize | 100 | |
+| ControlSocket | zabbix_agent_controlsocket | /tmp/agent.sock | Agent 2 Only |
+| DebugLevel | zabbix_agent_debuglevel | 3 | |
+| DenyKey | zabbix_agent_denykeys | | Can be a string or a list |
+| EnableRemoteCommands | zabbix_agent_enableremotecommands | 0 | Agent Only |
+| ForceActiveChecksOnStart | zabbix_agent_forceactivechecksonstart | | Agent 2 Only |
+| HeartbeatFrequency | zabbix_agent_heartbeatfrequency | 60 | Version >= 6.2 |
+| HostInterface | zabbix_agent_hostinterface | | |
+| HostInterfaceItem | zabbix_agent_hostinterfaceitem | | |
+| HostMetadata | zabbix_agent_hostmetadata | | |
+| HostMetadataItem | zabbix_agent_hostmetadataitem | | |
+| Hostname | zabbix_agent_hostname | | `{{ inventory_hostname }}` |
+| HostnameItem | zabbix_agent_hostnameitem | | |
+| Include | zabbix_agent_include | /etc/zabbix/`{ agent version specific }`.d | |
+| ListenBacklog | zabbix_agent_listenbacklog | | Agent Only |
+| ListenIP | zabbix_agent_listenip | | list of IPs |
+| ListenPort | zabbix_agent_listenport | 10050 | |
+| LoadModule | zabbix_agent_loadmodule | | Agent On Linux Only |
+| LoadModulePath | zabbix_agent_loadmodulepath | | Agent On Linux Only |
+| LogFile | zabbix_agent_logfile | /var/log/zabbix/`{ agent version specific }`.log | |
+| LogFileSize | zabbix_agent_logfilesize | 100 | |
+| LogRemoteCommands | zabbix_agent_logremotecommands | | Agent Only |
+| LogType | zabbix_agent_logtype | file | |
+| MaxLinesPerSecond | zabbix_agent_maxlinespersecond | | Agent Only |
+| PerfCounter | zabbix_agent_perfcounter | | Agent Only |
+| PerfCounterEn | zabbix_agent_perfcounteren | | Agent Only |
+| PersistentBufferFile | zabbix_agent_persistentbufferfile | | Agent 2 Only |
+| PersistentBufferPeriod | zabbix_agent_persistentbufferperiod | 1h | Agent 2 Only |
+| PidFile | zabbix_agent_pidfile | /var/run/zabbix/`{ agent version specific }`.pid | Linux Systems Only |
+| Plugin | zabbix_agent_plugins | | |
+| PluginSocket | zabbix_agent_pluginsocket | | |
+| PluginTimeout | zabbix_agent_plugintimeout | | |
+| RefreshActiveChecks | zabbix_agent_refreshactivechecks | 120 | |
+| Server | zabbix_agent_server | | |
+| ServerActive | zabbix_agent_serveractive | | |
+| SourceIP | zabbix_agent_sourceip | | |
+| StartAgents | zabbix_agent_startagents | | Agent Only |
+| StatusPort | zabbix_agent_statusport | 9999 | Agent 2 Only |
+| Timeout | zabbix_agent_timeout | 3 | |
+| TLSAccept | zabbix_agent_tlsconnect | | |
+| TLSCAFile | zabbix_agent_tlscafile | /etc/zabbix/tls_psk_auto.secret | |
+| TLSCertFile | zabbix_agent_tlscertfile | | |
+| TLSCipherAll | zabbix_agent_tlscipherall | | Agent on Linux Only |
+| TLSCipherAll13 | zabbix_agent_tlscipherall13 | | Agent on Linux Only |
+| TLSCipherCert | zabbix_agent_tlsciphercert | | Agent on Linux Only |
+| TLSCipherCert13 | zabbix_agent_tlsciphercert13 | | Agent on Linux Only |
+| TLSCipherPSK | zabbix_agent_tlscipherpsk | | Agent on Linux Only |
+| TLSCipherPSK13 | zabbix_agent_tlscipherpsk13 | | Agent on Linux Only |
+| TLSConnect | zabbix_agent_tlsconnect | | |
+| TLSCRLFile | zabbix_agent_tlscrlfile | | |
+| TLSKeyFile | zabbix_agent_tlskeyfile | | |
+| TLSPSKFile | zabbix_agent_tlspskfile | | |
+| TLSPSKIdentity | zabbix_agent_tlspskidentity | | |
+| TLSServerCertIssuer | zabbix_agent_tlsservercertissuer | | |
+| TLSServerCertSubject | zabbix_agent_tlsservercertsubject | | |
+| UnsafeUserParameters | zabbix_agent_unsafeuserparameters | | |
+| User | zabbix_agent_runas_user | | Agent on Linux Only |
+| UserParameter | zabbix_agent_userparamater | 0 | |
+
+
## proxy
When the target host does not have access to the internet, but you do have a proxy available then the following properties needs to be set to download the packages via the proxy:
@@ -369,18 +374,6 @@ There are no dependencies on other roles.
# Example Playbook
-## zabbix_agent2_plugins
-
-Specifically for the Zabbix Agent 2, a list of extra plugins can be configured. The following provides an overview of configuring the `SystemRun` plugin by setting the `LogRemoteCommands` to `0`:
-
-```yaml
-zabbix_agent2_plugins:
- - name: SystemRun
- options:
- - parameter: LogRemoteCommands
- value: 0
-```
-
In the `zabbix_agent2.conf` an entry will be created with the following content:
```
diff --git a/ansible_collections/community/zabbix/docs/ZABBIX_JAVAGATEWAY_ROLE.md b/ansible_collections/community/zabbix/docs/ZABBIX_JAVAGATEWAY_ROLE.md
index 47092a6a0..0de7af814 100644
--- a/ansible_collections/community/zabbix/docs/ZABBIX_JAVAGATEWAY_ROLE.md
+++ b/ansible_collections/community/zabbix/docs/ZABBIX_JAVAGATEWAY_ROLE.md
@@ -39,6 +39,7 @@ See the following list of supported Operating systems with the Zabbix releases.
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Red Hat Fam 7 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | V | V | V |
diff --git a/ansible_collections/community/zabbix/docs/ZABBIX_PROXY_ROLE.md b/ansible_collections/community/zabbix/docs/ZABBIX_PROXY_ROLE.md
index ee558c8b7..703ec6059 100644
--- a/ansible_collections/community/zabbix/docs/ZABBIX_PROXY_ROLE.md
+++ b/ansible_collections/community/zabbix/docs/ZABBIX_PROXY_ROLE.md
@@ -82,6 +82,7 @@ See the following list of supported Operating systems with the Zabbix releases.
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Red Hat Fam 7 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | V | V | V |
diff --git a/ansible_collections/community/zabbix/docs/ZABBIX_SERVER_ROLE.md b/ansible_collections/community/zabbix/docs/ZABBIX_SERVER_ROLE.md
index 9557281c3..20f462c48 100644
--- a/ansible_collections/community/zabbix/docs/ZABBIX_SERVER_ROLE.md
+++ b/ansible_collections/community/zabbix/docs/ZABBIX_SERVER_ROLE.md
@@ -79,6 +79,7 @@ See the following list of supported Operating systems with the Zabbix releases:
|---------------------|-----|-----|-----|
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | | | V |
diff --git a/ansible_collections/community/zabbix/docs/ZABBIX_WEB_ROLE.md b/ansible_collections/community/zabbix/docs/ZABBIX_WEB_ROLE.md
index aac6f9dc2..c1875f208 100644
--- a/ansible_collections/community/zabbix/docs/ZABBIX_WEB_ROLE.md
+++ b/ansible_collections/community/zabbix/docs/ZABBIX_WEB_ROLE.md
@@ -59,6 +59,7 @@ See the following list of supported Operating Systems with the Zabbix releases.
|---------------------|-----|-----|-----|
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | | | V |
diff --git a/ansible_collections/community/zabbix/molecule/requirements.txt b/ansible_collections/community/zabbix/molecule/requirements.txt
index 9ccb5e157..814a46a91 100644
--- a/ansible_collections/community/zabbix/molecule/requirements.txt
+++ b/ansible_collections/community/zabbix/molecule/requirements.txt
@@ -1,7 +1,7 @@
# Install CI dependencies for the Zabbix Roles
-ansible==7.0.0
+#ansible==8.0.0 # commented out to avoid installing collections in site-packages/ansible_collections
ansible-compat==3.0.0
-ansible-core==2.14.2
+ansible-core==2.15.11
docker==6.1.3
molecule<5
molecule-docker @ git+https://github.com/ansible-community/molecule-docker@main
diff --git a/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/common/molecule.yml b/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/common/molecule.yml
index a48b6ae60..4666f0192 100644
--- a/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/common/molecule.yml
+++ b/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/common/molecule.yml
@@ -28,8 +28,6 @@ provisioner:
inventory:
group_vars:
all:
- zabbix_agent_src_reinstall: false
- zabbix_install_pip_packages: false
zabbix_agent_server: 192.168.3.33
zabbix_agent_serveractive: 192.168.3.33
zabbix_agent_listenip: 0.0.0.0
diff --git a/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/molecule/agent2/molecule.yml b/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/molecule/agent2/molecule.yml
index 76edc902e..3d28d94c9 100644
--- a/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/molecule/agent2/molecule.yml
+++ b/ansible_collections/community/zabbix/molecule/zabbix_agent_tests/molecule/agent2/molecule.yml
@@ -9,6 +9,7 @@ provisioner:
zabbix_agent2: true
zabbix_agent2_tlsconnect: psk
zabbix_agent2_tlsaccept: psk
+ zabbix_agent2_tlspsk_auto: True
zabbix_agent2_tlspskidentity: my_Identity
zabbix_agent2_tlspskfile: /data/certs/zabbix.psk
zabbix_agent2_tlspsk_secret: 97defd6bd126d5ba7fa5f296595f82eac905d5eda270207a580ab7c0cb9e8eab
@@ -16,4 +17,4 @@ provisioner:
- name: SystemRun
options:
- parameter: LogRemoteCommands
- value: 0 \ No newline at end of file
+ value: 0
diff --git a/ansible_collections/community/zabbix/molecule/zabbix_proxy/Dockerfile.debian.j2 b/ansible_collections/community/zabbix/molecule/zabbix_proxy/Dockerfile.debian.j2
new file mode 100644
index 000000000..b3d90f2a5
--- /dev/null
+++ b/ansible_collections/community/zabbix/molecule/zabbix_proxy/Dockerfile.debian.j2
@@ -0,0 +1,3 @@
+FROM {{ item.base_image }}
+RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip systemd-sysv
+CMD ["/sbin/init"]
diff --git a/ansible_collections/community/zabbix/molecule/zabbix_proxy/Dockerfile.redhat.j2 b/ansible_collections/community/zabbix/molecule/zabbix_proxy/Dockerfile.redhat.j2
new file mode 100644
index 000000000..dd48ee3b7
--- /dev/null
+++ b/ansible_collections/community/zabbix/molecule/zabbix_proxy/Dockerfile.redhat.j2
@@ -0,0 +1,3 @@
+FROM {{ item.base_image }}
+RUN yum install -y python3-pip
+CMD ["/sbin/init"]
diff --git a/ansible_collections/community/zabbix/molecule/zabbix_proxy/molecule.yml b/ansible_collections/community/zabbix/molecule/zabbix_proxy/molecule.yml
index 4eadd60ab..0002a0a49 100644
--- a/ansible_collections/community/zabbix/molecule/zabbix_proxy/molecule.yml
+++ b/ansible_collections/community/zabbix/molecule/zabbix_proxy/molecule.yml
@@ -3,10 +3,11 @@ driver:
name: docker
platforms:
- name: zabbix-proxy-${MY_MOLECULE_VERSION:-v64}-${MY_MOLECULE_DATABASE:-mysql}-${MY_MOLECULE_CONTAINER:-rockylinux8}
- image: geerlingguy/docker-${MY_MOLECULE_IMAGE:-rockylinux8}-ansible:latest
+ dockerfile: Dockerfile.${MY_MOLECULE_OS_FAMILY:-redhat}.j2
+ base_image: ${MY_MOLECULE_IMAGE:-rockylinux/rockylinux:8-ubi-init}
+ image: ${MY_MOLECULE_CONTAINER:-rockylinux8}
privileged: true
- pre_build_image: true
- command: ${MOLECULE_DOCKER_COMMAND:-""}
+ command: /sbin/init
networks:
- name: zabbix
volumes:
@@ -22,10 +23,8 @@ provisioner:
ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles
inventory:
group_vars:
- python3:
+ all:
ansible_python_interpreter: /usr/bin/python3
- python:
- ansible_python_interpreter: /usr/bin/python
v64:
zabbix_proxy_version: 6.4
v62:
diff --git a/ansible_collections/community/zabbix/molecule/zabbix_proxy/prepare.yml b/ansible_collections/community/zabbix/molecule/zabbix_proxy/prepare.yml
index 1ff492d62..5a3c3139f 100644
--- a/ansible_collections/community/zabbix/molecule/zabbix_proxy/prepare.yml
+++ b/ansible_collections/community/zabbix/molecule/zabbix_proxy/prepare.yml
@@ -95,19 +95,3 @@
dest: /etc/sudoers
line: "Defaults !requiretty"
state: present
-
- - name: "Make sure the docs can be installed. (RedHat)"
- ansible.builtin.lineinfile:
- dest: /etc/yum.conf
- line: "tsflags=nodocs"
- state: absent
- when:
- - ansible_os_family == 'RedHat'
-
- - name: "Make sure the docs can be installed. (Debian)"
- ansible.builtin.lineinfile:
- path: /etc/dpkg/dpkg.cfg.d/excludes
- state: absent
- regexp: "path-exclude=/usr/share/doc/*"
- when:
- - ansible_os_family != 'RedHat'
diff --git a/ansible_collections/community/zabbix/molecule/zabbix_server/molecule.yml b/ansible_collections/community/zabbix/molecule/zabbix_server/molecule.yml
index 52df5ac4e..4638adfe2 100644
--- a/ansible_collections/community/zabbix/molecule/zabbix_server/molecule.yml
+++ b/ansible_collections/community/zabbix/molecule/zabbix_server/molecule.yml
@@ -14,7 +14,6 @@ platforms:
groups:
- ${MY_MOLECULE_DATABASE:-mysql}
- ${MY_MOLECULE_VERSION:-v64}
- - ${MY_MOLECULE_INTERPRETER:-python3}
provisioner:
name: ansible
@@ -23,23 +22,18 @@ provisioner:
ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles
inventory:
group_vars:
- python3:
+ all:
ansible_python_interpreter: /usr/bin/python3
- python:
- ansible_python_interpreter: /usr/bin/python
v64:
zabbix_server_version: 6.4
v62:
zabbix_server_version: 6.2
v60:
zabbix_server_version: 6.0
- v50:
- zabbix_server_version: 5.0
mysql:
zabbix_server_dbname: zabbix
zabbix_server_dbuser: zabbix-dbuser
zabbix_server_database: mysql
- zabbix_server_dbport: 3306
zabbix_server_dbhost: "{{ inventory_hostname }}-db"
zabbix_server_dbhost_run_install: false
zabbix_server_privileged_host: "%"
@@ -49,7 +43,6 @@ provisioner:
zabbix_server_mysql_login_port: 3306
pgsql:
zabbix_server_database: pgsql
- zabbix_server_dbport: 5432
zabbix_server_dbhost: "{{ inventory_hostname }}-db"
zabbix_server_dbhost_run_install: false
zabbix_server_pgsql_login_host: "{{ inventory_hostname }}-db"
diff --git a/ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml b/ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml
index d3dcc1ad0..7d8142763 100644
--- a/ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml
+++ b/ansible_collections/community/zabbix/molecule/zabbix_web/prepare.yml
@@ -83,7 +83,7 @@
when: ansible_version.full is version("2.14", "<")
- name: "Apt update"
- ansible.builtin.shell: "apt-get update && echo exit 0 > /usr/sbin/policy-rc.d"
+ ansible.builtin.shell: "apt-get update"
args:
warn: "{{ produce_warn | default(omit) }}"
register: installation_dependencies
@@ -162,7 +162,14 @@
- ansible_distribution_major_version >= '22'
- ansible_os_family == "Debian"
- - name: Set PHP packages (Ubuntu 2204)
+ - name: Set PHP Version (Ubuntu 2404)
+ ansible.builtin.set_fact:
+ __php_default_version_debian: "8.3"
+ when:
+ - ansible_distribution_major_version >= '24'
+ - ansible_os_family == "Debian"
+
+ - name: Set PHP packages (Ubuntu 2204 & 2404)
ansible.builtin.set_fact:
__php_packages:
- php{{ __php_default_version_debian }}-common
diff --git a/ansible_collections/community/zabbix/plugins/modules/zabbix_discoveryrule.py b/ansible_collections/community/zabbix/plugins/modules/zabbix_discoveryrule.py
new file mode 100644
index 000000000..725fd43e3
--- /dev/null
+++ b/ansible_collections/community/zabbix/plugins/modules/zabbix_discoveryrule.py
@@ -0,0 +1,460 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+from __future__ import absolute_import, division, print_function
+__metaclass__ = type
+
+
+DOCUMENTATION = r'''
+---
+module: zabbix_discoveryrule
+short_description: Create/delete Zabbix discovery rules
+description:
+ - Create discoveryrules if they do not exist.
+ - Delete existing discoveryrules if they exist.
+author:
+ - "Andrew Lathrop (@aplathrop)"
+requirements:
+ - "python >= 2.6"
+
+options:
+ state:
+ description:
+ - Create or delete discovery rule.
+ required: false
+ type: str
+ default: "present"
+ choices: [ "present", "absent" ]
+ name:
+ description:
+ - Name of discovery rule to create or delete.
+ required: true
+ type: str
+ host_name:
+ description:
+ - Name of host to add discovery rule to.
+ - Required when I(template_name) is not used.
+ - Mutually exclusive with I(template_name).
+ required: false
+ type: str
+ template_name:
+ description:
+ - Name of template to add discovery rule to.
+ - Required when I(host_name) is not used.
+ - Mutually exclusive with I(host_name).
+ required: false
+ type: str
+ params:
+ description:
+ - Parameters to create/update discovery rule with.
+ - Required if state is "present".
+ - Parameters as defined at https://www.zabbix.com/documentation/current/en/manual/api/reference/discoveryrule/object
+ - Additionally supported parameters are below
+ required: false
+ type: dict
+ suboptions:
+ key:
+ description:
+ - LLD rule key.
+ - Alias for "key_" in API docs
+ required: false
+ type: str
+ interval:
+ description:
+ - Update interval of the LLD rule.
+ - Alias for "delay" in API docs
+ required: false
+ type: str
+ status:
+ description:
+ - Status of the LLD rule.
+ required: false
+ type: str
+ choices: [ "enabled", "disabled" ]
+ enabled:
+ description:
+ - Status of the LLD rule.
+ - Overrides "status" in API docs
+ required: false
+ type: bool
+ type:
+ description:
+ - Type of the LLD rule.
+ - Required if state is "present".
+ required: false
+ type: str
+ choices:
+ - zabbix_agent
+ - zabbix_trapper
+ - simple_check
+ - zabbix_internal
+ - zabbix_agent_active
+ - web_item
+ - external_check
+ - database_monitor
+ - ipmi_agent
+ - ssh_agent
+ - telnet_agent
+ - calculated
+ - jmx_agent
+ - snmp_trap
+ - dependent_item
+ - http_agent
+ - snmp_agent
+ - script
+ preprocessing:
+ description:
+ - discovery rules preprocessing options.
+ - Parameters as defined at https://www.zabbix.com/documentation/current/en/manual/api/reference/discoveryrule/object#lld-rule-preprocessing
+ - Additionally supported parameters are below
+ required: false
+ type: list
+ elements: dict
+ suboptions:
+ type:
+ description:
+ - The preprocessing option type.
+ required: true
+ type: str
+ choices:
+ - xml_xpath
+ - jsonpath
+ - does_not_match_regular_expression
+ - not_match_regex
+ - check_for_error_in_json
+ - check_for_json_error
+ - check_for_error_in_xml
+ - check_for_xml_error
+ - discard_unchanged_with_heartbeat
+ - javascript
+ - prometheus_to_json
+ - csv_to_json
+ - replace
+ - xml_to_json
+ - snmp_walk_value
+ - snmp_walk_to_json
+ error_handler:
+ description:
+ - Action type used in case of preprocessing step failure.
+ required: false
+ type: str
+ choices:
+ - zabbix_server
+ - discard
+ - set_custom_value
+ - set_custom_error_message
+
+extends_documentation_fragment:
+- community.zabbix.zabbix
+'''
+
+EXAMPLES = r'''
+
+# If you want to use Username and Password to be authenticated by Zabbix Server
+- name: Set credentials to access Zabbix Server API
+ ansible.builtin.set_fact:
+ ansible_user: Admin
+ ansible_httpapi_pass: zabbix
+
+# If you want to use API token to be authenticated by Zabbix Server
+# https://www.zabbix.com/documentation/current/en/manual/web_interface/frontend_sections/administration/general#api-tokens
+- name: Set API token
+ ansible.builtin.set_fact:
+ ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
+
+# Create LLD rule on example_host
+- name: create rule
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_discoveryrule:
+ name: mounted_filesystem_discovery
+ host_name: example_host
+ params:
+ type: zabbix_agent
+ key: 'vfs.fs.discovery'
+ interval: 1h
+ enabled: True
+ state: present
+
+# Create LLD rule on example_template
+- name: create rule
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_discoveryrule:
+ name: mounted_filesystem_discovery
+ template_name: example_template
+ params:
+ type: zabbix_agent
+ key: 'vfs.fs.discovery'
+ interval: 1h
+ enabled: True
+ state: present
+
+# Add tags to the existing Zabbix LLD rule
+- name: update rule
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_discoveryrule:
+ name: mounted_filesystem_discovery
+ template_name: example_template
+ params:
+ type: zabbix_agent
+ key: 'vfs.fs.discovery'
+ interval: 1h
+ enabled: True
+ tags:
+ - tag: class
+ value: application
+ state: present
+
+# Delete LLD rule
+- name: delete rule
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_discoveryrule:
+ name: mounted_filesystem_discovery
+ template_name: example_template
+ state: absent
+'''
+
+from ansible.module_utils.basic import AnsibleModule
+
+from ansible_collections.community.zabbix.plugins.module_utils.base import ZabbixBase
+import ansible_collections.community.zabbix.plugins.module_utils.helpers as zabbix_utils
+
+
+class Discoveryrule(ZabbixBase):
+ ITEM_TYPES = {'zabbix_agent': 0,
+ 'zabbix_trapper': 2,
+ 'simple_check': 3,
+ 'zabbix_internal': 5,
+ 'zabbix_agent_active': 7,
+ 'web_item': 9,
+ 'external_check': 10,
+ 'database_monitor': 11,
+ 'ipmi_agent': 12,
+ 'ssh_agent': 13,
+ 'telnet_agent': 14,
+ 'calculated': 15,
+ 'jmx_agent': 16,
+ 'snmp_trap': 17,
+ 'dependent_item': 18,
+ 'http_agent': 19,
+ 'snmp_agent': 20,
+ 'script': 21}
+
+ PREPROCESSING_TYPES = {'regex': 5,
+ 'xml_xpath': 11,
+ 'jsonpath': 12,
+ 'does_not_match_regular_expression': 15,
+ 'not_match_regex': 15,
+ 'check_for_error_in_json': 16,
+ 'check_for_json_error': 16,
+ 'check_for_error_in_xml': 17,
+ 'check_for_xml_error': 17,
+ 'discard_unchanged_with_heartbeat': 20,
+ 'javascript': 21,
+ 'prometheus_to_json': 23,
+ 'csv_to_json': 24,
+ 'replace': 25,
+ 'xml_to_json': 27,
+ 'snmp_walk_value': 28,
+ 'snmp_walk_to_json': 29}
+
+ PREPROCESSING_ERROR_HANDLERS = {'zabbix_server': 0,
+ 'discard': 1,
+ 'set_custom_value': 2,
+ 'set_custom_error_message': 3}
+
+ def get_hosts_templates(self, host_name, template_name):
+ if host_name is not None:
+ try:
+ return self._zapi.host.get({"filter": {"host": host_name}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get host: %s" % e)
+ else:
+ try:
+ return self._zapi.template.get({"filter": {"host": template_name}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get template: %s" % e)
+
+ def get_discoveryrules(self, discoveryrule_name, host_name, template_name):
+ if host_name is not None:
+ host = host_name
+ else:
+ host = template_name
+ discoveryrules = []
+ try:
+ discoveryrules = self._zapi.discoveryrule.get({'filter': {'name': discoveryrule_name, 'host': host}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get discovery rules: %s" % e)
+ return discoveryrules
+
+ def sanitize_params(self, name, params):
+ params['name'] = name
+ if 'key' in params:
+ params['key_'] = params['key']
+ params.pop("key")
+ if 'type' in params:
+ item_type_int = self.ITEM_TYPES[params['type']]
+ params['type'] = item_type_int
+ if 'interval' in params:
+ params['delay'] = params['interval']
+ params.pop("interval")
+ if 'enabled' in params:
+ if params['enabled']:
+ params['status'] = 'enabled'
+ else:
+ params['status'] = 'disabled'
+ params.pop("enabled")
+ if 'status' in params:
+ status = params['status']
+ if status == 'enabled':
+ params['status'] = 0
+ elif status == 'disabled':
+ params['status'] = 1
+ else:
+ self._module.fail_json(msg="Status must be 'enabled' or 'disabled', got %s" % status)
+ if 'preprocessing' in params:
+ for param in params['preprocessing']:
+ preprocess_type_int = self.PREPROCESSING_TYPES[param['type']]
+ param['type'] = preprocess_type_int
+ if 'error_handler' in param:
+ error_handler_int = self.PREPROCESSING_ERROR_HANDLERS[param['error_handler']]
+ param['error_handler'] = error_handler_int
+
+ def add_discoveryrule(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.discoveryrule.create(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to create discoveryrule: %s" % e)
+ return results
+
+ def update_discoveryrule(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.discoveryrule.update(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to update discoveryrule: %s" % e)
+ return results
+
+ def check_discoveryrule_changed(self, old_discoveryrule):
+ try:
+ new_discoveryrule = self._zapi.discoveryrule.get({'itemids': "%s" % old_discoveryrule['itemid']})[0]
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get discoveryrule: %s" % e)
+ return old_discoveryrule != new_discoveryrule
+
+ def delete_discoveryrule(self, discoveryrule_id):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.discoveryrule.delete(discoveryrule_id)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to delete discoveryrule: %s" % e)
+ return results
+
+
+def main():
+ argument_spec = zabbix_utils.zabbix_common_argument_spec()
+ argument_spec.update(dict(
+ name=dict(type='str', required=True),
+ host_name=dict(type='str', required=False),
+ template_name=dict(type='str', required=False),
+ params=dict(type='dict', required=False),
+ state=dict(type='str', default="present", choices=['present', 'absent']),
+ ))
+ module = AnsibleModule(
+ argument_spec=argument_spec,
+ required_one_of=[
+ ['host_name', 'template_name']
+ ],
+ mutually_exclusive=[
+ ['host_name', 'template_name']
+ ],
+ required_if=[
+ ['state', 'present', ['params']]
+ ],
+ supports_check_mode=True
+ )
+
+ name = module.params['name']
+ host_name = module.params['host_name']
+ template_name = module.params['template_name']
+ params = module.params['params']
+ state = module.params['state']
+
+ discoveryrule = Discoveryrule(module)
+
+ if state == "absent":
+ discoveryrules = discoveryrule.get_discoveryrules(name, host_name, template_name)
+ if len(discoveryrules) == 0:
+ module.exit_json(changed=False, result="No discoveryrule to delete.")
+ else:
+ delete_ids = []
+ for d in discoveryrules:
+ delete_ids.append(d['itemid'])
+ results = discoveryrule.delete_discoveryrule(delete_ids)
+ module.exit_json(changed=True, result=results)
+
+ elif state == "present":
+ discoveryrule.sanitize_params(name, params)
+ discoveryrules = discoveryrule.get_discoveryrules(name, host_name, template_name)
+ results = []
+ if len(discoveryrules) == 0:
+ hosts_templates = discoveryrule.get_hosts_templates(host_name, template_name)
+ for host_template in hosts_templates:
+ if 'hostid' in host_template:
+ params['hostid'] = host_template['hostid']
+ elif 'templateid' in host_template:
+ params['hostid'] = host_template['templateid']
+ else:
+ module.fail_json(msg="host/template did not return id")
+ results.append(discoveryrule.add_discoveryrule(params))
+ module.exit_json(changed=True, result=results)
+ else:
+ changed = False
+ for d in discoveryrules:
+ params['itemid'] = d['itemid']
+ results.append(discoveryrule.update_discoveryrule(params))
+ changed_rule = discoveryrule.check_discoveryrule_changed(d)
+ if changed_rule:
+ changed = True
+ module.exit_json(changed=changed, result=results)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible_collections/community/zabbix/plugins/modules/zabbix_host_events_update.py b/ansible_collections/community/zabbix/plugins/modules/zabbix_host_events_update.py
new file mode 100644
index 000000000..ec0025467
--- /dev/null
+++ b/ansible_collections/community/zabbix/plugins/modules/zabbix_host_events_update.py
@@ -0,0 +1,244 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+from __future__ import absolute_import, division, print_function
+__metaclass__ = type
+
+
+DOCUMENTATION = r'''
+---
+module: zabbix_host_events_update
+short_description: update the status of event(s).
+description:
+ - Updates the status of event(s).
+author:
+ - "Andrew Lathrop (@aplathrop)"
+requirements:
+ - "python >= 2.6"
+
+options:
+ params:
+ description:
+ - Parameters to update event(s) with.
+ - Parameters as defined at https://www.zabbix.com/documentation/current/en/manual/api/reference/event/acknowledge
+ - Additionally supported parameters are below
+ required: true
+ type: dict
+ suboptions:
+ action:
+ description:
+ - action to update the event with
+ - Overrides "action" in API docs
+ - Required when I(actions) is not used.
+ - Mutually exclusive with I(actions).
+ required: false
+ type: str
+ choices:
+ - close_problem
+ - close
+ - acknowledge_event
+ - acknowledge
+ - ack
+ - add_message
+ - message
+ - msg
+ - change_severity
+ - severity
+ - unacknowledge_event
+ - unacknowledge
+ - unack
+ - suppress_event
+ - suppress
+ - unsuppress_event
+ - unsuppress
+ - change_event_rank_to_cause
+ - convert_to_cause
+ - change_event_rank_to_symptom
+ - convert_to_symptom
+ actions:
+ description:
+ - actions to update the event with
+ - Overrides "action" in API docs
+ - Required when I(action) is not used.
+ - Mutually exclusive with I(action).
+ required: false
+ type: list
+ elements: str
+ choices:
+ - close_problem
+ - close
+ - acknowledge_event
+ - acknowledge
+ - ack
+ - add_message
+ - message
+ - msg
+ - change_severity
+ - severity
+ - unacknowledge_event
+ - unacknowledge
+ - unack
+ - suppress_event
+ - suppress
+ - unsuppress_event
+ - unsuppress
+ - change_event_rank_to_cause
+ - convert_to_cause
+ - change_event_rank_to_symptom
+ - convert_to_symptom
+ severity:
+ description:
+ - New severity for events.
+ - Overrides "severity" in API docs
+ required: False
+ type: str
+ choices:
+ - not_classified
+ - information
+ - warning
+ - average
+ - high
+ - disaster
+ msg:
+ description:
+ - Text of the message.
+ - Alias for "message" in API docs
+ required: False
+ type: str
+
+extends_documentation_fragment:
+- community.zabbix.zabbix
+'''
+
+EXAMPLES = r'''
+
+# If you want to use Username and Password to be authenticated by Zabbix Server
+- name: Set credentials to access Zabbix Server API
+ ansible.builtin.set_fact:
+ ansible_user: Admin
+ ansible_httpapi_pass: zabbix
+
+# If you want to use API token to be authenticated by Zabbix Server
+# https://www.zabbix.com/documentation/current/en/manual/web_interface/frontend_sections/administration/general#api-tokens
+- name: Set API token
+ ansible.builtin.set_fact:
+ ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
+
+# Acknowledge single event
+- name: ack event
+ community.zabbix.zabbix_host_events_update:
+ params:
+ eventids: 12345
+ actions: ack
+
+- name: ack and close event with a message
+ community.zabbix.zabbix_host_events_update:
+ params:
+ eventids: [12345, 67890]
+ actions: ['ack', 'msg', 'close']
+ msg: 'closed by user'
+
+'''
+
+from ansible.module_utils.basic import AnsibleModule
+
+from ansible_collections.community.zabbix.plugins.module_utils.base import ZabbixBase
+import ansible_collections.community.zabbix.plugins.module_utils.helpers as zabbix_utils
+
+
+class Hosteventsupdate(ZabbixBase):
+ ACTIONS = {'close_problem': 1,
+ 'close': 1,
+ 'acknowledge_event': 2,
+ 'acknowledge': 2,
+ 'ack': 2,
+ 'add_message': 4,
+ 'message': 4,
+ 'msg': 4,
+ 'change_severity': 8,
+ 'severity': 8,
+ 'unacknowledge_event': 16,
+ 'unacknowledge': 16,
+ 'unack': 16,
+ 'suppress_event': 32,
+ 'suppress': 32,
+ 'unsuppress_event': 64,
+ 'unsuppress': 64,
+ 'change_event_rank_to_cause': 128,
+ 'convert_to_cause': 128,
+ 'change_event_rank_to_symptom': 256,
+ 'convert_to_symptom': 256}
+
+ SEVERITY_TYPES = {'not_classified': 0,
+ 'information': 1,
+ 'warning': 2,
+ 'average': 3,
+ 'high': 4,
+ 'disaster': 5}
+
+ def get_events(self, eventids):
+ try:
+ results = self._zapi.event.get({'eventids': eventids})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get event: %s" % e)
+ return results
+
+ def update_event(self, params):
+ if 'severity' in params:
+ if params['severity'] not in self.SEVERITY_TYPES:
+ self._module.fail_json(msg="%s is not a valid severity type" % params['severity'])
+ severity = self.SEVERITY_TYPES[params['severity']]
+ params['severity'] = severity
+ if 'action' in params:
+ if params['action'] not in self.ACTIONS:
+ self._module.fail_json(msg="%s is not a valid action" % params['action'])
+ action_id = self.ACTIONS[params['action']]
+ elif 'actions' in params:
+ action_id = 0
+ for action in params['actions']:
+ if action not in self.ACTIONS:
+ self._module.fail_json(msg="%s is not a valid action" % action)
+ action_id += self.ACTIONS[action]
+ params.pop('actions')
+ else:
+ self._module.fail_json(msg="params must contain either 'action' or 'actions'")
+ params['action'] = action_id
+ if 'msg' in params:
+ params['message'] = params['msg']
+ params.pop('msg')
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.event.acknowledge(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to update event: %s" % e)
+ return results
+
+ def check_events_changed(self, eventids, old_events):
+ new_events = self.get_events(eventids)
+ return old_events != new_events
+
+
+def main():
+ argument_spec = zabbix_utils.zabbix_common_argument_spec()
+ argument_spec.update(
+ params=dict(type='dict', required=True))
+ module = AnsibleModule(
+ argument_spec=argument_spec,
+ supports_check_mode=True
+ )
+
+ params = module.params['params']
+
+ hosteventsupdate = Hosteventsupdate(module)
+
+ events = hosteventsupdate.get_events(params['eventids'])
+ results = hosteventsupdate.update_event(params)
+ changed = hosteventsupdate.check_events_changed(params['eventids'], events)
+ module.exit_json(changed=changed, result=results)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible_collections/community/zabbix/plugins/modules/zabbix_item.py b/ansible_collections/community/zabbix/plugins/modules/zabbix_item.py
new file mode 100644
index 000000000..2d6bb95eb
--- /dev/null
+++ b/ansible_collections/community/zabbix/plugins/modules/zabbix_item.py
@@ -0,0 +1,579 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+from __future__ import absolute_import, division, print_function
+__metaclass__ = type
+
+
+DOCUMENTATION = r'''
+---
+module: zabbix_item
+short_description: Create/delete Zabbix items
+description:
+ - Create items if they do not exist.
+ - Delete existing items if they exist.
+author:
+ - "Andrew Lathrop (@aplathrop)"
+requirements:
+ - "python >= 2.6"
+
+options:
+ state:
+ description:
+ - Create or delete item.
+ required: false
+ type: str
+ default: "present"
+ choices: [ "present", "absent" ]
+ name:
+ description:
+ - Name of item to create or delete.
+ required: true
+ type: str
+ host_name:
+ description:
+ - Name of host to add item to.
+ - Required when I(template_name) is not used.
+ - Mutually exclusive with I(template_name).
+ required: false
+ type: str
+ template_name:
+ description:
+ - Name of template to add item to.
+ - Required when I(host_name) is not used.
+ - Mutually exclusive with I(host_name).
+ required: false
+ type: str
+ params:
+ description:
+ - Parameters to create/update item with.
+ - Required if state is "present".
+ - Parameters as defined at https://www.zabbix.com/documentation/current/en/manual/api/reference/item/object
+ - Additionally supported parameters are below
+ required: false
+ type: dict
+ suboptions:
+ key:
+ description:
+ - Item key.
+ - Alias for "key_" in API docs
+ required: false
+ type: str
+ interval:
+ description:
+ - Update interval of the item.
+ - Alias for "delay" in API docs
+ required: false
+ type: str
+ status:
+ description:
+ - Status of the item.
+ required: false
+ type: str
+ choices: [ "enabled", "disabled" ]
+ enabled:
+ description:
+ - Status of the item.
+ - Overrides "status" in API docs
+ required: false
+ type: bool
+ type:
+ description:
+ - Type of the item.
+ - Required if state is "present".
+ required: false
+ type: str
+ choices:
+ - zabbix_agent
+ - zabbix_trapper
+ - simple_check
+ - zabbix_internal
+ - zabbix_agent_active
+ - web_item
+ - external_check
+ - database_monitor
+ - ipmi_agent
+ - ssh_agent
+ - telnet_agent
+ - calculated
+ - jmx_agent
+ - snmp_trap
+ - dependent_item
+ - http_agent
+ - snmp_agent
+ - script
+ value_type:
+ description:
+ - Type of information of the item.
+ - Required if state is "present".
+ required: false
+ type: str
+ choices:
+ - numeric_float
+ - character
+ - log
+ - numeric_unsigned
+ - text
+ master_item:
+ description:
+ - item that is the master of the current one
+ - Overrides "master_itemid" in API docs
+ required: false
+ type: dict
+ suboptions:
+ item_name:
+ description:
+ - name of the master item
+ required: true
+ type: str
+ host_name:
+ description:
+ - name of the host the master item belongs to
+ - Required when I(template_name) is not used.
+ - Mutually exclusive with I(template_name).
+ required: false
+ template_name:
+ description:
+ - name of the template the master item belongs to
+ - Required when I(host_name) is not used.
+ - Mutually exclusive with I(host_name).
+ preprocessing:
+ description:
+ - Item preprocessing options.
+ - Parameters as defined at https://www.zabbix.com/documentation/current/en/manual/api/reference/item/object#item-preprocessing
+ - Additionally supported parameters are below
+ required: false
+ type: list
+ elements: dict
+ suboptions:
+ type:
+ description:
+ - The preprocessing option type.
+ required: true
+ type: str
+ choices:
+ - custom_multiplier
+ - right_trim
+ - left_trim
+ - trim
+ - regular_expressions
+ - regex
+ - boolean_to_decimal
+ - octal_to_decimal
+ - hexadecimal_to_decimal
+ - simple_change
+ - change_per_second
+ - xml_xpath
+ - jsonpath
+ - in_range
+ - matches_regular_expression
+ - matches_regex
+ - does_not_match_regular_expression
+ - not_match_regex
+ - check_for_error_in_json
+ - check_for_json_error
+ - check_for_error_in_xml
+ - check_for_xml_error
+ - check_for_error_using_regular_expression
+ - check_for_error_regex
+ - discard_unchanged
+ - discard_unchanged_with_heartbeat
+ - javascript
+ - prometheus_pattern
+ - prometheus_to_json
+ - csv_to_json
+ - replace
+ - check_unsupported
+ - xml_to_json
+ - snmp_walk_value
+ - snmp_walk_to_json
+ error_handler:
+ description:
+ - Action type used in case of preprocessing step failure.
+ required: false
+ type: str
+ choices:
+ - zabbix_server
+ - discard
+ - set_custom_value
+ - set_custom_error_message
+
+extends_documentation_fragment:
+- community.zabbix.zabbix
+'''
+
+EXAMPLES = r'''
+
+# If you want to use Username and Password to be authenticated by Zabbix Server
+- name: Set credentials to access Zabbix Server API
+ ansible.builtin.set_fact:
+ ansible_user: Admin
+ ansible_httpapi_pass: zabbix
+
+# If you want to use API token to be authenticated by Zabbix Server
+# https://www.zabbix.com/documentation/current/en/manual/web_interface/frontend_sections/administration/general#api-tokens
+- name: Set API token
+ ansible.builtin.set_fact:
+ ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
+
+# Create ping item on example_host
+- name: create ping item
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_item:
+ name: agent_ping
+ host_name: example_host
+ params:
+ type: zabbix_agent
+ key: agent.ping
+ value_type: numeric_unsigned
+ interval: 1m
+ state: present
+
+# Create ping item on example_template
+- name: create ping item
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_item:
+ name: agent_ping
+ template_name: example_template
+ params:
+ type: zabbix_agent
+ key: agent.ping
+ value_type: numeric_unsigned
+ interval: 1m
+ state: present
+
+- name: Add tags to the existing Zabbix item
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: "zabbixeu" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_item:
+ name: agent_ping
+ template_name: example_template
+ params:
+ type: zabbix_agent
+ key: agent.ping
+ value_type: numeric_unsigned
+ interval: 1m
+ tags:
+ - tag: class
+ value: application
+ state: present
+
+- name: create a dependent item
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: "zabbixeu" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_item:
+ name: depend_item
+ host_name: example_host
+ params:
+ type: dependent_item
+ key: vfs.fs.pused
+ value_type: numeric_float
+ units: '%'
+ master_item:
+ item_name: example_item
+ host_name: example_host
+ preprocessing:
+ - type: jsonpath
+ params: '$[?(@.fstype == "ext4")]'
+ error_handler: zabbix_server
+ - type: jsonpath
+ params: "$[*].['bytes', 'inodes'].pused.max()"
+ error_handler: zabbix_server
+ state: present
+
+- name: Delete Zabbix item
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: "zabbixeu" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_item:
+ name: agent_ping
+ template_name: example_template
+ state: absent
+'''
+
+from ansible.module_utils.basic import AnsibleModule
+
+from ansible_collections.community.zabbix.plugins.module_utils.base import ZabbixBase
+import ansible_collections.community.zabbix.plugins.module_utils.helpers as zabbix_utils
+
+
+class Item(ZabbixBase):
+ ITEM_TYPES = {'zabbix_agent': 0,
+ 'zabbix_trapper': 2,
+ 'simple_check': 3,
+ 'zabbix_internal': 5,
+ 'zabbix_agent_active': 7,
+ 'web_item': 9,
+ 'external_check': 10,
+ 'database_monitor': 11,
+ 'ipmi_agent': 12,
+ 'ssh_agent': 13,
+ 'telnet_agent': 14,
+ 'calculated': 15,
+ 'jmx_agent': 16,
+ 'snmp_trap': 17,
+ 'dependent_item': 18,
+ 'http_agent': 19,
+ 'snmp_agent': 20,
+ 'script': 21}
+
+ VALUE_TYPES = {'numeric_float': 0,
+ 'character': 1,
+ 'log': 2,
+ 'numeric_unsigned': 3,
+ 'text': 4}
+
+ PREPROCESSING_TYPES = {'custom_multiplier': 1,
+ 'right_trim': 2,
+ 'left_trim': 3,
+ 'trim': 4,
+ 'regular_expressions': 5,
+ 'regex': 5,
+ 'boolean_to_decimal': 6,
+ 'octal_to_decimal': 7,
+ 'hexadecimal_to_decimal': 8,
+ 'simple_change': 9,
+ 'change_per_second': 10,
+ 'xml_xpath': 11,
+ 'jsonpath': 12,
+ 'in_range': 13,
+ 'matches_regular_expression': 14,
+ 'matches_regex': 14,
+ 'does_not_match_regular_expression': 15,
+ 'not_match_regex': 15,
+ 'check_for_error_in_json': 16,
+ 'check_for_json_error': 16,
+ 'check_for_error_in_xml': 17,
+ 'check_for_xml_error': 17,
+ 'check_for_error_using_regular_expression': 18,
+ 'check_for_error_regex': 18,
+ 'discard_unchanged': 19,
+ 'discard_unchanged_with_heartbeat': 20,
+ 'javascript': 21,
+ 'prometheus_pattern': 22,
+ 'prometheus_to_json': 23,
+ 'csv_to_json': 24,
+ 'replace': 25,
+ 'check_unsupported': 26,
+ 'xml_to_json': 27,
+ 'snmp_walk_value': 28,
+ 'snmp_walk_to_json': 29}
+
+ PREPROCESSING_ERROR_HANDLERS = {'zabbix_server': 0,
+ 'discard': 1,
+ 'set_custom_value': 2,
+ 'set_custom_error_message': 3}
+
+ def get_hosts_templates(self, host_name, template_name):
+ if host_name is not None:
+ try:
+ return self._zapi.host.get({"filter": {"host": host_name}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get host: %s" % e)
+ else:
+ try:
+ return self._zapi.template.get({"filter": {"host": template_name}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get template: %s" % e)
+
+ def get_items(self, item_name, host_name, template_name):
+ if host_name is not None:
+ host = host_name
+ else:
+ host = template_name
+ items = []
+ try:
+ items = self._zapi.item.get({'filter': {'name': item_name, 'host': host}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get item: %s" % e)
+ return items
+
+ def sanitize_params(self, name, params):
+ params['name'] = name
+ if 'key' in params:
+ params['key_'] = params['key']
+ params.pop("key")
+ if 'type' in params:
+ item_type_int = self.ITEM_TYPES[params['type']]
+ params['type'] = item_type_int
+ if 'value_type' in params:
+ value_type_int = self.VALUE_TYPES[params['value_type']]
+ params['value_type'] = value_type_int
+ if 'interval' in params:
+ params['delay'] = params['interval']
+ params.pop("interval")
+ if 'enabled' in params:
+ if params['enabled']:
+ params['status'] = 'enabled'
+ else:
+ params['status'] = 'disabled'
+ params.pop("enabled")
+ if 'status' in params:
+ status = params['status']
+ if status == 'enabled':
+ params['status'] = 0
+ elif status == 'disabled':
+ params['status'] = 1
+ else:
+ self._module.fail_json(msg="Status must be 'enabled' or 'disabled', got %s" % status)
+ if 'master_item' in params:
+ if 'host_name' not in params['master_item']:
+ params['master_item']['host_name'] = None
+ if 'template_name' not in params['master_item']:
+ params['master_item']['template_name'] = None
+ master_items = self.get_items(params['master_item']['item_name'], params['master_item']['host_name'], params['master_item']['template_name'])
+ if len(master_items) == 0:
+ self._module.fail_json(msg="No items with the name %s exist to depend on" % params['master_item']['item_name'])
+ params['master_itemid'] = master_items[0]['itemid']
+ params.pop('master_item')
+ if 'preprocessing' in params:
+ for param in params['preprocessing']:
+ preprocess_type_int = self.PREPROCESSING_TYPES[param['type']]
+ param['type'] = preprocess_type_int
+ if 'error_handler' in param:
+ error_handler_int = self.PREPROCESSING_ERROR_HANDLERS[param['error_handler']]
+ param['error_handler'] = error_handler_int
+
+ def add_item(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.item.create(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to create item: %s" % e)
+ return results
+
+ def update_item(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.item.update(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to update item: %s" % e)
+ return results
+
+ def check_item_changed(self, old_item):
+ try:
+ new_item = self._zapi.item.get({'itemids': "%s" % old_item['itemid']})[0]
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get item: %s" % e)
+ return old_item != new_item
+
+ def delete_item(self, item_id):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.item.delete(item_id)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to delete item: %s" % e)
+ return results
+
+
+def main():
+ argument_spec = zabbix_utils.zabbix_common_argument_spec()
+ argument_spec.update(dict(
+ name=dict(type='str', required=True),
+ host_name=dict(type='str', required=False),
+ template_name=dict(type='str', required=False),
+ params=dict(type='dict', required=False),
+ state=dict(type='str', default="present", choices=['present', 'absent']),
+ ))
+ module = AnsibleModule(
+ argument_spec=argument_spec,
+ required_one_of=[
+ ['host_name', 'template_name']
+ ],
+ mutually_exclusive=[
+ ['host_name', 'template_name']
+ ],
+ required_if=[
+ ['state', 'present', ['params']]
+ ],
+ supports_check_mode=True
+ )
+
+ name = module.params['name']
+ host_name = module.params['host_name']
+ template_name = module.params['template_name']
+ params = module.params['params']
+ state = module.params['state']
+
+ item = Item(module)
+
+ if state == "absent":
+ items = item.get_items(name, host_name, template_name)
+ if len(items) == 0:
+ module.exit_json(changed=False, result="No item to delete.")
+ else:
+ delete_ids = []
+ for i in items:
+ delete_ids.append(i['itemid'])
+ results = item.delete_item(delete_ids)
+ module.exit_json(changed=True, result=results)
+
+ elif state == "present":
+ item.sanitize_params(name, params)
+ items = item.get_items(name, host_name, template_name)
+ results = []
+ if len(items) == 0:
+ hosts_templates = item.get_hosts_templates(host_name, template_name)
+ for host_template in hosts_templates:
+ if 'hostid' in host_template:
+ params['hostid'] = host_template['hostid']
+ elif 'templateid' in host_template:
+ params['hostid'] = host_template['templateid']
+ else:
+ module.fail_json(msg="host/template did not return id")
+ results.append(item.add_item(params))
+ module.exit_json(changed=True, result=results)
+ else:
+ changed = False
+ for i in items:
+ params['itemid'] = i['itemid']
+ results.append(item.update_item(params))
+ changed_item = item.check_item_changed(i)
+ if changed_item:
+ changed = True
+ module.exit_json(changed=changed, result=results)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible_collections/community/zabbix/plugins/modules/zabbix_itemprototype.py b/ansible_collections/community/zabbix/plugins/modules/zabbix_itemprototype.py
new file mode 100644
index 000000000..1fe5b9560
--- /dev/null
+++ b/ansible_collections/community/zabbix/plugins/modules/zabbix_itemprototype.py
@@ -0,0 +1,609 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+from __future__ import absolute_import, division, print_function
+__metaclass__ = type
+
+
+DOCUMENTATION = r'''
+---
+module: zabbix_itemprototype
+short_description: Create/delete Zabbix item prototypes
+description:
+ - Create item prototypes if they do not exist.
+ - Delete existing item prototypes if they exist.
+author:
+ - "Andrew Lathrop (@aplathrop)"
+requirements:
+ - "python >= 2.6"
+
+options:
+ state:
+ description:
+ - Create or delete item prototype.
+ required: false
+ type: str
+ default: "present"
+ choices: [ "present", "absent" ]
+ name:
+ description:
+ - Name of item prototype to create or delete.
+ required: true
+ type: str
+ host_name:
+ description:
+ - Name of host to add item prototype to.
+ - Required when I(template_name) is not used.
+ - Mutually exclusive with I(template_name).
+ required: false
+ type: str
+ template_name:
+ description:
+ - Name of template to add item prototype to.
+ - Required when I(host_name) is not used.
+ - Mutually exclusive with I(host_name).
+ required: false
+ type: str
+ discoveryrule_name:
+ description:
+ - Name of the LLD rule that the item belongs to.
+ required: true
+ type: str
+ params:
+ description:
+ - Parameters to create/update item prototype with.
+ - Required if state is "present".
+ - Parameters as defined at https://www.zabbix.com/documentation/current/en/manual/api/reference/itemprototype/object
+ - Additionally supported parameters are below
+ required: false
+ type: dict
+ suboptions:
+ key:
+ description:
+ - Item prototype key.
+ - Alias for "key_" in API docs
+ required: false
+ type: str
+ interval:
+ description:
+ - Update interval of the item prototype.
+ - Alias for "delay" in API docs
+ required: false
+ type: str
+ status:
+ description:
+ - Status of the item prototype.
+ required: false
+ type: str
+ choices: [ "enabled", "disabled" ]
+ enabled:
+ description:
+ - Status of the item prototype.
+ - Overrides "status" in API docs
+ required: false
+ type: bool
+ type:
+ description:
+ - Type of the item prototype.
+ - Required if state is "present".
+ required: false
+ type: str
+ choices:
+ - zabbix_agent
+ - zabbix_trapper
+ - simple_check
+ - zabbix_internal
+ - zabbix_agent_active
+ - web_item
+ - external_check
+ - database_monitor
+ - ipmi_agent
+ - ssh_agent
+ - telnet_agent
+ - calculated
+ - jmx_agent
+ - snmp_trap
+ - dependent_item
+ - http_agent
+ - snmp_agent
+ - script
+ value_type:
+ description:
+ - Type of information of the item prototype.
+ - Required if state is "present".
+ required: false
+ type: str
+ choices:
+ - numeric_float
+ - character
+ - log
+ - numeric_unsigned
+ - text
+ master_item:
+ description:
+ - item that is the master of the current one
+ - Overrides "master_itemid" in API docs
+ required: false
+ type: dict
+ suboptions:
+ item_name:
+ description:
+ - name of the master item
+ required: true
+ type: str
+ discovery_rule:
+ description:
+ - name of the discovery rule the master item belongs to
+ required: true
+ type: str
+ host_name:
+ description:
+ - name of the host the master item belongs to
+ - Required when I(template_name) is not used.
+ - Mutually exclusive with I(template_name).
+ required: false
+ template_name:
+ description:
+ - name of the template the master item belongs to
+ - Required when I(host_name) is not used.
+ - Mutually exclusive with I(host_name).
+ preprocessing:
+ description:
+ - Item preprocessing options.
+ - Parameters as defined at
+ - https://www.zabbix.com/documentation/current/en/manual/api/reference/itemprototype/object#item-prototype-preprocessing
+ - Additionally supported parameters are below
+ required: false
+ type: list
+ elements: dict
+ suboptions:
+ type:
+ description:
+ - The preprocessing option type.
+ required: true
+ type: str
+ choices:
+ - custom_multiplier
+ - right_trim
+ - left_trim
+ - trim
+ - regular_expressions
+ - regex
+ - boolean_to_decimal
+ - octal_to_decimal
+ - hexadecimal_to_decimal
+ - simple_change
+ - change_per_second
+ - xml_xpath
+ - jsonpath
+ - in_range
+ - matches_regular_expression
+ - matches_regex
+ - does_not_match_regular_expression
+ - not_match_regex
+ - check_for_error_in_json
+ - check_for_json_error
+ - check_for_error_in_xml
+ - check_for_xml_error
+ - check_for_error_using_regular_expression
+ - check_for_error_regex
+ - discard_unchanged
+ - discard_unchanged_with_heartbeat
+ - javascript
+ - prometheus_pattern
+ - prometheus_to_json
+ - csv_to_json
+ - replace
+ - check_unsupported
+ - xml_to_json
+ - snmp_walk_value
+ - snmp_walk_to_json
+ error_handler:
+ description:
+ - Action type used in case of preprocessing step failure.
+ required: false
+ type: str
+ choices:
+ - zabbix_server
+ - discard
+ - set_custom_value
+ - set_custom_error_message
+
+extends_documentation_fragment:
+- community.zabbix.zabbix
+'''
+
+EXAMPLES = r'''
+
+
+# If you want to use Username and Password to be authenticated by Zabbix Server
+- name: Set credentials to access Zabbix Server API
+ ansible.builtin.set_fact:
+ ansible_user: Admin
+ ansible_httpapi_pass: zabbix
+
+# If you want to use API token to be authenticated by Zabbix Server
+# https://www.zabbix.com/documentation/current/en/manual/web_interface/frontend_sections/administration/general#api-tokens
+- name: Set API token
+ ansible.builtin.set_fact:
+ ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
+
+# Create item prototype on example_host using example_rule
+- name: create item prototype
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:Used space{% endraw %}'
+ discoveryrule_name: example_rule
+ host_name: example_host
+ params:
+ type: zabbix_agent
+ key: "{% raw %}vfs.fs.size[{#FSNAME},used]{% endraw %}"
+ value_type: numeric_unsigned
+ interval: 1m
+ state: present
+
+# Create item prototype on example_template using example_rule
+- name: create item prototype
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:Used space{% endraw %}'
+ discoveryrule_name: example_rule
+ template_name: example_template
+ params:
+ type: zabbix_agent
+ key: "{% raw %}vfs.fs.size[{#FSNAME},used]{% endraw %}"
+ value_type: numeric_unsigned
+ interval: 1m
+ state: present
+
+
+# Add tags to the existing Zabbix item prototype
+- name: update item prototype
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:Used space{% endraw %}'
+ discoveryrule_name: example_rule
+ template_name: example_template
+ params:
+ type: zabbix_agent
+ key: "{% raw %}vfs.fs.size[{#FSNAME},used]{% endraw %}"
+ value_type: numeric_unsigned
+ interval: 1m
+ tags:
+ - tag: class
+ value: application
+ state: present
+
+- name: create dependent item
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:example_depend_item_prototype{% endraw %}'
+ discoveryrule_name: example_rule
+ host_name: example_host
+ params:
+ type: dependent_item
+ key: '{% raw %}vfs.fs.size.half[{#FSNAME}]{% endraw %}'
+ value_type: numeric_float
+ units: B
+ master_item:
+ item_name: '{% raw %}{#FSNAME}:example_item_prototype{% endraw %}'
+ discoveryrule_name: example_rule
+ host_name: example_host
+ preprocessing:
+ - type: javascript
+ params: 'return value / 2;'
+ error_handler: zabbix_server
+ state: present
+
+- name: Delete Zabbix item prototype
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:Used space{% endraw %}'
+ discoveryrule_name: example_rule
+ template_name: example_template
+ state: absent
+'''
+
+from ansible.module_utils.basic import AnsibleModule
+
+from ansible_collections.community.zabbix.plugins.module_utils.base import ZabbixBase
+import ansible_collections.community.zabbix.plugins.module_utils.helpers as zabbix_utils
+
+
+class Itemprototype(ZabbixBase):
+ ITEM_TYPES = {'zabbix_agent': 0,
+ 'zabbix_trapper': 2,
+ 'simple_check': 3,
+ 'zabbix_internal': 5,
+ 'zabbix_agent_active': 7,
+ 'web_item': 9,
+ 'external_check': 10,
+ 'database_monitor': 11,
+ 'ipmi_agent': 12,
+ 'ssh_agent': 13,
+ 'telnet_agent': 14,
+ 'calculated': 15,
+ 'jmx_agent': 16,
+ 'snmp_trap': 17,
+ 'dependent_item': 18,
+ 'http_agent': 19,
+ 'snmp_agent': 20,
+ 'script': 21}
+
+ VALUE_TYPES = {'numeric_float': 0,
+ 'character': 1,
+ 'log': 2,
+ 'numeric_unsigned': 3,
+ 'text': 4}
+
+ PREPROCESSING_TYPES = {'custom_multiplier': 1,
+ 'right_trim': 2,
+ 'left_trim': 3,
+ 'trim': 4,
+ 'regular_expressions': 5,
+ 'regex': 5,
+ 'boolean_to_decimal': 6,
+ 'octal_to_decimal': 7,
+ 'hexadecimal_to_decimal': 8,
+ 'simple_change': 9,
+ 'change_per_second': 10,
+ 'xml_xpath': 11,
+ 'jsonpath': 12,
+ 'in_range': 13,
+ 'matches_regular_expression': 14,
+ 'matches_regex': 14,
+ 'does_not_match_regular_expression': 15,
+ 'not_match_regex': 15,
+ 'check_for_error_in_json': 16,
+ 'check_for_json_error': 16,
+ 'check_for_error_in_xml': 17,
+ 'check_for_xml_error': 17,
+ 'check_for_error_using_regular_expression': 18,
+ 'check_for_error_regex': 18,
+ 'discard_unchanged': 19,
+ 'discard_unchanged_with_heartbeat': 20,
+ 'javascript': 21,
+ 'prometheus_pattern': 22,
+ 'prometheus_to_json': 23,
+ 'csv_to_json': 24,
+ 'replace': 25,
+ 'check_unsupported': 26,
+ 'xml_to_json': 27,
+ 'snmp_walk_value': 28,
+ 'snmp_walk_to_json': 29}
+
+ PREPROCESSING_ERROR_HANDLERS = {'zabbix_server': 0,
+ 'discard': 1,
+ 'set_custom_value': 2,
+ 'set_custom_error_message': 3}
+
+ def get_hosts_templates(self, host_name, template_name):
+ if host_name is not None:
+ try:
+ return self._zapi.host.get({"filter": {"host": host_name}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get host: %s" % e)
+ else:
+ try:
+ return self._zapi.template.get({"filter": {"host": template_name}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get template: %s" % e)
+
+ def get_discoveryrules(self, discoveryrule_name, host_name, template_name):
+ if host_name is not None:
+ host = host_name
+ else:
+ host = template_name
+ discoveryrules = []
+ try:
+ discoveryrules = self._zapi.discoveryrule.get({'filter': {'name': discoveryrule_name, 'host': host}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get discovery rules: %s" % e)
+ return discoveryrules
+
+ def get_itemprototypes(self, itemprototype_name, discoveryrule_name, host_name, template_name):
+ if host_name is not None:
+ host = host_name
+ else:
+ host = template_name
+ discoveryrules = self.get_discoveryrules(discoveryrule_name, host_name, template_name)
+ rule_ids = []
+ for d in discoveryrules:
+ rule_ids.append(d['itemid'])
+ itemprototypes = []
+ try:
+ itemprototypes = self._zapi.itemprototype.get({'filter': {'name': itemprototype_name, 'host': host, 'discoveryids': rule_ids}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get item: %s" % e)
+ return itemprototypes
+
+ def sanitize_params(self, name, discoveryrule_name, params, host_name=None, template_name=None):
+ params['name'] = name
+ if 'key' in params:
+ params['key_'] = params['key']
+ params.pop("key")
+ rules = self.get_discoveryrules(discoveryrule_name, host_name, template_name)
+ if len(rules) == 0:
+ self._module.fail_json(msg="Failed to get discoveryrule: %s" % discoveryrule_name)
+ params['ruleid'] = self.get_discoveryrules(discoveryrule_name, host_name, template_name)[0]['itemid']
+ if 'type' in params:
+ item_type_int = self.ITEM_TYPES[params['type']]
+ params['type'] = item_type_int
+ if 'value_type' in params:
+ value_type_int = self.VALUE_TYPES[params['value_type']]
+ params['value_type'] = value_type_int
+ if 'interval' in params:
+ params['delay'] = params['interval']
+ params.pop("interval")
+ if 'enabled' in params:
+ params['status'] = params['enabled']
+ params.pop('enabled')
+ if 'master_item' in params:
+ if 'host_name' not in params['master_item']:
+ params['master_item']['host_name'] = None
+ if 'template_name' not in params['master_item']:
+ params['master_item']['template_name'] = None
+ master_items = self.get_itemprototypes(params['master_item']['item_name'], params['master_item']['discoveryrule_name'],
+ params['master_item']['host_name'], params['master_item']['template_name'])
+ if len(master_items) == 0:
+ self._module.fail_json(msg="No items with the name %s exist to depend on" % params['master_item']['item_name'])
+ params['master_itemid'] = master_items[0]['itemid']
+ params.pop('master_item')
+ if 'preprocessing' in params:
+ for param in params['preprocessing']:
+ preprocess_type_int = self.PREPROCESSING_TYPES[param['type']]
+ param['type'] = preprocess_type_int
+ if 'error_handler' in param:
+ error_handler_int = self.PREPROCESSING_ERROR_HANDLERS[param['error_handler']]
+ param['error_handler'] = error_handler_int
+
+ def add_itemprototype(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.itemprototype.create(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to create itemprototype: %s" % e)
+ return results
+
+ def update_itemprototype(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.itemprototype.update(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to update itemprototype: %s" % e)
+ return results
+
+ def check_itemprototype_changed(self, old_itemprototype):
+ try:
+ new_itemprototype = self._zapi.itemprototype.get({'itemids': '%s' % old_itemprototype['itemid']})[0]
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get itemprototype: %s" % e)
+ return old_itemprototype != new_itemprototype
+
+ def delete_itemprototype(self, itemprototype_id):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.itemprototype.delete(itemprototype_id)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to delete itemprototype: %s" % e)
+ return results
+
+
+def main():
+ argument_spec = zabbix_utils.zabbix_common_argument_spec()
+ argument_spec.update(dict(
+ name=dict(type='str', required=True),
+ discoveryrule_name=dict(type='str', required=True),
+ host_name=dict(type='str', required=False),
+ template_name=dict(type='str', required=False),
+ params=dict(type='dict', required=False),
+ state=dict(type='str', default="present", choices=['present', 'absent']),
+ ))
+ module = AnsibleModule(
+ argument_spec=argument_spec,
+ required_one_of=[
+ ['host_name', 'template_name']
+ ],
+ mutually_exclusive=[
+ ['host_name', 'template_name']
+ ],
+ required_if=[
+ ['state', 'present', ['params']]
+ ],
+ supports_check_mode=True
+ )
+
+ name = module.params['name']
+ discoveryrule_name = module.params['discoveryrule_name']
+ host_name = module.params['host_name']
+ template_name = module.params['template_name']
+ params = module.params['params']
+ state = module.params['state']
+
+ itemprototype = Itemprototype(module)
+
+ if state == "absent":
+ itemprototypes = itemprototype.get_itemprototypes(name, discoveryrule_name, host_name, template_name)
+ if len(itemprototypes) == 0:
+ module.exit_json(changed=False, result="No itemprototype to delete.")
+ else:
+ delete_ids = []
+ for i in itemprototypes:
+ delete_ids.append(i['itemid'])
+ results = itemprototype.delete_itemprototype(delete_ids)
+ module.exit_json(changed=True, result=results)
+
+ elif state == "present":
+ itemprototype.sanitize_params(name, discoveryrule_name, params, host_name, template_name)
+ itemprototypes = itemprototype.get_itemprototypes(name, discoveryrule_name, host_name, template_name)
+ results = []
+ if len(itemprototypes) == 0:
+ hosts_templates = itemprototype.get_hosts_templates(host_name, template_name)
+ for host_template in hosts_templates:
+ if 'hostid' in host_template:
+ params['hostid'] = host_template['hostid']
+ elif 'templateid' in host_template:
+ params['hostid'] = host_template['templateid']
+ else:
+ module.fail_json(msg="host/template did not return id")
+ results.append(itemprototype.add_itemprototype(params))
+ module.exit_json(changed=True, result=results)
+ else:
+ changed = False
+ params.pop('ruleid')
+ for i in itemprototypes:
+ params['itemid'] = i['itemid']
+ results.append(itemprototype.update_itemprototype(params))
+ changed_item = itemprototype.check_itemprototype_changed(i)
+ if changed_item:
+ changed = True
+ module.exit_json(changed=changed, result=results)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible_collections/community/zabbix/plugins/modules/zabbix_script.py b/ansible_collections/community/zabbix/plugins/modules/zabbix_script.py
index 643851885..402ec10a8 100644
--- a/ansible_collections/community/zabbix/plugins/modules/zabbix_script.py
+++ b/ansible_collections/community/zabbix/plugins/modules/zabbix_script.py
@@ -26,15 +26,15 @@ options:
type: str
script_type:
description:
- - Script type.
+ - Script type. Required when state is 'present'.
type: str
- required: true
+ required: false
choices: ["script", "ipmi", "ssh", "telnet", "webhook"]
command:
description:
- - Command to run.
+ - Command to run. Required when state is 'present'
type: str
- required: true
+ required: false
scope:
description:
- Script scope.
@@ -137,9 +137,9 @@ options:
suboptions:
name:
description:
- - Parameter name.
+ - Parameter name. Required when 'parameters' is specified for a 'webhook' script.
type: str
- required: true
+ required: false
value:
description:
- Parameter value. Supports macros.
@@ -292,24 +292,16 @@ class Script(ZabbixBase):
request["confirmation"] = confirmation
if script_type == "ssh":
- if authtype is None:
- self._module.fail_json(changed=False, msg="authtype must be provided for ssh script type")
request["authtype"] = str(zabbix_utils.helper_to_numeric_value([
"password",
"public_key"], authtype))
if authtype == "public_key":
- if publickey is None or privatekey is None:
- self._module.fail_json(changed=False, msg="publickey and privatekey must be provided for ssh script type with publickey authtype")
request["publickey"] = publickey
request["privatekey"] = privatekey
if script_type in ["ssh", "telnet"]:
- if username is None:
- self._module.fail_json(changed=False, msg="username must be provided for 'ssh' and 'telnet' script types")
request["username"] = username
if (script_type == "ssh" and authtype == "password") or script_type == "telnet":
- if password is None:
- self._module.fail_json(changed=False, msg="password must be provided for telnet script type or ssh script type with password autheype")
request["password"] = password
if port is not None:
request["port"] = port
@@ -317,6 +309,9 @@ class Script(ZabbixBase):
if script_type == "webhook":
request["timeout"] = script_timeout
if parameters:
+ for parameter in parameters:
+ if "name" not in parameter.keys() or parameter["name"] is None:
+ self._module.fail_json(msg="When providing parameters to a webhook script, the 'name' option is required.")
request["parameters"] = parameters
return request
@@ -347,56 +342,59 @@ def main():
name=dict(type="str", required=True),
script_type=dict(
type="str",
- required=True,
choices=["script", "ipmi", "ssh", "telnet", "webhook"]),
- command=dict(type="str", required=True),
+ command=dict(type="str"),
scope=dict(
type="str",
- required=False,
choices=["action_operation", "manual_host_action", "manual_event_action"],
default="action_operation"),
execute_on=dict(
type="str",
- required=False,
choices=["zabbix_agent", "zabbix_server", "zabbix_server_proxy"],
default="zabbix_server_proxy"),
- menu_path=dict(type="str", required=False),
+ menu_path=dict(type="str"),
authtype=dict(
type="str",
- required=False,
choices=["password", "public_key"]),
- username=dict(type="str", required=False),
- password=dict(type="str", required=False, no_log=True),
- publickey=dict(type="str", required=False),
- privatekey=dict(type="str", required=False, no_log=True),
- port=dict(type="str", required=False),
- host_group=dict(type="str", required=False, default="all"),
- user_group=dict(type="str", required=False, default="all"),
+ username=dict(type="str"),
+ password=dict(type="str", no_log=True),
+ publickey=dict(type="str"),
+ privatekey=dict(type="str", no_log=True),
+ port=dict(type="str"),
+ host_group=dict(type="str", default="all"),
+ user_group=dict(type="str", default="all"),
host_access=dict(
type="str",
- required=False,
choices=["read", "write"],
default="read"),
- confirmation=dict(type="str", required=False),
- script_timeout=dict(type="str", default="30s", required=False),
+ confirmation=dict(type="str"),
+ script_timeout=dict(type="str", default="30s"),
parameters=dict(
type="list",
elements="dict",
options=dict(
- name=dict(type="str", required=True),
- value=dict(type="str", required=False, default="")
+ name=dict(type="str"),
+ value=dict(type="str", default="")
)
),
- description=dict(type="str", required=False),
+ description=dict(type="str"),
state=dict(
type="str",
- required=False,
default="present",
choices=["present", "absent"])
))
+ required_if = [
+ ("state", "present", ("script_type", "command",)),
+ ("script_type", "ssh", ("authtype", "username",)),
+ ("authtype", "password", ("password",)),
+ ("authtype", "public_key", ("publickey", "privatekey",)),
+ ("script_type", "telnet", ("username", "password")),
+ ]
+
module = AnsibleModule(
argument_spec=argument_spec,
+ required_if=required_if,
supports_check_mode=True
)
diff --git a/ansible_collections/community/zabbix/plugins/modules/zabbix_trigger.py b/ansible_collections/community/zabbix/plugins/modules/zabbix_trigger.py
new file mode 100644
index 000000000..9a84448c6
--- /dev/null
+++ b/ansible_collections/community/zabbix/plugins/modules/zabbix_trigger.py
@@ -0,0 +1,444 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+from __future__ import absolute_import, division, print_function
+__metaclass__ = type
+
+
+DOCUMENTATION = r'''
+---
+module: zabbix_trigger
+short_description: Create/delete Zabbix triggers
+description:
+ - Create triggers if they do not exist.
+ - Delete existing triggers if they exist.
+author:
+ - "Andrew Lathrop (@aplathrop)"
+requirements:
+ - "python >= 2.6"
+
+options:
+ state:
+ description:
+ - Create or delete trigger.
+ required: false
+ type: str
+ default: "present"
+ choices: [ "present", "absent" ]
+ name:
+ description:
+ - Name of trigger to create or delete.
+ - Overrides "description" in API docs.
+ - Cannot be changed. If a trigger's name needs to be changed, it needs to deleted and recreated
+ required: true
+ type: str
+ host_name:
+ description:
+ - Name of host to add trigger to.
+ - Required when I(template_name) is not used.
+ - Mutually exclusive with I(template_name).
+ required: false
+ type: str
+ template_name:
+ description:
+ - Name of template to add trigger to.
+ - Required when I(host_name) is not used.
+ - Mutually exclusive with I(host_name).
+ required: false
+ type: str
+ desc:
+ description:
+ - Additional description of the trigger.
+ - Overrides "comments" in API docs.
+ required: false
+ type: str
+ aliases: [ "description" ]
+ dependencies:
+ description:
+ - list of triggers that this trigger is dependent on
+ required: false
+ type: list
+ elements: dict
+ suboptions:
+ name:
+ description:
+ - Name of dependent trigger.
+ required: true
+ type: str
+ host_name:
+ description:
+ - Name of host containing dependent trigger.
+ - Required when I(template_name) is not used.
+ - Mutually exclusive with I(template_name).
+ required: false
+ type: str
+ template_name:
+ description:
+ - Name of template containing dependent trigger.
+ - Required when I(host_name) is not used.
+ - Mutually exclusive with I(host_name).
+ required: false
+ type: str
+ params:
+ description:
+ - Parameters to create/update trigger with.
+ - Required if state is "present".
+ - Parameters as defined at https://www.zabbix.com/documentation/current/en/manual/api/reference/trigger/object
+ - Additionally supported parameters are below.
+ required: false
+ type: dict
+ suboptions:
+ severity:
+ description:
+ - Severity of the trigger.
+ - Alias for "priority" in API docs.
+ required: false
+ type: str
+ aliases: [ "priority" ]
+ choices:
+ - not_classified
+ - information
+ - warning
+ - average
+ - high
+ - disaster
+ status:
+ description:
+ - Status of the trigger.
+ required: false
+ type: str
+ choices: [ "enabled", "disabled" ]
+ enabled:
+ description:
+ - Status of the trigger.
+ - Overrides "status" in API docs.
+ required: false
+ type: bool
+ generate_multiple_events:
+ description:
+ - Whether the trigger can generate multiple problem events.
+ - Alias for "type" in API docs.
+ required: false
+ type: bool
+ recovery_mode:
+ description:
+ - OK event generation mode.
+ - Overrides "recovery_mode" in API docs.
+ required: false
+ type: str
+ choices:
+ - expression
+ - recovery_expression
+ - none
+ correlation_mode:
+ description:
+ - OK event closes.
+ - Overrides "correlation_mode" in API docs.
+ required: false
+ type: str
+ choices: [ "all", "tag" ]
+ manual_close:
+ description:
+ - Allow manual close.
+ - Overrides "manual_close" in API docs.
+ required: false
+ type: bool
+
+extends_documentation_fragment:
+- community.zabbix.zabbix
+'''
+
+EXAMPLES = r'''
+
+# If you want to use Username and Password to be authenticated by Zabbix Server
+- name: Set credentials to access Zabbix Server API
+ ansible.builtin.set_fact:
+ ansible_user: Admin
+ ansible_httpapi_pass: zabbix
+
+# If you want to use API token to be authenticated by Zabbix Server
+# https://www.zabbix.com/documentation/current/en/manual/web_interface/frontend_sections/administration/general#api-tokens
+- name: Set API token
+ ansible.builtin.set_fact:
+ ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
+
+# Create ping trigger on example_host
+- name: create ping trigger
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_trigger:
+ name: agent_ping
+ host_name: example_host
+ params:
+ severity: high
+ expression: 'nodata(/example_host/agent.ping,1m)=1'
+ manual_close: True
+ enabled: True
+ state: present
+
+# Create ping trigger on example_template
+- name: create ping trigger
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_trigger:
+ name: agent_ping
+ host_name: example_template
+ params:
+ severity: high
+ expression: 'nodata(/example_template/agent.ping,1m)=1'
+ manual_close: True
+ enabled: True
+ state: present
+
+# Add tags to the existing Zabbix trigger
+- name: update ping trigger
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_trigger:
+ name: agent_ping
+ host_name: example_template
+ params:
+ severity: high
+ expression: 'nodata(/example_template/agent.ping,1m)=1'
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: class
+ value: application
+ state: present
+
+# delete Zabbix trigger
+- name: delete ping trigger
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_trigger:
+ name: agent_ping
+ host_name: example_template
+ state: absent
+'''
+
+from ansible.module_utils.basic import AnsibleModule
+
+from ansible_collections.community.zabbix.plugins.module_utils.base import ZabbixBase
+import ansible_collections.community.zabbix.plugins.module_utils.helpers as zabbix_utils
+
+
+class Trigger(ZabbixBase):
+
+ PRIORITY_TYPES = {'not_classified': 0,
+ 'information': 1,
+ 'warning': 2,
+ 'average': 3,
+ 'high': 4,
+ 'disaster': 5}
+
+ RECOVERY_MODES = {'expression': 0,
+ 'recovery_expression': 1,
+ 'none': 2}
+
+ def get_triggers(self, trigger_name, host_name, template_name):
+ if host_name is not None:
+ host = host_name
+ else:
+ host = template_name
+ triggers = []
+ try:
+ triggers = self._zapi.trigger.get({'filter': {'description': trigger_name, 'host': host}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get trigger: %s" % e)
+ return triggers
+
+ def sanitize_params(self, name, params, desc=None, dependencies=None):
+ params['description'] = name
+ if desc is not None:
+ params['comments'] = desc
+ if 'severity' in params:
+ params['priority'] = params['severity']
+ params.pop("severity")
+ if 'priority' in params:
+ priority_id = self.PRIORITY_TYPES[params['priority']]
+ params['priority'] = priority_id
+ if 'enabled' in params:
+ if params['enabled']:
+ params['status'] = 'enabled'
+ else:
+ params['status'] = 'disabled'
+ params.pop("enabled")
+ if 'status' in params:
+ status = params['status']
+ if status == 'enabled':
+ params['status'] = 0
+ elif status == 'disabled':
+ params['status'] = 1
+ else:
+ self._module.fail_json(msg="Status must be 'enabled' or 'disabled', got %s" % status)
+ if 'generate_multiple_events' in params:
+ multiple_event_type = params['generate_multiple_events']
+ if multiple_event_type:
+ params['type'] = 1
+ else:
+ params['type'] = 0
+ if 'recovery_mode' in params:
+ recovery_mode_id = self.RECOVERY_MODES[params['recovery_mode']]
+ params['recovery_mode'] = recovery_mode_id
+ if 'correlation_mode' in params:
+ correlation_mode = params['correlation_mode']
+ if correlation_mode == 'all':
+ params['correlation_mode'] = 0
+ elif correlation_mode == 'tag':
+ params['correlation_mode'] = 1
+ else:
+ self._module.fail_json(msg="correlation_mode must be all or tag, got %s" % correlation_mode)
+ if 'manual_close' in params:
+ manual_close = params['manual_close']
+ if manual_close:
+ params['manual_close'] = 1
+ else:
+ params['manual_close'] = 0
+ if dependencies is not None:
+ params['dependencies'] = []
+ for dependency in dependencies:
+ host_name = None
+ template_name = None
+ if 'host_name' in dependency:
+ host_name = dependency
+ elif 'template_name' in dependency:
+ template_name = dependency
+ else:
+ self._module.fail_json(msg="Each dependency must contain either the host_name or the template_name")
+ triggers = self.get_triggers(dependency['name'], host_name, template_name)
+ for trigger in triggers:
+ params['dependencies'].append({'triggerid': trigger['triggerid']})
+
+ def add_trigger(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.trigger.create(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to create trigger: %s" % e)
+ return results
+
+ def update_trigger(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.trigger.update(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to update trigger: %s" % e)
+ return results
+
+ def check_trigger_changed(self, old_trigger):
+ try:
+ new_trigger = self._zapi.trigger.get({"triggerids": "%s" % old_trigger['triggerid']})[0]
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get trigger: %s" % e)
+ return old_trigger != new_trigger
+
+ def delete_trigger(self, trigger_id):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.trigger.delete(trigger_id)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to delete trigger: %s" % e)
+ return results
+
+
+def main():
+ argument_spec = zabbix_utils.zabbix_common_argument_spec()
+ argument_spec.update(dict(
+ name=dict(type='str', required=True),
+ host_name=dict(type='str', required=False),
+ template_name=dict(type='str', required=False),
+ params=dict(type='dict', required=False),
+ desc=dict(type='str', required=False, aliases=['description']),
+ dependencies=dict(type='list', elements='dict', required=False),
+ state=dict(type='str', default="present", choices=['present', 'absent']),
+ ))
+ module = AnsibleModule(
+ argument_spec=argument_spec,
+ required_one_of=[
+ ['host_name', 'template_name']
+ ],
+ mutually_exclusive=[
+ ['host_name', 'template_name']
+ ],
+ required_if=[
+ ['state', 'present', ['params']]
+ ],
+ supports_check_mode=True
+ )
+
+ name = module.params['name']
+ host_name = module.params['host_name']
+ template_name = module.params['template_name']
+ params = module.params['params']
+ desc = module.params['desc']
+ dependencies = module.params['dependencies']
+ state = module.params['state']
+
+ trigger = Trigger(module)
+
+ if state == "absent":
+ triggers = trigger.get_triggers(name, host_name, template_name)
+ if len(triggers) == 0:
+ module.exit_json(changed=False, result="No trigger to delete.")
+ else:
+ delete_ids = []
+ for t in triggers:
+ delete_ids.append(t['triggerid'])
+ results = trigger.delete_trigger(delete_ids)
+ module.exit_json(changed=True, result=results)
+
+ elif state == "present":
+ trigger.sanitize_params(name, params, desc, dependencies)
+ triggers = trigger.get_triggers(name, host_name, template_name)
+ if len(triggers) == 0:
+ results = trigger.add_trigger(params)
+ module.exit_json(changed=True, result=results)
+ else:
+ results = []
+ changed = False
+ for t in triggers:
+ params['triggerid'] = t['triggerid']
+ params.pop('description')
+ results.append(trigger.update_trigger(params))
+ changed_trigger = trigger.check_trigger_changed(t)
+ if changed_trigger:
+ changed = True
+ module.exit_json(changed=changed, result=results)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible_collections/community/zabbix/plugins/modules/zabbix_triggerprototype.py b/ansible_collections/community/zabbix/plugins/modules/zabbix_triggerprototype.py
new file mode 100644
index 000000000..410955be9
--- /dev/null
+++ b/ansible_collections/community/zabbix/plugins/modules/zabbix_triggerprototype.py
@@ -0,0 +1,448 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+from __future__ import absolute_import, division, print_function
+__metaclass__ = type
+
+
+DOCUMENTATION = r'''
+---
+module: zabbix_triggerprototype
+short_description: Create/delete Zabbix triggerprototypes
+description:
+ - Create triggerprototypes if they do not exist.
+ - Delete existing triggerprototypes if they exist.
+author:
+ - "Andrew Lathrop (@aplathrop)"
+requirements:
+ - "python >= 2.6"
+
+options:
+ state:
+ description:
+ - Create or delete trigger prototype.
+ required: false
+ type: str
+ default: "present"
+ choices: [ "present", "absent" ]
+ name:
+ description:
+ - Name of trigger prototype to create or delete.
+ - Overrides "description" in API docs.
+ - Cannot be changed. If a trigger prototype's name needs to be changed, it needs to deleted and recreated
+ required: true
+ type: str
+ host_name:
+ description:
+ - Name of host to add trigger prototype to.
+ - Required when I(template_name) is not used.
+ - Mutually exclusive with I(template_name).
+ required: false
+ type: str
+ template_name:
+ description:
+ - Name of template to add trigger prototype to.
+ - Required when I(host_name) is not used.
+ - Mutually exclusive with I(host_name).
+ required: false
+ type: str
+ desc:
+ description:
+ - Additional description of the trigger prototype.
+ - Overrides "comments" in API docs.
+ required: false
+ type: str
+ aliases: [ "description" ]
+ dependencies:
+ description:
+ - list of trigger prototypes that this trigger prototype is dependent on
+ required: false
+ type: list
+ elements: dict
+ suboptions:
+ name:
+ description:
+ - Name of dependent trigger.
+ required: true
+ type: str
+ host_name:
+ description:
+ - Name of host containing dependent trigger.
+ - Required when I(template_name) is not used.
+ - Mutually exclusive with I(template_name).
+ required: false
+ type: str
+ template_name:
+ description:
+ - Name of template containing dependent trigger.
+ - Required when I(host_name) is not used.
+ - Mutually exclusive with I(host_name).
+ required: false
+ type: str
+
+ params:
+ description:
+ - Parameters to create/update trigger prototype with.
+ - Required if state is "present".
+ - Parameters as defined at https://www.zabbix.com/documentation/current/en/manual/api/reference/triggerprototype/object
+ - Additionally supported parameters are below.
+ required: false
+ type: dict
+ suboptions:
+ severity:
+ description:
+ - Severity of the trigger prototype.
+ - Alias for "priority" in API docs.
+ required: false
+ type: str
+ aliases: [ "priority" ]
+ choices:
+ - not_classified
+ - information
+ - warning
+ - average
+ - high
+ - disaster
+ status:
+ description:
+ - Status of the trigger prototype.
+ required: false
+ type: str
+ choices: [ "enabled", "disabled" ]
+ enabled:
+ description:
+ - Status of the trigger prototype.
+ - Overrides "status" in API docs.
+ required: false
+ type: bool
+ generate_multiple_events:
+ description:
+ - Whether the trigger prototype can generate multiple problem events.
+ - Alias for "type" in API docs.
+ required: false
+ type: bool
+ recovery_mode:
+ description:
+ - OK event generation mode.
+ - Overrides "recovery_mode" in API docs.
+ required: false
+ type: str
+ choices:
+ - expression
+ - recovery_expression
+ - none
+ correlation_mode:
+ description:
+ - OK event closes.
+ - Overrides "correlation_mode" in API docs.
+ required: false
+ type: str
+ choices: [ "all", "tag" ]
+ manual_close:
+ description:
+ - Allow manual close.
+ - Overrides "manual_close" in API docs.
+ required: false
+ type: bool
+
+extends_documentation_fragment:
+- community.zabbix.zabbix
+'''
+
+EXAMPLES = r'''
+
+# If you want to use Username and Password to be authenticated by Zabbix Server
+- name: Set credentials to access Zabbix Server API
+ ansible.builtin.set_fact:
+ ansible_user: Admin
+ ansible_httpapi_pass: zabbix
+
+# If you want to use API token to be authenticated by Zabbix Server
+# https://www.zabbix.com/documentation/current/en/manual/web_interface/frontend_sections/administration/general#api-tokens
+- name: Set API token
+ ansible.builtin.set_fact:
+ ansible_zabbix_auth_key: 8ec0d52432c15c91fcafe9888500cf9a607f44091ab554dbee860f6b44fac895
+
+# Create trigger prototype on example_host using example_rule
+- name: create trigger prototype
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ host_name: example_host
+ params:
+ severity: high
+ expression: "{% raw %}last(/example_host/vfs.fs.size[{#FSNAME}, pused])>80{% endraw %}"
+ recovery_mode: none
+ manual_close: True
+ enabled: True
+ state: present
+
+# Create trigger prototype on example_template using example_rule
+- name: create trigger prototype
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ template_name: example_template
+ params:
+ severity: high
+ expression: "{% raw %}last(/example_host/vfs.fs.size[{#FSNAME}, pused])>80{% endraw %}"
+ recovery_mode: none
+ manual_close: True
+ enabled: True
+ state: present
+
+# Add tags to the existing Zabbix trigger prototype
+- name: update trigger prototype
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ template_name: example_template
+ params:
+ severity: high
+ expression: "{% raw %}last(/example_host/vfs.fs.size[{#FSNAME}, pused])>80{% endraw %}"
+ recovery_mode: none
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: class
+ value: application
+ state: present
+
+# Delete Zabbix trigger prototype
+- name: delete trigger prototype
+ # set task level variables as we change ansible_connection plugin here
+ vars:
+ ansible_network_os: community.zabbix.zabbix
+ ansible_connection: httpapi
+ ansible_httpapi_port: 443
+ ansible_httpapi_use_ssl: true
+ ansible_httpapi_validate_certs: false
+ ansible_zabbix_url_path: 'zabbixeu' # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
+ ansible_host: zabbix-example-fqdn.org
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ template_name: example_template
+ state: absent
+'''
+
+from ansible.module_utils.basic import AnsibleModule
+
+from ansible_collections.community.zabbix.plugins.module_utils.base import ZabbixBase
+import ansible_collections.community.zabbix.plugins.module_utils.helpers as zabbix_utils
+
+
+class Triggerprototype(ZabbixBase):
+
+ PRIORITY_TYPES = {'not_classified': 0,
+ 'information': 1,
+ 'warning': 2,
+ 'average': 3,
+ 'high': 4,
+ 'disaster': 5}
+
+ RECOVERY_MODES = {'expression': 0,
+ 'recovery_expression': 1,
+ 'none': 2}
+
+ def get_triggerprototypes(self, triggerprototype_name, host_name, template_name):
+ if host_name is not None:
+ host = host_name
+ else:
+ host = template_name
+ triggerprototypes = []
+ try:
+ triggerprototypes = self._zapi.triggerprototype.get({'filter': {'description': triggerprototype_name, 'host': host}})
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get triggerprototype: %s" % e)
+ return triggerprototypes
+
+ def sanitize_params(self, name, params, desc=None, dependencies=None):
+ params['description'] = name
+ if desc is not None:
+ params['comments'] = desc
+ if 'severity' in params:
+ params['priority'] = params['severity']
+ params.pop('severity')
+ if 'priority' in params:
+ priority_id = self.PRIORITY_TYPES[params['priority']]
+ params['priority'] = priority_id
+ if 'enabled' in params:
+ if params['enabled']:
+ params['status'] = 'enabled'
+ else:
+ params['status'] = 'disabled'
+ params.pop('enabled')
+ if 'status' in params:
+ status = params['status']
+ if status == 'enabled':
+ params['status'] = 0
+ elif status == 'disabled':
+ params['status'] = 1
+ else:
+ self._module.fail_json(msg="Status must be 'enabled' or 'disabled', got %s" % status)
+ if 'generate_multiple_events' in params:
+ multiple_event_type = params['generate_multiple_events']
+ if multiple_event_type:
+ params['type'] = 1
+ else:
+ params['type'] = 0
+ if 'recovery_mode' in params:
+ recovery_mode_id = self.RECOVERY_MODES[params['recovery_mode']]
+ params['recovery_mode'] = recovery_mode_id
+ if 'correlation_mode' in params:
+ correlation_mode = params['correlation_mode']
+ if correlation_mode == 'all':
+ params['correlation_mode'] = 0
+ elif correlation_mode == 'tag':
+ params['correlation_mode'] = 1
+ else:
+ self._module.fail_json(msg="correlation_mode must be all or tag, got %s" % correlation_mode)
+ if 'manual_close' in params:
+ manual_close = params['manual_close']
+ if manual_close:
+ params['manual_close'] = 1
+ else:
+ params['manual_close'] = 0
+ if dependencies is not None:
+ params['dependencies'] = []
+ for dependency in dependencies:
+ host_name = None
+ template_name = None
+ if 'host_name' in dependency:
+ host_name = dependency
+ elif 'template_name' in dependency:
+ template_name = dependency
+ else:
+ self._module.fail_json(msg="Each dependency must contain either the host_name or the template_name")
+ triggers = self.get_triggerprototypes(dependency['name'], host_name, template_name)
+ for trigger in triggers:
+ params['dependencies'].append({'triggerid': trigger['triggerid']})
+
+ def add_triggerprototype(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.triggerprototype.create(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to create triggerprototype: %s" % e)
+ return results
+
+ def update_triggerprototype(self, params):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.triggerprototype.update(params)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to update triggerprototype: %s" % e)
+ return results
+
+ def check_triggerprototype_changed(self, old_triggerprototype):
+ try:
+ new_triggerprototype = self._zapi.triggerprototype.get({'triggerids': '%s' % old_triggerprototype['triggerid']})[0]
+ except Exception as e:
+ self._module.fail_json(msg="Failed to get triggerprototype: %s" % e)
+ return old_triggerprototype != new_triggerprototype
+
+ def delete_triggerprototype(self, trigger_id):
+ if self._module.check_mode:
+ self._module.exit_json(changed=True)
+ try:
+ results = self._zapi.triggerprototype.delete(trigger_id)
+ except Exception as e:
+ self._module.fail_json(msg="Failed to delete triggerprototype: %s" % e)
+ return results
+
+
+def main():
+ argument_spec = zabbix_utils.zabbix_common_argument_spec()
+ argument_spec.update(dict(
+ name=dict(type='str', required=True),
+ host_name=dict(type='str', required=False),
+ template_name=dict(type='str', required=False),
+ params=dict(type='dict', required=False),
+ desc=dict(type='str', required=False, aliases=['description']),
+ dependencies=dict(type='list', elements='dict', required=False),
+ state=dict(type='str', default="present", choices=['present', 'absent']),
+ ))
+ module = AnsibleModule(
+ argument_spec=argument_spec,
+ required_one_of=[
+ ['host_name', 'template_name']
+ ],
+ mutually_exclusive=[
+ ['host_name', 'template_name']
+ ],
+ required_if=[
+ ['state', 'present', ['params']]
+ ],
+ supports_check_mode=True
+ )
+
+ name = module.params['name']
+ host_name = module.params['host_name']
+ template_name = module.params['template_name']
+ params = module.params['params']
+ desc = module.params['desc']
+ dependencies = module.params['dependencies']
+ state = module.params['state']
+
+ triggerprototype = Triggerprototype(module)
+
+ if state == "absent":
+ triggerprototypes = triggerprototype.get_triggerprototypes(name, host_name, template_name)
+ if len(triggerprototypes) == 0:
+ module.exit_json(changed=False, result="No triggerprototype to delete.")
+ else:
+ delete_ids = []
+ for t in triggerprototypes:
+ delete_ids.append(t['triggerid'])
+ results = triggerprototype.delete_triggerprototype(delete_ids)
+ module.exit_json(changed=True, result=results)
+
+ elif state == "present":
+ triggerprototype.sanitize_params(name, params, desc, dependencies)
+ triggerprototypes = triggerprototype.get_triggerprototypes(name, host_name, template_name)
+ if len(triggerprototypes) == 0:
+ results = triggerprototype.add_triggerprototype(params)
+ module.exit_json(changed=True, result=results)
+ else:
+ results = []
+ changed = False
+ for t in triggerprototypes:
+ params['triggerid'] = t['triggerid']
+ params.pop('description')
+ results.append(triggerprototype.update_triggerprototype(params))
+ changed_trigger = triggerprototype.check_triggerprototype_changed(t)
+ if changed_trigger:
+ changed = True
+ module.exit_json(changed=changed, result=results)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/README.md b/ansible_collections/community/zabbix/roles/zabbix_agent/README.md
index fe4a601b3..f9a2fb5a5 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/README.md
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/README.md
@@ -28,7 +28,6 @@
* [proxy](#proxy)
- [Dependencies](#dependencies)
- [Example Playbook](#example-playbook)
- * [zabbix_agent2_plugins](#zabbix-agent2-plugins)
* [agent_interfaces](#agent-interfaces)
* [Other interfaces](#other-interfaces)
* [Vars in role configuration](#vars-in-role-configuration)
@@ -95,6 +94,7 @@ See the following list of supported Operating systems with the Zabbix releases:
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Red Hat Fam 7 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | V | V | V |
@@ -104,24 +104,6 @@ See the following list of supported Operating systems with the Zabbix releases:
You can bypass this matrix by setting `enable_version_check: false`
-# Getting started
-
-## Minimal Configuration
-
-In order to get the Zabbix Agent running, you'll have to define the following properties before executing the role:
-
-* `zabbix_agent_version`
-* `zabbix_agent(2)_server`
-* `zabbix_agent(2)_serveractive` (When using active checks)
-
-The `zabbix_agent_version` is optional. The latest available major.minor version of Zabbix will be installed on the host(s). If you want to use an older version, please specify this in the major.minor format. Example: `zabbix_agent_version: 6.0`.
-
-The `zabbix_agent(2)_server` (and `zabbix_agent(2)_serveractive`) should contain the ip or fqdn of the host running the Zabbix Server.
-
-## Issues
-
-Due to issue discussed on [#291](https://github.com/dj-wasabi/ansible-zabbix-agent/issues/291), the Ansible Version 2.9.{0,1,2} isn't working correctly on Windows related targets.
-
# Role Variables
## Main variables
@@ -133,114 +115,66 @@ The following is an overview of all available configuration default for this rol
* `zabbix_agent_version`: This is the version of zabbix. Default: The highest supported version for the operating system. Can be overridden to 6.4, 6.2, or 6.0
* `zabbix_agent_version_minor`: When you want to specify a minor version to be installed. Is also used for `zabbix_sender` and `zabbix_get`. RedHat only. Default set to: `*` (latest available)
* `zabbix_repo_yum`: A list with Yum repository configuration.
+* `zabbix_repo_yum_gpgcheck`: If Yum should check GPG keys on installation
* `zabbix_repo_yum_schema`: Default: `https`. Option to change the web schema for the yum repository(http/https)
* `zabbix_agent_disable_repo`: A list of repos to disable during install. Default `epel`.
* `zabbix_repo_deb_url`: The URL to the Zabbix repository. Default `http://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/{{ ansible_distribution.lower() }}`
* `zabbix_repo_deb_component`: The repository component for Debian installs. Default `main`.
-* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key`.
+* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key.
* `zabbix_repo_deb_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default `true`.
### SElinux
* `zabbix_selinux`: Default: `False`. Enables an SELinux policy so that the server will run.
+* `selinux_allow_zabbix_run_sudo`: Default: `False`. Enable Zabbix root access on system.
### Zabbix Agent
-* `zabbix_agent_ip`: The IP address of the host. When not provided, it will be determined via the `ansible_default_ipv4` fact.
* `zabbix_agent2`: Default: `False`. When you want to install the `Zabbix Agent2` instead of the "old" `Zabbix Agent`.zabbix_agent_version
+* `zabbix_agent_apt_priority`: Add a weight (`Pin-Priority`) for the APT repository.
+* `zabbix_agent_chassis`: Default: `false`. When set to `true`, it will give Zabbix Agent access to the Linux DMI table allowing system.hw.chassis info to populate.
+* `zabbix_agent_conf_mode`: Default: `0644`. The "mode" for the Zabbix configuration file.
+* `zabbix_agent_dont_detect_ip`: Default `false`. When set to `true`, it won't detect available ip addresses on the host and no need for the Python module `netaddr` to be installed.
+* `zabbix_agent_get_package`: The name of the zabbix-get package. Default: `zabbix-get`.
+* `zabbix_agent_include_mode`: The mode for the directory mentioned above.
+* `zabbix_agent_install_agent_only`: Only install the Zabbix Agent and not the `zabbix-sender` and `zabbix-get` packages. Default: `False`
* `zabbix_agent_listeninterface`: Interface zabbix-agent listens on. Leave blank for all.
* `zabbix_agent_package_remove`: If `zabbix_agent2: True` and you want to remove the old installation. Default: `False`.
-* `zabbix_agent_package`: The name of the zabbix-agent package. Default: `zabbix-agent`. In case for EPEL, it is automatically renamed.
-* `zabbix_sender_package`: The name of the zabbix-sender package. Default: `zabbix-sender`. In case for EPEL, it is automatically renamed.
-* `zabbix_get_package`: The name of the zabbix-get package. Default: `zabbix-get`. In case for EPEL, it is automatically renamed.
-* `zabbix_agent_package_state`: If Zabbix-agent needs to be `present` or `latest`.
-* `zabbix_agent_interfaces`: A list that configured the interfaces you can use when configuring via API.
-* `zabbix_agent_install_agent_only`: Only install the Zabbix Agent and not the `zabbix-sender` and `zabbix-get` packages. Default: `False`
+* `zabbix_agent_package_state`: If Zabbix-agent needs to be `present` (default) or `latest`.
+* `zabbix_agent_package`: The name of the zabbix-agent package. Default: `zabbix-agent` if `zabbix_agent2` is fale and `zabbix-agent2` if `true`.
+* `zabbix_agent_sender_package`: The name of the zabbix-sender package. Default: `zabbix-sender`.
* `zabbix_agent_userparameters`: Default: `[]]`. List of userparameter names and scripts (if any). Detailed description is given in the [Deploying Userparameters](#deploying-userparameters) section.
- * `name`: Userparameter name (should be the same with userparameter template file name)
- * `scripts_dir`: Directory name of the custom scripts needed for userparameters
-* `zabbix_agent_userparameters_templates_src`: indicates the relative path (from `templates/`) where userparameter templates are searched
+ * `name`: Userparameter name (should be the same with userparameter template file name)
+ * `scripts_dir`: Directory name of the custom scripts needed for userparameters
* `zabbix_agent_userparameters_scripts_src`: indicates the relative path (from `files/`) where userparameter scripts are searched
-* `zabbix_agent_runas_user`: Drop privileges to a specific, existing user on the system. Only has effect if run as 'root' and AllowRoot is disabled.
-* `zabbix_agent_become_on_localhost`: Default: `True`. Set to `False` if you don't need to elevate privileges on localhost to install packages locally with pip.
-* `zabbix_agent_apt_priority`: Add a weight (`Pin-Priority`) for the APT repository.
-* `zabbix_agent_conf_mode`: Default: `0644`. The "mode" for the Zabbix configuration file.
-* `zabbix_agent_dont_detect_ip`: Default `false`. When set to `true`, it won't detect available ip addresses on the host and no need for the Python module `netaddr` to be installed.
-* `zabbix_agent_chassis`: Default: `false`. When set to `true`, it will give Zabbix Agent access to the Linux DMI table allowing system.hw.chassis info to populate.
-
-### Zabbix Agent vs Zabbix Agent 2 configuration
-
-The following provides an overview of all the properties that can be set in the Zabbix Agent configuration file. When `(2)` is used in the name of the property, like `zabbix_agent(2)_pidfile`, it will show that you can configure `zabbix_agent_pidfile` for the Zabbix Agent configuration file and `zabbix_agent2_pidfile` for the Zabbix Agent 2 configuration file.
-
-Otherwise it just for the Zabbix Agent or for the Zabbix Agent 2.
-
-* `zabbix_agent(2)_server`: The ip address for the zabbix-server or zabbix-proxy.
-* `zabbix_agent(2)_serveractive`: The ip address for the zabbix-server or zabbix-proxy for active checks.
-* `zabbix_agent(2)_allow_key`: list of AllowKey configurations.
-* `zabbix_agent(2)_deny_key`: list of DenyKey configurations.
-* `zabbix_agent(2)_pidfile`: name of pid file.
-* `zabbix_agent(2)_logfile`: name of log file.
-* `zabbix_agent(2)_logfilesize`: maximum size of log file in mb.
-* `zabbix_agent(2)_additional_include`: A list of additional complete paths to include in configuration
-* `zabbix_agent(2)_logtype`: Specifies where log messages are written to
-* `zabbix_agent(2)_debuglevel`: specifies debug level
-* `zabbix_agent(2)_sourceip`: source ip address for outgoing connections.
-* `zabbix_agent_enableremotecommands`: whether remote commands from zabbix server are allowed.
-* `zabbix_agent_logremotecommands`: enable logging of executed shell commands as warnings.
-* `zabbix_agent(2)_listenport`: agent will listen on this port for connections from the server.
-* `zabbix_agent2_statusport`: Agent will listen on this port for HTTP status requests.
-* `zabbix_agent(2)_listenip`: list of comma delimited ip addresses that the agent should listen on.
-* `zabbix_agent_startagents`: number of pre-forked instances of zabbix_agentd that process passive checks.
-* `zabbix_agent(2)_hostname`: unique, case sensitive hostname.
-* `zabbix_agent(2)_hostnameitem`: item used for generating hostname if it is undefined.
-* `zabbix_agent(2)_hostmetadata`: optional parameter that defines host metadata.
-* `zabbix_agent(2)_hostmetadataitem`: optional parameter that defines an item used for getting the metadata.
-* `zabbix_agent(2)_refreshactivechecks`: how often list of active checks is refreshed, in seconds.
-* `zabbix_agent(2)_buffersend`: do not keep data longer than n seconds in buffer.
-* `zabbix_agent(2)_buffersize`: maximum number of values in a memory buffer. the agent will send all collected data to zabbix server or proxy if the buffer is full.
-* `zabbix_agent2_enablepersistentbuffer`: 0 - disabled, in-memory buffer is used (default); 1 - use persistent buffer
-* `zabbix_agent2_persistentbufferperiod`: Zabbix Agent2 will keep data for this time period in case of no connectivity with Zabbix server or proxy. Older data will be lost. Log data will be preserved.
-* `zabbix_agent2_persistentbufferfile`: Zabbix Agent2 will keep SQLite database in this file * n is valid if `EnablePersistentBuffer=1`
-* `zabbix_agent_maxlinespersecond`: maximum number of new lines the agent will send per second to zabbix server or proxy processing 'log' and 'logrt' active checks.
-* `zabbix_agent_allowroot`: allow the agent to run as 'root'. if disabled and the agent is started by 'root', the agent will try to switch to user 'zabbix' instead. has no effect if started under a regular user.
-* `zabbix_agent(2)_zabbix_alias`: sets an alias for parameter. it can be useful to substitute long and complex parameter name with a smaller and simpler one. Can be both a string as an list.
-* `zabbix_agent(2)_timeout`: spend no more than timeout seconds on processing
-* `zabbix_agent(2)_include`: you may include individual files or all files in a directory in the configuration file.
-* `zabbix_agent(2)_include_pattern`: Optional file pattern used for included files.
-* `zabbix_agent(2)_include_mode`: The mode for the directory mentioned above.
-* `zabbix_agent(2)_unsafeuserparameters`: allow all characters to be passed in arguments to user-defined parameters.
-* `zabbix_agent_loadmodulepath`: Full path to location of agent modules.
-* `zabbix_agent_loadmodule`: Module to load at agent startup. Modules are used to extend functionality of the agent.
-* `zabbix_agent2_controlsocket`: The control socket, used to send runtime commands with '-R' option.
-* `zabbix_agent_allowroot`: Allow the agent to run as 'root'. 0 - do not allow, 1 - allow
-* `zabbix_agent2_plugins`: A list containing plugin configuration.
-* `zabbix_agent(2)_listenbacklog`: The maximum number of pending connections in the queue.
+* `zabbix_agent_userparameters_templates_src`: indicates the relative path (from `templates/`) where userparameter templates are searched
## TLS Specific configuration
+* `zabbix_agent_tlspsk_auto`: Enables auto generation and storing of individual pre-shared keys and identities on clients. Is false by default. If set to true and if `zabbix_agent_tlspskfile` and `zabbix_agent_tlspsk_secret` are undefined, it generates the files `/etc/zabbix/tls_psk_auto.identity` and `/etc/zabbix/tls_psk_auto.secret`, which are populated by values automatically (identity is set to hostname, underscore and 4 random alphanumeric digits; secret is 64 random alphanumeric digits) in such a way that the values are generated once and are never overwritten.
-These variables are specific for Zabbix 3.0 and higher. When `(2)` is used in the name of the property, like `zabbix_agent(2)_tlsconnect`, it will show that you can configure `zabbix_agent_tlsconnect` for the Zabbix Agent configuration file and `zabbix_agent2_tlsconnect` for the Zabbix Agent 2 configuration file.
-
-* `zabbix_agent(2)_tlsconnect`: How the agent should connect to server or proxy. Used for active checks.
+* `zabbix_agent_tlsconnect`: How the agent should connect to server or proxy. Used for active checks.
Possible values:
* unencrypted
* psk
* cert
-* `zabbix_agent(2)_tlsaccept`: What incoming connections to accept.
+* `zabbix_agent_tlsaccept`: What incoming connections to accept.
Possible values:
* unencrypted
* psk
* cert
-* `zabbix_agent(2)_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification.
-* `zabbix_agent(2)_tlscrlfile`: Full pathname of a file containing revoked certificates.
-* `zabbix_agent(2)_tlsservercertissuer`: Allowed server certificate issuer.
-* `zabbix_agent(2)_tlsservercertsubject`: Allowed server certificate subject.
-* `zabbix_agent(2)_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain.
-* `zabbix_agent(2)_tlskeyfile`: Full pathname of a file containing the agent private key.
-* `zabbix_agent(2)_tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key.
-* `zabbix_agent(2)_tlspskidentity_file`: Full pathname of a file containing the pre-shared key identity.
-* `zabbix_agent(2)_tlspskfile`: Full pathname of a file containing the pre-shared key.
-* `zabbix_agent(2)_tlspsk_secret`: The pre-shared secret key that should be placed in the file configured with `agent_tlspskfile`.
-* `zabbix_agent(2)_tlspsk_auto`: Enables auto generation and storing of individual pre-shared keys and identities on clients. Is false by default. If set to true and if `zabbix_agent_tlspskfile` and `zabbix_agent_tlspsk_secret` are undefined, it generates the files `/etc/zabbix/tls_psk_auto.identity` and `/etc/zabbix/tls_psk_auto.secret`, which are populated by values automatically (identity is set to hostname, underscore and 4 random alphanumeric digits; secret is 64 random alphanumeric digits) in such a way that the values are generated once and are never overwritten.
+
+* `zabbix_agent_tlscafile`: Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification.
+* `zabbix_agent_tlscertfile`: Full pathname of a file containing the agent certificate or certificate chain.
+* `zabbix_agent_tlscrlfile`: Full pathname of a file containing revoked certificates.
+* `zabbix_agent_tlskeyfile`: Full pathname of a file containing the agent private key.
+* `zabbix_agent_tlspskfile`: Full pathname of a file containing the pre-shared key.
+* `zabbix_agent_tlspskidentity`: Unique, case sensitive string used to identify the pre-shared key.
+* `zabbix_agent_tlspskidentity_file`: Full pathname of a file containing the pre-shared key identity.
+* `zabbix_agent_tlspsk_secret`: The pre-shared secret key for the agent.
+* `zabbix_agent_tlsservercertissuer`: Allowed server certificate issuer.
+* `zabbix_agent_tlsservercertsubject`: Allowed server certificate subject.
+* `zabbix_agent_tls_subject`: The subject of the TLS certificate.
+* `zabbix_agent_visible_hostname` : Configure Zabbix visible name inside Zabbix web UI for the node.
The results are stored in the Ansible variables `zabbix_agent_tlspskidentity` and `zabbix_agent_tlspsk_secret`, so that they may be used later in the code, for example with [zabbix_host](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_host_module.html) to configure the Zabbix server or with `debug: msg:` to display them to the user.
@@ -250,51 +184,49 @@ These variables need to be overridden when you want to make use of the Zabbix AP
Host encryption configuration will be set to match agent configuration.
-* `zabbix_api_server_host`: The IP or hostname/FQDN of Zabbix server. Example: zabbix.example.com
-* `zabbix_api_use_ssl`: Is SSL required to connect to the Zabbix API server? Default: `false`
-* `zabbix_api_server_port`: 80 if `zabbix_api_use_ssl` is `false` and 443 if `true` (Default) TCP port to use to connect to Zabbix server. Example: 8080
-* `zabbix_api_login_user`: Username of user which has API access.
-* `zabbix_api_login_pass`: Password for the user which has API access.
-* `zabbix_api_http_user`: The http user to access zabbix url with Basic Auth (if your Zabbix is behind a proxy with HTTP Basic Auth).
-* `zabbix_api_http_password`: The http password to access zabbix url with Basic Auth (if your Zabbix is behind a proxy with HTTP Basic Auth).
-* `zabbix_api_validate_certs`: yes (Default) if we need to validate tls certificates of the API. Use `no` in case self-signed certificates are used.
-* `zabbix_api_timeout`: How many seconds to wait for API response (default 30s).
-* `zabbix_api_create_hosts`: Default: `False`. When you want to enable the Zabbix API to create/delete the host. This has to be set to `True` if you want to make use of `zabbix_agent_host_state`.
-* `zabbix_api_create_hostgroup`: When you want to enable the Zabbix API to create/delete the hostgroups. This has to be set to `True` if you want to make use of `zabbix_agent_hostgroups_state`.Default: `False`
-* `ansible_zabbix_url_path`: URL path if Zabbix WebUI running on non-default (zabbix) path, e.g. if http://<FQDN>/zabbixeu then set to `zabbixeu`
-* `zabbix_agent_hostgroups_state`: present (Default) if the hostgroup needs to be created or absent if you want to delete it. This only works when `zabbix_api_create_hostgroup` is set to `True`.
-* `zabbix_host_status`: enabled (Default) when host in monitored, disabled when host is disabled for monitoring.
+* `zabbix_agent_description`: Description of the host in Zabbix.
* `zabbix_agent_host_state`: present (Default) if the host needs to be created or absent is you want to delete it. This only works when `zabbix_api_create_hosts` is set to `True`.
* `zabbix_agent_host_update`: yes (Default) if the host should be updated if already present. This only works when `zabbix_api_create_hosts` is set to `True`.
-* `zabbix_useuip`: 1 if connection to zabbix-agent is made via ip, 0 for fqdn.
-* `zabbix_host_groups`: A list of hostgroups which this host belongs to.
-* `zabbix_agent_link_templates`: A list of templates which needs to be link to this host. The templates should exist.
+* `zabbix_agent_interfaces`: A list of interfaces and their configurations you can use when configuring via API.
+* `zabbix_agent_inventory_mode`: Configure Zabbix inventory mode. Needed for building inventory data, manually when configuring a host or automatically by using some automatic population options. This has to be set to `automatic` if you want to make automatically building inventory data. Default `disabled`
+* `zabbix_agent_inventory_zabbix`: Adds Facts for a zabbix inventory. Default `{}`
+* `zabbix_agent_ip`: The IP address of the host. When not provided, it will be determined via the `ansible_default_ipv4` fact.
+* `zabbix_agent_link_templates`: A list of templates which needs to be link to this host. The templates should exist. Default: "Templated Linux by Zabbix agent"
* `zabbix_agent_macros`: A list with macro_key and macro_value for creating hostmacro's.
+* `zabbix_agent_proxy`: The name of the Zabbix proxy (if used). Default `null`
* `zabbix_agent_tags`: A list with tag and (optionally) value for creating host tags.
-* `zabbix_agent_inventory_mode`: Configure Zabbix inventory mode. Needed for building inventory data, manually when configuring a host or automatically by using some automatic population options. This has to be set to `automatic` if you want to make automatically building inventory data.
-* `zabbix_agent_visible_hostname` : Configure Zabbix visible name inside Zabbix web UI for the node.
-* `zabbix_agent_description`: Description of the host in Zabbix.
-* `zabbix_agent_inventory_zabbix`: Adds Facts for a zabbix inventory
+* `zabbix_api_create_hostgroup`: When you want to enable the Zabbix API to create/delete the hostgroups. Default: `False`
+* `zabbix_api_create_hosts`: Default: `False`. When you want to enable the Zabbix API to create/delete the host. This has to be set to `True` if you want to make use of `zabbix_agent_host_state`.
+* `zabbix_api_http_password`: The http password to access zabbix url with Basic Auth (if your Zabbix is behind a proxy with HTTP Basic Auth).
+* `zabbix_api_http_user`: The http user to access zabbix url with Basic Auth (if your Zabbix is behind a proxy with HTTP Basic Auth).
+* `zabbix_api_login_pass`: Password for the user which has API access.
+* `zabbix_api_login_user`: Username of user which has API access.
+* `zabbix_api_server_host`: The IP or hostname/FQDN of Zabbix server. Example: zabbix.example.com
+* `zabbix_api_server_port`: 80 if `zabbix_api_use_ssl` is `false` and 443 if `true` (Default) TCP port to use to connect to Zabbix server. Example: 8080
+* `zabbix_api_use_ssl`: Is SSL required to connect to the Zabbix API server? Default: `false`
+* `zabbix_api_validate_certs`: `True` if we need to validate tls certificates of the API. Use `False` in case self-signed certificates are used. Default: `False`
+* `zabbix_host_groups`: A list of hostgroups which this host belongs to. Default: "Linux Servers"
+* `zabbix_host_status`: enabled (Default) when host in monitored, disabled when host is disabled for monitoring.
+* `zabbix_useuip`: 1 if connection to zabbix-agent is made via ip, 0 for fqdn.
## Windows Variables
**NOTE**
-_Supporting Windows is a best effort (We don't have the possibility to either test/verify changes on the various amount of available Windows instances). PRs specific to Windows will almost immediately be merged, unless someone is able to provide a Windows test mechanism via Travis for Pull Requests._
-When `(2)` is used in the name of the property, like `zabbix_agent(2)_win_logfile`, it will show that you can configure `zabbix_agent_win_logfile` for the Zabbix Agent configuration file and `zabbix_agent2_win_logfile` for the Zabbix Agent 2 configuration file.
+Supporting Windows is a best effort (We don't have the possibility to either test/verify changes on the various amount of available Windows instances). PRs specific to Windows will almost immediately be merged, unless someone is able to provide a Windows test mechanism via Travis for Pull Requests._
+When `` is used in the name of the property, like `zabbix_agent_win_logfile`, it will show that you can configure `zabbix_agent_win_logfile` for the Zabbix Agent configuration file and `zabbix_agent2_win_logfile` for the Zabbix Agent 2 configuration file.
Otherwise it just for the Zabbix Agent or for the Zabbix Agent 2.
-* `zabbix(2)_win_package`: file name pattern (zip only). This will be used to generate the `zabbix(2)_win_download_link` variable.
-* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix(2)_win_package` and `zabbix(2)_win_download_link` variables. This takes precedence over `zabbix_agent_version`.
-* `zabbix(2)_win_download_link`: The download url to the `win.zip` file.
+* `zabbix_agent_win_include`: The directory in which the Zabbix Agent specific configuration files are stored.
+* `zabbix_agent_win_logfile`: The full path to the logfile for the Zabbix Agent.
+* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_win_package` and `zabbix_win_download_link` variables. This takes precedence over `zabbix_agent_version`.
+* `zabbix_win_download_link`: The download url to the `win.zip` file.
+* `zabbix_win_firewall_management`: Enable Windows firewall management (add service and port to allow rules). Default: `True`
* `zabbix_win_install_dir`: The directory where Zabbix needs to be installed.
* `zabbix_win_install_dir_conf`: The directory where Zabbix configuration file needs to be installed.
* `zabbix_win_install_dir_bin`: The directory where Zabbix binary file needs to be installed.
-* `zabbix_agent(2)_win_logfile`: The full path to the logfile for the Zabbix Agent.
-* `zabbix_agent_win_include`: The directory in which the Zabbix Agent specific configuration files are stored.
-* `zabbix_agent_win_svc_recovery`: Enable Zabbix Agent service auto-recovery settings.
-* `zabbix_win_firewall_management`: Enable Windows firewall management (add service and port to allow rules). Default: `True`
+* `zabbix_win_package`: file name pattern (zip only). This will be used to generate the `zabbix_win_download_link` variable.
## macOS Variables
@@ -302,8 +234,10 @@ Otherwise it just for the Zabbix Agent or for the Zabbix Agent 2.
_Supporting Windows is a best effort (We don't have the possibility to either test/verify changes on the various amount of available Windows instances). PRs specific to Windows will almost immediately be merged, unless someone is able to provide a Windows test mechanism via Travis for Pull Requests._
-* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_mac_download_link` link.
* `zabbix_mac_download_link`: The download url to the `pkg` file.
+* `zabbix_mac_download_url`: The download url. Default `https://cdn.zabbix.com/zabbix/binaries/stable`
+* `zabbix_mac_package`: The name of the mac install package. Default `zabbix_agent-{{ zabbix_version_long }}-macos-amd64-openssl.pkg`
+* `zabbix_version_long`: The long (major.minor.patch) version of the Zabbix Agent. This will be used to generate the `zabbix_mac_download_link` link.
## Docker Variables
@@ -324,19 +258,19 @@ The following directories are mounted in the Container:
Keep in mind that using the Zabbix Agent in a Container requires changes to the Zabbix Template for Linux as `/proc`, `/sys` and `/etc` are mounted in a directory `/hostfs`.
* `zabbix_agent_docker`: Default: `False`. When set to `True`, it will install a Docker container on the target host instead of installation on the target.
-* `zabbix_agent_docker_state`: Default: `started`
-* `zabbix_agent_docker_name`: The name of the Container. Default: `zabbix-agent`
+* `zabbix_agent_docker_env`: A dict with all environment variables that needs to be set for the Container.
* `zabbix_agent_docker_image`: The name of the Docker image. Default: `zabbix/zabbix-agent`
* `zabbix_agent_docker_image_tag`: The tag of the Docker image.
-* `zabbix_agent_docker_user_gid`: The group id of the zabbix user in the Container.
-* `zabbix_agent_docker_user_uid`: The user id of the zabbix user in the Container.
+* `zabbix_agent_docker_name`: The name of the Container. Default: `zabbix-agent`
* `zabbix_agent_docker_network_mode`: The name of the (Docker) network that should be used for the Container. Default `host`.
* `zabbix_agent_docker_restart_policy`: Default: `unless-stopped`. The restart policy of the Container.
-* `zabbix_agent_docker_privileged`: When set to `True`, the container is running in privileged mode.
-* `zabbix_agent_docker_ports`: A list with `<PORT>:<PORT>` values to open ports to the container.
+* `zabbix_agent_docker_ports`: A list with `<PORT>:<PORT>` values to open ports to the container. Default `10050`
+* `zabbix_agent_docker_privileged`: When set to `True`, the container is running in privileged mode. Default `false`
* `zabbix_agent_docker_security_opts`: A list with available security options.
+* `zabbix_agent_docker_state`: Default: `started`
+* `zabbix_agent_docker_user_gid`: The group id of the zabbix user in the Container.
+* `zabbix_agent_docker_user_uid`: The user id of the zabbix user in the Container.
* `zabbix_agent_docker_volumes`: A list with all directories that needs to be available in the Container.
-* `zabbix_agent_docker_env`: A dict with all environment variables that needs to be set for the Container.
## IPMI variables
@@ -345,6 +279,77 @@ Keep in mind that using the Zabbix Agent in a Container requires changes to the
* `zabbix_agent_ipmi_privilege`: IPMI privilege level. Possible values are 1 (callback), 2 (user), 3 (operator), 4 (admin), 5 (OEM), with 2 being the API default.
* `zabbix_agent_ipmi_username`: IPMI username.
+## Configuration Variables
+The following table lists all variables that are exposed to modify the configuration of the zabbix_agent.conf file. Specific details of each variable can be found in the Zabbix documentation.
+
+**NOTE**: Only variables with a default value appear in the defaults file, all others must be added.
+
+| Zabbix Name | Variable Name | Default Value | Notes |
+|-----------|------------------|--------|--------|
+| Alias | zabbix_agent_aliases | | Can be a string or list |
+| AllowKey | zabbix_agent_allowkeys | | |
+| AllowRoot | zabbix_agent_allowroot | | Linux Systems Only |
+| BufferSend | zabbix_agent_buffersend | 5 | |
+| BufferSize | zabbix_agent_buffersize | 100 | |
+| ControlSocket | zabbix_agent_controlsocket | /tmp/agent.sock | Agent 2 Only |
+| DebugLevel | zabbix_agent_debuglevel | 3 | |
+| DenyKey | zabbix_agent_denykeys | | Can be a string or a list |
+| EnableRemoteCommands | zabbix_agent_enableremotecommands | 0 | Agent Only |
+| ForceActiveChecksOnStart | zabbix_agent_forceactivechecksonstart | | Agent 2 Only |
+| HeartbeatFrequency | zabbix_agent_heartbeatfrequency | 60 | Version >= 6.2 |
+| HostInterface | zabbix_agent_hostinterface | | |
+| HostInterfaceItem | zabbix_agent_hostinterfaceitem | | |
+| HostMetadata | zabbix_agent_hostmetadata | | |
+| HostMetadataItem | zabbix_agent_hostmetadataitem | | |
+| Hostname | zabbix_agent_hostname | | `{{ inventory_hostname }}` |
+| HostnameItem | zabbix_agent_hostnameitem | | |
+| Include | zabbix_agent_include | /etc/zabbix/`{ agent version specific }`.d | |
+| ListenBacklog | zabbix_agent_listenbacklog | | Agent Only |
+| ListenIP | zabbix_agent_listenip | | list of IPs |
+| ListenPort | zabbix_agent_listenport | 10050 | |
+| LoadModule | zabbix_agent_loadmodule | | Agent On Linux Only |
+| LoadModulePath | zabbix_agent_loadmodulepath | | Agent On Linux Only |
+| LogFile | zabbix_agent_logfile | /var/log/zabbix/`{ agent version specific }`.log | |
+| LogFileSize | zabbix_agent_logfilesize | 100 | |
+| LogRemoteCommands | zabbix_agent_logremotecommands | | Agent Only |
+| LogType | zabbix_agent_logtype | file | |
+| MaxLinesPerSecond | zabbix_agent_maxlinespersecond | | Agent Only |
+| PerfCounter | zabbix_agent_perfcounter | | Agent Only |
+| PerfCounterEn | zabbix_agent_perfcounteren | | Agent Only |
+| PersistentBufferFile | zabbix_agent_persistentbufferfile | | Agent 2 Only |
+| PersistentBufferPeriod | zabbix_agent_persistentbufferperiod | 1h | Agent 2 Only |
+| PidFile | zabbix_agent_pidfile | /var/run/zabbix/`{ agent version specific }`.pid | Linux Systems Only |
+| Plugin | zabbix_agent_plugins | | |
+| PluginSocket | zabbix_agent_pluginsocket | | |
+| PluginTimeout | zabbix_agent_plugintimeout | | |
+| RefreshActiveChecks | zabbix_agent_refreshactivechecks | 120 | |
+| Server | zabbix_agent_server | | |
+| ServerActive | zabbix_agent_serveractive | | |
+| SourceIP | zabbix_agent_sourceip | | |
+| StartAgents | zabbix_agent_startagents | | Agent Only |
+| StatusPort | zabbix_agent_statusport | 9999 | Agent 2 Only |
+| Timeout | zabbix_agent_timeout | 3 | |
+| TLSAccept | zabbix_agent_tlsconnect | | |
+| TLSCAFile | zabbix_agent_tlscafile | /etc/zabbix/tls_psk_auto.secret | |
+| TLSCertFile | zabbix_agent_tlscertfile | | |
+| TLSCipherAll | zabbix_agent_tlscipherall | | Agent on Linux Only |
+| TLSCipherAll13 | zabbix_agent_tlscipherall13 | | Agent on Linux Only |
+| TLSCipherCert | zabbix_agent_tlsciphercert | | Agent on Linux Only |
+| TLSCipherCert13 | zabbix_agent_tlsciphercert13 | | Agent on Linux Only |
+| TLSCipherPSK | zabbix_agent_tlscipherpsk | | Agent on Linux Only |
+| TLSCipherPSK13 | zabbix_agent_tlscipherpsk13 | | Agent on Linux Only |
+| TLSConnect | zabbix_agent_tlsconnect | | |
+| TLSCRLFile | zabbix_agent_tlscrlfile | | |
+| TLSKeyFile | zabbix_agent_tlskeyfile | | |
+| TLSPSKFile | zabbix_agent_tlspskfile | | |
+| TLSPSKIdentity | zabbix_agent_tlspskidentity | | |
+| TLSServerCertIssuer | zabbix_agent_tlsservercertissuer | | |
+| TLSServerCertSubject | zabbix_agent_tlsservercertsubject | | |
+| UnsafeUserParameters | zabbix_agent_unsafeuserparameters | | |
+| User | zabbix_agent_runas_user | | Agent on Linux Only |
+| UserParameter | zabbix_agent_userparamater | 0 | |
+
+
## proxy
When the target host does not have access to the internet, but you do have a proxy available then the following properties needs to be set to download the packages via the proxy:
@@ -369,18 +374,6 @@ There are no dependencies on other roles.
# Example Playbook
-## zabbix_agent2_plugins
-
-Specifically for the Zabbix Agent 2, a list of extra plugins can be configured. The following provides an overview of configuring the `SystemRun` plugin by setting the `LogRemoteCommands` to `0`:
-
-```yaml
-zabbix_agent2_plugins:
- - name: SystemRun
- options:
- - parameter: LogRemoteCommands
- value: 0
-```
-
In the `zabbix_agent2.conf` an entry will be created with the following content:
```
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/defaults/main.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/defaults/main.yml
index 12424a6da..219182e96 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/defaults/main.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/defaults/main.yml
@@ -2,27 +2,19 @@
# defaults file for zabbix_agent
zabbix_agent2: false
-# zabbix_agent_version: 6.4
zabbix_agent_version_minor: "*"
zabbix_version_patch: 0
zabbix_agent_package_remove: false
-zabbix_agent_package: zabbix-agent
-zabbix_sender_package: zabbix-sender
-zabbix_get_package: zabbix-get
+zabbix_sender_package: zabbix-sender # Depricate in 3.0
+zabbix_agent_sender_package: "{{ zabbix_sender_package }}"
+zabbix_get_package: zabbix-get # Depricate in 3.0
+zabbox_agent_get_package: "{{ zabbix_get_package }}"
zabbix_agent_package_state: present
-zabbix_agent_server:
-zabbix_agent_serveractive:
-zabbix_agent2_server: "{{ zabbix_agent_server }}"
-zabbix_agent2_serveractive: "{{ zabbix_agent_serveractive }}"
zabbix_selinux: false
-zabbix_agent_apt_priority:
zabbix_agent_conf_mode: "0644"
zabbix_agent_dont_detect_ip: false
-zabbix_agent_allow_key: []
-zabbix_agent_deny_key: []
-zabbix_agent2_allow_key: "{{ zabbix_agent_allow_key }}"
-zabbix_agent2_deny_key: "{{ zabbix_agent_deny_key }}"
+zabbix_agent_tlspskidentity_file: "/etc/zabbix/tls_psk_auto.identity"
# Selinux related vars
selinux_allow_zabbix_run_sudo: false
@@ -30,18 +22,12 @@ zabbix_repo_deb_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key
zabbix_repo_deb_include_deb_src: true
zabbix_agent_install_agent_only: false
-zabbix_agent_packages:
- - "{{ zabbix_agent_package }}"
- - "{{ zabbix_sender_package }}"
- - "{{ zabbix_get_package }}"
# Zabbix role related vars
zabbix_apt_force_apt_get: true
zabbix_apt_install_recommends: false
# Override Ansible specific facts
-zabbix_agent_distribution_major_version: "{{ ansible_distribution_major_version }}"
-zabbix_agent_distribution_release: "{{ ansible_distribution_release }}"
zabbix_repo_yum_gpgcheck: 0
zabbix_repo_yum_schema: https
zabbix_agent_disable_repo:
@@ -49,21 +35,21 @@ zabbix_agent_disable_repo:
zabbix_repo_yum:
- name: zabbix
description: Zabbix Official Repository - $basearch
- baseurl: "{{ zabbix_repo_yum_schema }}://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/rhel/{{ zabbix_agent_distribution_major_version }}/$basearch/"
+ baseurl: "{{ zabbix_repo_yum_schema }}://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/rhel/{{ ansible_distribution_major_version }}/$basearch/"
mode: "0644"
gpgcheck: "{{ zabbix_repo_yum_gpgcheck }}"
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
state: present
- name: zabbix-non-supported
description: Zabbix Official Repository non-supported - $basearch
- baseurl: "{{ zabbix_repo_yum_schema }}://repo.zabbix.com/non-supported/rhel/{{ zabbix_agent_distribution_major_version }}/$basearch/"
+ baseurl: "{{ zabbix_repo_yum_schema }}://repo.zabbix.com/non-supported/rhel/{{ ansible_distribution_major_version }}/$basearch/"
mode: "0644"
gpgcheck: "{{ zabbix_repo_yum_gpgcheck }}"
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
state: present
- name: zabbix-agent2-plugins
description: Zabbix Official Repository (Agent2 Plugins) - $basearch
- baseurl: "{{ zabbix_repo_yum_schema }}://repo.zabbix.com/zabbix-agent2-plugins/1/rhel/{{ zabbix_agent_distribution_major_version }}/$basearch/"
+ baseurl: "{{ zabbix_repo_yum_schema }}://repo.zabbix.com/zabbix-agent2-plugins/1/rhel/{{ ansible_distribution_major_version }}/$basearch/"
mode: "0644"
gpgcheck: "{{ zabbix_repo_yum_gpgcheck }}"
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
@@ -74,7 +60,6 @@ zabbix_repo_deb_component: main
# Zabbix API stuff
zabbix_api_server_host: localhost
-# zabbix_api_server_port: 80
zabbix_api_login_user: Admin
zabbix_api_use_ssl: false
zabbix_api_login_pass: !unsafe zabbix
@@ -82,10 +67,10 @@ zabbix_api_validate_certs: false
ansible_httpapi_pass: "{{ zabbix_api_login_pass }}"
ansible_httpapi_port: "{{ zabbix_api_server_port }}"
ansible_httpapi_validate_certs: "{{ zabbix_api_validate_certs }}"
-zabbix_api_timeout: 30
+
+# API Related Variables
zabbix_api_create_hostgroup: false
zabbix_api_create_hosts: false
-zabbix_agent_hostgroups_state: present # or absent
zabbix_agent_host_state: present # or absent
zabbix_agent_host_update: true
zabbix_host_status: enabled # or disabled
@@ -106,67 +91,19 @@ zabbix_agent_interfaces:
port: "{{ (zabbix_agent2 == True) | ternary(zabbix_agent2_listenport, zabbix_agent_listenport) }}"
# Zabbix configuration variables
-zabbix_agent_pidfile: /var/run/zabbix/zabbix_agentd.pid
-zabbix_agent_logtype: file
-zabbix_agent_logfile: /var/log/zabbix/zabbix_agentd.log
-zabbix_agent_logfilesize: 100
-zabbix_agent_debuglevel: 3
-zabbix_agent_sourceip:
-zabbix_agent_enableremotecommands: 0
-zabbix_agent_allowkeys:
-zabbix_agent_denykeys:
-zabbix_agent_logremotecommands: 0
-zabbix_agent_listenport: 10050
-zabbix_agent_jmx_listenport:
zabbix_agent_listeninterface:
-zabbix_agent_listenip:
-zabbix_agent_startagents: 3
-zabbix_agent_hostname: "{{ inventory_hostname }}"
-zabbix_agent_hostnameitem:
-zabbix_agent_hostmetadata:
-zabbix_agent_hostmetadataitem:
-zabbix_agent_refreshactivechecks: 120
-zabbix_agent_buffersend: 5
-zabbix_agent_buffersize: 100
-zabbix_agent_maxlinespersecond: 100
-zabbix_agent_allowroot: 0
-zabbix_agent_zabbix_alias:
-zabbix_agent_timeout: 3
-zabbix_agent_include: /etc/zabbix/zabbix_agentd.d
-zabbix_agent_include_pattern:
-zabbix_agent_include_mode: "0750"
-zabbix_agent_unsafeuserparameters: 0
-zabbix_agent_userparameters: []
+
+# statusportzabbix_agent_zabbix_alias: # Deprecate after 3.0
+zabbix_agent_alias: "{{ statusportzabbix_agent_zabbix_alias is defined | ternary(statusportzabbix_agent_zabbix_alias, zabbix_agent_alias) | default(omit) }}"
zabbix_agent_userparameters_templates_src: "userparameters"
zabbix_agent_userparameters_scripts_src: "scripts"
-zabbix_agent_custom_scripts: false
-zabbix_agent_loadmodulepath: ${libdir}/modules
-zabbix_agent_loadmodule:
-zabbix_agent_become_on_localhost: true
-zabbix_agent_description:
-zabbix_agent_inventory_zabbix: {}
-zabbix_agent_heartbeatfrequency: 60
-zabbix_agent_macros: []
-zabbix_agent_tags: []
zabbix_agent_chassis: false
-# TLS settings
-zabbix_agent_tlsconnect:
-zabbix_agent_tlsaccept:
-zabbix_agent_tlscafile:
-zabbix_agent_tlscrlfile:
-zabbix_agent_tlsservercertissuer:
-zabbix_agent_tlsservercertsubject:
-zabbix_agent_tls_subject: "{{ zabbix_agent_tlsservercertsubject }}" # FIXME this is not correct and should be removed with 2.0.0, here only to prevent regression
-zabbix_agent_tlscertfile:
-zabbix_agent_tlskeyfile:
-zabbix_agent_tlspskidentity:
-zabbix_agent_tlspsk_auto: false
-
zabbix_agent_tls_config:
unencrypted: "1"
psk: "2"
- cert: "4"
+ cert:
+ "4"
# IPMI settings
zabbix_agent_ipmi_authtype: -1
@@ -174,66 +111,22 @@ zabbix_agent_ipmi_password:
zabbix_agent_ipmi_privilege: 2
zabbix_agent_ipmi_username:
-# Zabbix Agent2
-zabbix_agent2_pidfile: /var/run/zabbix/zabbix_agent2.pid
-zabbix_agent2_logfile: /var/log/zabbix/zabbix_agent2.log
-zabbix_agent2_logtype: file
-zabbix_agent2_statusport: 9999
-zabbix_agent2_include: /etc/zabbix/zabbix_agent2.d
-zabbix_agent2_include_pattern:
-zabbix_agent2_logfilesize: 100
-zabbix_agent2_debuglevel: 3
-zabbix_agent2_sourceip:
-zabbix_agent2_listenport: 10050
-zabbix_agent2_listenip:
-zabbix_agent2_hostname: "{{ inventory_hostname }}"
-zabbix_agent2_hostnameitem:
-zabbix_agent2_hostmetadata:
-zabbix_agent2_hostmetadataitem:
-zabbix_agent2_hostinterface:
-zabbix_agent2_hostinterfaceitem:
-zabbix_agent2_enablepersistentbuffer: 0
-zabbix_agent2_persistentbufferperiod: 1h
-zabbix_agent2_persistentbufferfile:
-zabbix_agent2_refreshactivechecks: 120
-zabbix_agent2_buffersend: 5
-zabbix_agent2_buffersize: 100
-zabbix_agent2_zabbix_alias:
-zabbix_agent2_timeout: 3
-zabbix_agent2_include_mode: "0750"
-zabbix_agent2_unsafeuserparameters: 0
-zabbix_agent2_controlsocket: /tmp/agent.sock
-zabbix_agent2_plugins: []
+####### Agent 1 Stuff Only
-# Zabbix Agent2 TLS settings
-zabbix_agent2_tlsconnect:
-zabbix_agent2_tlsaccept:
-zabbix_agent2_tlscafile:
-zabbix_agent2_tlscrlfile:
-zabbix_agent2_tlsservercertissuer:
-zabbix_agent2_tlsservercertsubject:
-zabbix_agent2_tls_subject: "{{ zabbix_agent2_tlsservercertsubject }}" # FIXME this is not correct and should be removed with 2.0.0, here only to prevent regression
-zabbix_agent2_tlscertfile:
-zabbix_agent2_tlskeyfile:
-zabbix_agent2_tlspskidentity:
-zabbix_agent2_tlspsk_auto: false
+zabbix_agent_loadmodulepath: ${libdir}/modules
+zabbix_agent_logremotecommands: 0
+zabbix_agent_maxlinespersecond: 100
+zabbix_agent_startagents: 3
# Windows/macOS Related
zabbix_version_long: 5.2.4
# Windows Related
-zabbix_win_package: zabbix_agent-{{ zabbix_version_long }}-windows-amd64-openssl.zip
-zabbix2_win_package: zabbix_agent2-{{ zabbix_version_long }}-windows-amd64-openssl-static.zip
zabbix_win_download_url: https://cdn.zabbix.com/zabbix/binaries/stable
-zabbix_win_download_link: "{{ zabbix_win_download_url }}/{{ zabbix_version_long | regex_search('^\\d+\\.\\d+') }}/{{ zabbix_version_long }}/{{ zabbix_win_package }}"
-zabbix2_win_download_link: "{{ zabbix_win_download_url }}/{{ zabbix_version_long | regex_search('^\\d+\\.\\d+') }}/{{ zabbix_version_long }}/{{ zabbix2_win_package }}"
zabbix_win_install_dir: 'C:\Zabbix'
zabbix_win_install_dir_conf: '{{ zabbix_win_install_dir }}\\conf'
zabbix_win_install_dir_bin: '{{ zabbix_win_install_dir }}\\bin'
-zabbix_agent_win_logfile: "{{ zabbix_win_install_dir }}\\zabbix_agentd.log"
zabbix_agent_win_include: "{{ zabbix_win_install_dir }}\\zabbix_agent.d\\"
-zabbix_agent2_win_logfile: "{{ zabbix_win_install_dir }}\\zabbix_agent2.log"
-zabbix_agent_win_svc_recovery: true
zabbix_win_firewall_management: true
# macOS Related
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Debian.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Debian.yml
index 92d56b179..940f1e2f0 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Debian.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Debian.yml
@@ -38,7 +38,7 @@
(ansible_distribution == "Debian" and ansible_distribution_major_version < "12")
- name: "Debian | Download gpg key"
- when: not ansible_check_mode # Because get_url always has changed status in check_mode.
+ when: not ansible_check_mode # Because get_url always has changed status in check_mode.
ansible.builtin.get_url:
url: "{{ zabbix_repo_deb_gpg_key_url }}"
dest: "{{ zabbix_gpg_key }}"
@@ -69,29 +69,28 @@
tags:
- install
-- name: "Debian | Create /etc/apt/preferences.d/"
- ansible.builtin.file:
- path: /etc/apt/preferences.d/
- state: directory
- mode: "0755"
+- name: Configure APT Prefrence
when:
+ - zabbix_agent_apt_priority is defined
- zabbix_agent_apt_priority | int
- become: true
- tags:
- - install
+ block:
+ - name: "Debian | Create /etc/apt/preferences.d/"
+ ansible.builtin.file:
+ path: /etc/apt/preferences.d/
+ state: directory
+ mode: "0755"
+ become: true
-- name: "Debian | Configuring the weight for APT"
- ansible.builtin.copy:
- dest: "/etc/apt/preferences.d/zabbix-agent-{{ zabbix_underscore_version }}"
- content: |
- Package: {{ zabbix_agent_package }}
- Pin: origin repo.zabbix.com
- Pin-Priority: {{ zabbix_agent_apt_priority | int }}
- owner: root
- mode: "0644"
- when:
- - zabbix_agent_apt_priority | int
- become: true
+ - name: "Debian | Configuring the weight for APT"
+ ansible.builtin.copy:
+ dest: "/etc/apt/preferences.d/zabbix-agent-{{ zabbix_underscore_version }}"
+ content: |
+ Package: {{ zabbix_agent_package }}
+ Pin: origin repo.zabbix.com
+ Pin-Priority: {{ zabbix_agent_apt_priority | int }}
+ owner: root
+ mode: "0644"
+ become: true
tags:
- install
@@ -115,8 +114,8 @@
- name: "Debian | Installing zabbix-{sender,get}"
ansible.builtin.apt:
pkg:
- - "{{ zabbix_sender_package }}"
- - "{{ zabbix_get_package }}"
+ - "{{ zabbix_agent_sender_package }}"
+ - "{{ zabbox_agent_get_package }}"
state: "{{ zabbix_agent_package_state }}"
update_cache: true
cache_valid_time: 0
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Linux.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Linux.yml
index c4c8fc401..aa8bca132 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Linux.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Linux.yml
@@ -20,10 +20,6 @@
- name: "Set first public ip address for zabbix_agent_ip"
ansible.builtin.set_fact:
zabbix_agent_ip: "{{ ansible_all_ipv4_addresses | ansible.netcommon.ipaddr('public') | first }}"
- zabbix_agent_server: "{{ zabbix_agent_server_public_ip | default(zabbix_agent_server) }}"
- zabbix_agent_serveractive: "{{ zabbix_agent_serveractive_public_ip | default(zabbix_agent_serveractive) }}"
- zabbix_agent2_server: "{{ zabbix_agent_server_public_ip | default(zabbix_agent2_server) }}"
- zabbix_agent2_serveractive: "{{ zabbix_agent_serveractive_public_ip | default(zabbix_agent2_serveractive) }}"
when:
- zabbix_agent_ip is not defined
- total_private_ip_addresses is defined
@@ -55,7 +51,7 @@
network_interface: ansible_{{ zabbix_agent_listeninterface }}
when:
- (zabbix_agent_listeninterface)
- - not zabbix_agent_listenip
+ - zabbix_agent_listenip is undefined
tags:
- config
@@ -64,7 +60,7 @@
zabbix_agent_listenip: "{{ hostvars[inventory_hostname][network_interface]['ipv4'].address | default('0.0.0.0') }}"
when:
- (zabbix_agent_listeninterface)
- - not zabbix_agent_listenip
+ - zabbix_agent_listenip is undefined
tags:
- config
- api
@@ -73,7 +69,7 @@
ansible.builtin.set_fact:
zabbix_agent_listenip: "0.0.0.0"
when:
- - not (zabbix_agent_listenip)
+ - zabbix_agent_listenip is undefined
tags:
- config
@@ -120,8 +116,8 @@
- name: "Configure zabbix-agent"
ansible.builtin.template:
- src: "{{ 'zabbix_agentd.conf.j2' if not zabbix_agent2 else 'zabbix_agent2.conf.j2' }}"
- dest: "/etc/zabbix/{{ zabbix_agent_conf if not zabbix_agent2 else zabbix_agent2_conf }}"
+ src: agent.conf.j2
+ dest: "/etc/zabbix/zabbix_agent{{ (zabbix_agent2 | bool) | ternary('2', 'd') }}.conf"
owner: root
group: root
mode: "{{ zabbix_agent_conf_mode }}"
@@ -133,74 +129,12 @@
tags:
- config
-- name: "Create directory for PSK file if not exist."
- ansible.builtin.file:
- path: "{{ zabbix_agent_tlspskfile | dirname }}"
- mode: 0755
- state: directory
- become: true
- when:
- - zabbix_agent_tlspskfile is defined
- - zabbix_agent_tlspskfile # https://github.com/ansible-collections/community.zabbix/issues/680
- - not (zabbix_agent2 | bool)
- tags:
- - config
-
-- name: "Create directory for PSK file if not exist (zabbix-agent2)"
- ansible.builtin.file:
- path: "{{ zabbix_agent2_tlspskfile | dirname }}"
- mode: 0755
- state: directory
- become: true
- when:
- - zabbix_agent2_tlspskfile is defined
- - zabbix_agent2_tlspskfile # https://github.com/ansible-collections/community.zabbix/issues/680
- - zabbix_agent2 | bool
- tags:
- - config
-
-- name: "Place TLS PSK File"
- ansible.builtin.copy:
- dest: "{{ zabbix_agent_tlspskfile }}"
- content: "{{ zabbix_agent_tlspsk_secret }}"
- owner: zabbix
- group: zabbix
- mode: 0400
- become: true
- when:
- - zabbix_agent_tlspskfile is defined
- - zabbix_agent_tlspskfile # https://github.com/ansible-collections/community.zabbix/issues/680
- - zabbix_agent_tlspsk_secret is defined
- - not (zabbix_agent2 | bool)
- notify:
- - restart zabbix-agent
- tags:
- - config
-
-- name: "Place TLS PSK File (zabbix-agent2)"
- ansible.builtin.copy:
- dest: "{{ zabbix_agent2_tlspskfile }}"
- content: "{{ zabbix_agent2_tlspsk_secret }}"
- owner: zabbix
- group: zabbix
- mode: 0400
- become: true
- when:
- - zabbix_agent2_tlspskfile is defined
- - zabbix_agent2_tlspskfile # https://github.com/ansible-collections/community.zabbix/issues/680
- - zabbix_agent2_tlspsk_secret is defined
- - zabbix_agent2 | bool
- notify:
- - restart zabbix-agent
- tags:
- - config
-
- name: "Create include dir zabbix-agent"
ansible.builtin.file:
- path: "{{ zabbix_agent_include if not zabbix_agent2 else zabbix_agent2_include }}"
+ path: "{{ zabbix_agent_include }}"
owner: root
group: zabbix
- mode: "{{ zabbix_agent_include_mode if not zabbix_agent2 else zabbix_agent2_include_mode }}"
+ mode: "{{ zabbix_agent_include_mode }}"
state: directory
become: true
tags:
@@ -234,6 +168,8 @@
owner: root
group: zabbix
become: true
- when: zabbix_agent_chassis | bool
+ when:
+ - zabbix_agent_chassis is defined
+ - zabbix_agent_chassis | bool
tags:
- config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows.yml
index 9b7501d9a..2f9758249 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows.yml
@@ -1,4 +1,10 @@
---
+- name: "Windows | Set some variables"
+ ansible.builtin.set_fact:
+ zabbix_agent_win_download_link: "{{ zabbix_agent_win_download_link is defined | ternary(zabbix_agent_win_download_link, zabbix_agent2_win_download_link) | default(_win_download_link) }}"
+ zabbix_agent_win_logfile: "{{ zabbix_agent_win_logfile is defined | ternary(zabbix_agent_win_logfile, zabbix_agent2_win_logfile) | default(_win_logfile) }}"
+ zabbix_agent_win_package: "{{ zabbix_agent_win_package is defined | ternary(zabbix_agent_win_package, zabbix_agent2_win_package) | default(_win_package) }}"
+
- name: "Windows | Set default architecture"
ansible.builtin.set_fact:
windows_arch: 32
@@ -26,7 +32,7 @@
zabbix_win_config_name: "zabbix_agentd.conf"
zabbix2_win_svc_name: Zabbix Agent 2
zabbix2_win_exe_path: '{{ zabbix_win_install_dir }}\bin\zabbix_agent2.exe'
- zabbix2_win_config_name: "zabbix_agent2.conf"
+ zabbix2_win_config_name: "zabbix_agentd2.conf"
tags:
- always
@@ -288,56 +294,6 @@
tags:
- install
-- name: "Create directory for PSK file if not exist."
- ansible.windows.win_file:
- path: "{{ zabbix_agent_tlspskfile | win_dirname }}"
- state: directory
- when:
- - zabbix_agent_tlspskfile is defined
- - zabbix_agent_tlspskfile
- - not (zabbix_agent2 | bool)
- tags:
- - config
-
-- name: "Create directory for PSK file if not exist (zabbix-agent2)"
- ansible.windows.win_file:
- path: "{{ zabbix_agent2_tlspskfile | win_dirname }}"
- state: directory
- when:
- - zabbix_agent2_tlspskfile is defined
- - zabbix_agent2_tlspskfile
- - zabbix_agent2 | bool
- tags:
- - config
-
-- name: "Place TLS PSK File"
- ansible.windows.win_copy:
- dest: "{{ zabbix_agent_tlspskfile }}"
- content: "{{ zabbix_agent_tlspsk_secret }}"
- when:
- - zabbix_agent_tlspskfile is defined
- - zabbix_agent_tlspskfile
- - zabbix_agent_tlspsk_secret is defined
- - not (zabbix_agent2 | bool)
- notify:
- - restart win zabbix agent
- tags:
- - config
-
-- name: "Place TLS PSK File (zabbix-agent2)"
- ansible.windows.win_copy:
- dest: "{{ zabbix_agent2_tlspskfile }}"
- content: "{{ zabbix_agent2_tlspsk_secret }}"
- when:
- - zabbix_agent2_tlspskfile is defined
- - zabbix_agent2_tlspskfile
- - zabbix_agent2_tlspsk_secret is defined
- - zabbix_agent2 | bool
- notify:
- - restart win zabbix agent
- tags:
- - config
-
- name: "Windows | Check if windows service exist"
ansible.windows.win_service:
name: "{{ zabbix_win_svc_name }}"
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows_conf.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows_conf.yml
index 72dee230f..cc7c09d50 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows_conf.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Windows_conf.yml
@@ -1,4 +1,9 @@
---
+- name: "Set Log File Info"
+ ansible.builtin.set_fact:
+ zabbix_agent_logfile: "{{ zabbix_agent_win_logfile is defined | ternary(zabbix_agent_win_logfile, zabbix_agent2_win_logfile) | default(_win_logfile) }}"
+ when: zabbix_agent_logfile is undefined
+
- name: "Set default ip address for zabbix_agent_ip"
ansible.builtin.set_fact:
zabbix_agent_ip: "{{ hostvars[inventory_hostname]['ansible_ip_addresses'] | ansible.utils.ipv4 | first }}"
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/api.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/api.yml
index 4de342645..0013f1783 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/api.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/api.yml
@@ -1,8 +1,8 @@
---
- name: "API | Create host groups"
community.zabbix.zabbix_group:
- host_group: "{{ zabbix_host_groups }}"
- state: "{{ zabbix_agent_hostgroups_state }}"
+ host_groups: "{{ zabbix_host_groups }}"
+ state: present
when:
- zabbix_api_create_hostgroup | bool
register: zabbix_api_hostgroup_created
@@ -35,43 +35,7 @@
ipmi_password: "{{ zabbix_agent_ipmi_password| default(omit) }}"
ipmi_privilege: "{{ zabbix_agent_ipmi_privilege | default(omit) }}"
ipmi_username: "{{ zabbix_agent_ipmi_username | default(omit) }}"
- tags: "{{ zabbix_agent_tags }}"
- when:
- - not zabbix_agent2
- register: zabbix_api_host_created
- until: zabbix_api_host_created is succeeded
- delegate_to: "{{ zabbix_api_server_host }}"
- changed_when: false
- tags:
- - api
-
-- name: "API | Create a new host using agent2 or update an existing host's info"
- community.zabbix.zabbix_host:
- host_name: "{{ zabbix_agent2_hostname }}"
- host_groups: "{{ zabbix_host_groups }}"
- link_templates: "{{ zabbix_agent_link_templates }}"
- status: "{{ zabbix_host_status }}"
- state: "{{ zabbix_agent_host_state }}"
- force: "{{ zabbix_agent_host_update }}"
- proxy: "{{ zabbix_agent_proxy }}"
- inventory_mode: "{{ zabbix_agent_inventory_mode }}"
- interfaces: "{{ zabbix_agent_interfaces }}"
- visible_name: "{{ zabbix_agent_visible_hostname | default(zabbix_agent2_hostname) }}"
- tls_psk: "{{ zabbix_agent2_tlspsk_secret | default(omit) }}"
- tls_psk_identity: "{{ zabbix_agent2_tlspskidentity | default(omit) }}"
- tls_issuer: "{{ zabbix_agent2_tlsservercertissuer | default(omit) }}"
- tls_subject: "{{ zabbix_agent2_tls_subject | default(omit) }}"
- tls_accept: "{{ zabbix_agent_tls_config[zabbix_agent2_tlsaccept if zabbix_agent2_tlsaccept else 'unencrypted'] }}"
- tls_connect: "{{ zabbix_agent_tls_config[zabbix_agent2_tlsconnect if zabbix_agent2_tlsconnect else 'unencrypted'] }}"
- description: "{{ zabbix_agent_description | default(omit) }}"
- inventory_zabbix: "{{ zabbix_agent_inventory_zabbix | default({}) }}"
- ipmi_authtype: "{{ zabbix_agent_ipmi_authtype | default(omit) }}"
- ipmi_password: "{{ zabbix_agent_ipmi_password| default(omit) }}"
- ipmi_privilege: "{{ zabbix_agent_ipmi_privilege | default(omit) }}"
- ipmi_username: "{{ zabbix_agent_ipmi_username | default(omit) }}"
- tags: "{{ zabbix_agent_tags }}"
- when:
- - zabbix_agent2 | bool
+ tags: "{{ zabbix_agent_tags | default(omit) }}"
register: zabbix_api_host_created
until: zabbix_api_host_created is succeeded
delegate_to: "{{ zabbix_api_server_host }}"
@@ -81,13 +45,12 @@
- name: "API | Updating host configuration with macros"
community.zabbix.zabbix_hostmacro:
- host_name: "{{ (zabbix_agent2 | bool) | ternary(zabbix_agent2_hostname, zabbix_agent_hostname) }}"
+ host_name: "{{ zabbix_agent_hostname }}"
macro_name: "{{ item.macro_key }}"
macro_value: "{{ item.macro_value }}"
macro_type: "{{ item.macro_type|default('text') }}"
with_items: "{{ zabbix_agent_macros | default([]) }}"
when:
- - zabbix_agent_macros is defined
- item.macro_key is defined
register: zabbix_api_hostmarcro_created
until: zabbix_api_hostmarcro_created is succeeded
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/main.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/main.yml
index c5fd06480..f6bbd0f2a 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/main.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/main.yml
@@ -21,41 +21,89 @@
tags:
- always
+- name: Load Appropriate Defaults
+ ansible.builtin.include_vars: "agent{{ '2' if zabbix_agent2 is defined and zabbix_agent2|bool }}_vars.yml"
+
+- name: Set Variables
+ ansible.builtin.set_fact:
+ zabbix_agent_include: "{{ zabbix_agent_include is defined | ternary(zabbix_agent_include, zabbix_agent2_include) | default(_include) }}"
+ zabbix_agent_logfile: "{{ zabbix_agent_logfilee is defined | ternary(zabbix_agent_logfile, zabbix_agent2_logfile) | default(_logfile) }}"
+ zabbix_agent_package: "{{ zabbix_agent_package is defined | ternary(zabbix_agent_package, zabbix_agent2_package) | default(_agent_package) }}"
+ zabbix_agent_pidfile: "{{ zabbix_agent_pidfile is defined | ternary(zabbix_agent_pidfile, zabbix_agent2_pidfile) | default(_pidfile) }}"
+ zabbix_agent_service: "{{ zabbix_agent_service is defined | ternary(zabbix_agent_service, zabbix_agent2_service) | default(_agent_service) }}"
+ zabbix_agent_tls_subject: "{{ zabbix_agent_tls_subject is defined | ternary(zabbix_agent_tls_subject, zabbix_agent2_tls_subject) | default(_tls_subject) }}"
+
+- name: Set More Varaibles # Move to defaults after 3.0
+ ansible.builtin.set_fact:
+ zabbix_agent_buffersend: "{{ zabbix_agent_buffersend is defined | ternary(zabbix_agent_buffersend, zabbix_agent2_buffersend) | default(5) }}"
+ zabbix_agent_buffersize: "{{ zabbix_agent_buffersize is defined | ternary(zabbix_agent_buffersize, zabbix_agent2_buffersize) | default(100) }}"
+ zabbix_agent_controlsocket: "{{ zabbix_agent_controlsocket is defined | ternary(zabbix_agent_controlsocket, zabbix_agent2_controlsocket) | default('/tmp/agent.sock') }}"
+ zabbix_agent_debuglevel: "{{ zabbix_agent_debuglevel is defined | ternary(zabbix_agent_debuglevel, zabbix_agent2_debuglevel) | default(3) }}"
+ zabbix_agent_enableremotecommands: "{{ zabbix_agent_enableremotecommands is defined | ternary(zabbix_agent_enableremotecommands, zabbix_agent2_enableremotecommands) | default(0) }}"
+ zabbix_agent_heartbeatfrequency: "{{ zabbix_agent_heartbeatfrequency is defined | ternary(zabbix_agent_heartbeatfrequency, zabbix_agent2_heartbeatfrequency) | default(60) }}"
+ zabbix_agent_hostname: "{{ zabbix_agent_hostname is defined | ternary(zabbix_agent_hostname, zabbix_agent2_hostname) | default(inventory_hostname) }}"
+ zabbix_agent_include_mode: "{{ zabbix_agent_include_mode is defined | ternary(zabbix_agent_include_mode, zabbix_agent2_include_mode) | default('0750') }}"
+ zabbix_agent_listenport: "{{ zabbix_agent_listenport is defined | ternary(zabbix_agent_listenport, zabbix_agent2_listenport) | default(10050) }}"
+ zabbix_agent_logfilesize: "{{ zabbix_agent_logfilesize is defined | ternary(zabbix_agent_logfilesize, zabbix_agent2_logfilesize) | default(100) }}"
+ zabbix_agent_logtype: "{{ zabbix_agent_logtype is defined | ternary(zabbix_agent_logtype, zabbix_agent2_logtype) | default('file') }}"
+ zabbix_agent_persistentbufferperiod: "{{ zabbix_agent_persistentbufferperiod is defined | ternary(zabbix_agent_persistentbufferperiod, zabbix_agent2_persistentbufferperiod) | default('1h') }}"
+ zabbix_agent_refreshactivechecks: "{{ zabbix_agent_refreshactivechecks is defined | ternary(zabbix_agent_refreshactivechecks, zabbix_agent2_refreshactivechecks) | default(120) }}"
+ zabbix_agent_statusport: "{{ zabbix_agent_statusport is defined | ternary(zabbix_agent_statusport, zabbix_agent2_statusport) | default(9999) }}"
+ zabbix_agent_timeout: "{{ zabbix_agent_timeout is defined | ternary(zabbix_agent_timeout, zabbix_agent2_timeout) | default(3) }}"
+ zabbix_agent_tlspsk_auto: "{{ zabbix_agent_tlspsk_auto is defined | ternary(zabbix_agent_tlspsk_auto, zabbix_agent2_tlspsk_auto) | default(false) }}"
+ zabbix_agent_tlspskfile: "{{ zabbix_agent_tlspskfile is defined | ternary(zabbix_agent_tlspskfile, zabbix_agent2_tlspskfile) | default('/etc/zabbix/tls_psk_auto.secret') }}"
+ zabbix_agent_unsafeuserparameters: "{{ zabbix_agent_unsafeuserparameters is defined | ternary(zabbix_agent_unsafeuserparameters, zabbix_agent2_unsafeuserparameters) | default(0) }}"
+
+- name: Set More Variables # Remove for 3.0 release
+ ansible.builtin.set_fact:
+ zabbix_agent_allowkeys: "{{ zabbix_agent_allowkeys is defined | ternary(zabbix_agent_allowkeys, zabbix_agent2_allow_key) | default(omit) }}"
+ zabbix_agent_denykeys: "{{ zabbix_agent_denykeys is defined | ternary(zabbix_agent_denykeys, zabbix_agent2_deny_key) | default(omit) }}"
+ zabbix_agent_hostinterface: "{{ zabbix_agent_hostinterface is defined | ternary(zabbix_agent_hostinterface, zabbix_agent2_hostinterface) | default(omit) }}"
+ zabbix_agent_hostinterfaceitem: "{{ zabbix_agent_hostinterfaceitem is defined | ternary(zabbix_agent_hostinterfaceitem, zabbix_agent2_hostinterfaceitem) | default(omit) }}"
+ zabbix_agent_hostmetadata: "{{ zabbix_agent_hostmetadata is defined | ternary(zabbix_agent_hostmetadata, zabbix_agent2_hostmetadata) | default(omit) }}"
+ zabbix_agent_hostmetadataitem: "{{ zabbix_agent_hostmetadataitem is defined | ternary(zabbix_agent_hostmetadataitem, zabbix_agent2_hostmetadataitem) | default(omit) }}"
+ zabbix_agent_hostnameitem: "{{ zabbix_agent_hostnameitem is defined | ternary(zabbix_agent_hostnameitem, zabbix_agent2_hostnameitem) | default(omit) }}"
+ zabbix_agent_listenip: "{{ zabbix_agent_listenip is defined | ternary(zabbix_agent_listenip, zabbix_agent2_listenip) | default(omit) }}"
+ zabbix_agent_persistentbufferfile: "{{ zabbix_agent_persistentbufferfile is defined | ternary(zabbix_agent_persistentbufferfile, zabbix_agent2_persistentbufferfile) | default(omit) }}"
+ zabbix_agent_plugins: "{{ zabbix_agent_plugins is defined | ternary(zabbix_agent_plugins, zabbix_agent2_plugins) | default(omit) }}"
+ zabbix_agent_server: "{{ zabbix_agent_server is defined | ternary(zabbix_agent_server, zabbix_agent2_server) | default(omit) }}"
+ zabbix_agent_serveractive: "{{ zabbix_agent_serveractive is defined | ternary(zabbix_agent_serveractive, zabbix_agent2_serveractive) | default(omit) }}"
+ zabbix_agent_sourceip: "{{ zabbix_agent_sourceip is defined | ternary(zabbix_agent_sourceip, zabbix_agent2_sourceip) | default(omit) }}"
+ zabbix_agent_tlsaccept: "{{ zabbix_agent_tlsaccept is defined | ternary(zabbix_agent_tlsaccept, zabbix_agent2_tlsaccept) | default(omit) }}"
+ zabbix_agent_tlscafile: "{{ zabbix_agent_tlscafile is defined | ternary(zabbix_agent_tlscafile, zabbix_agent2_tlscafile) | default(omit) }}"
+ zabbix_agent_tlscertfile: "{{ zabbix_agent_tlscertfile is defined | ternary(zabbix_agent_tlscertfile, zabbix_agent2_tlscertfile) | default(omit) }}"
+ zabbix_agent_tlsconnect: "{{ zabbix_agent_tlsconnect is defined | ternary(zabbix_agent_tlsconnect, zabbix_agent2_tlsconnect) | default(omit) }}"
+ zabbix_agent_tlscrlfile: "{{ zabbix_agent_tlscrlfile is defined | ternary(zabbix_agent_tlscrlfile, zabbix_agent2_tlscrlfile) | default(omit) }}"
+ zabbix_agent_tlskeyfile: "{{ zabbix_agent_tlskeyfile is defined | ternary(zabbix_agent_tlskeyfile, zabbix_agent2_tlskeyfile) | default(omit) }}"
+ zabbix_agent_tlspskidentity: "{{ zabbix_agent_tlspskidentity is defined | ternary(zabbix_agent_tlspskidentity, zabbix_agent2_tlspskidentity) | default(omit) }}"
+ zabbix_agent_tlspsk_secret: "{{ zabbix_agent_tlspsk_secret is defined | ternary(zabbix_agent_tlspsk_secret, zabbix_agent2_tlspsk_secret) | default(omit) }}"
+ zabbix_agent_tlsservercertissuer: "{{ zabbix_agent_tlsservercertissuer is defined | ternary(zabbix_agent_tlsservercertissuer, zabbix_agent2_tlsservercertissuer) | default(omit) }}"
+ zabbix_agent_tlsservercertsubject: "{{ zabbix_agent_tlsservercertsubject is defined | ternary(zabbix_agent_tlsservercertsubject, zabbix_agent2_tlsservercertsubject) | default(omit) }}"
+ zabbix_agent_aliases: "{{ zabbix_agent_aliases is defined | ternary(zabbix_agent_aliases, zabbix_agent_zabbix_alias) | default(omit) }}"
+
- name: Setting Zabbix API Server Port
ansible.builtin.set_fact:
zabbix_api_server_port: "{{ '443' if zabbix_api_use_ssl|bool else '80' }}"
when: zabbix_api_server_port is undefined
-- name: "Set variables specific for Zabbix Agent 2"
- ansible.builtin.set_fact:
- zabbix_agent_service: zabbix-agent2
- zabbix_agent_package: zabbix-agent2
- when:
- - zabbix_agent2 is defined
- - zabbix_agent2
- tags:
- - always
-
- name: "Install the correct repository"
ansible.builtin.include_tasks: "{{ ansible_os_family }}.yml"
when:
- not (zabbix_agent_docker | bool)
-- name: "Encrypt with TLS PSK auto management"
- ansible.builtin.include_tasks: tlspsk_auto.yml
- when:
- - not zabbix_agent2
- - zabbix_agent_tlspsk_auto | bool
- - (zabbix_agent_tlspskfile is undefined) or (zabbix_agent_tlspskfile | length == '0')
- - (zabbix_agent_tlspsk_secret is undefined) or (zabbix_agent_tlspsk_secret | length == '0')
+- name: Gather PSK Secret Info
+ ansible.builtin.include_tasks: psk_secret.yml
-- name: "Encrypt with TLS PSK auto management"
- ansible.builtin.include_tasks: tlspsk_auto_agent2.yml
- when:
- - zabbix_agent2 | bool
- - zabbix_agent2_tlspsk_auto | bool
- - (zabbix_agent2_tlspskfile is undefined) or (zabbix_agent2_tlspskfile | length == '0')
- - (zabbix_agent2_tlspsk_secret is undefined) or (zabbix_agent2_tlspsk_secret | length == '0')
+- name: Gather PSK Identity Info
+ ansible.builtin.include_tasks: psk_identity.yml
+
+- name: AutoPSK | Default tlsaccept and tlsconnect to enforce PSK
+ ansible.builtin.set_fact:
+ zabbix_agent_tlsaccept: psk
+ zabbix_agent_tlsconnect: psk
+ when: zabbix_agent_tlspsk_auto | bool
+ tags:
+ - config
- name: "Configure Agent"
ansible.builtin.include_tasks: Windows_conf.yml
@@ -85,6 +133,6 @@
- name: "Including userparameters"
ansible.builtin.include_tasks: "userparameter.yml"
- when: zabbix_agent_userparameters|length > 0
+ when: zabbix_agent_userparameters | default ([]) | length > 0
tags:
- config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/psk_identity.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/psk_identity.yml
new file mode 100644
index 000000000..12df8572b
--- /dev/null
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/psk_identity.yml
@@ -0,0 +1,84 @@
+- name: AutoPSK | Check for existing TLS PSK identity
+ block:
+ - name: AutoPSK | Check for existing TLS PSK identity | Windows
+ ansible.windows.win_stat:
+ path: "{{ zabbix_agent_tlspskidentity_file }}"
+ register: zabbix_agent_tlspskidentity_check
+ when:
+ - ansible_os_family == "Windows"
+
+ - name: AutoPSK | Check for existing TLS PSK identity | Linux
+ ansible.builtin.stat:
+ path: "{{ zabbix_agent_tlspskidentity_file }}"
+ register: zabbix_agent_tlspskidentity_check
+ become: true
+ when:
+ - ansible_os_family != "Windows"
+ tags:
+ - config
+
+- name: AutoPSK | Read existing TLS PSK identity file
+ ansible.builtin.slurp:
+ src: "{{ zabbix_agent_tlspskidentity_file }}"
+ register: zabbix_agent_tlspskidentity_base64
+ become: true
+ when: zabbix_agent_tlspskidentity_check.stat.exists
+ no_log: "{{ ansible_verbosity < 3 }}"
+ tags:
+ - config
+
+- name: AutoPSK | Use existing TLS PSK identity
+ ansible.builtin.set_fact:
+ zabbix_agent_tlspskidentity: "{{ zabbix_agent_tlspskidentity_base64['content'] | b64decode | trim }}"
+ when:
+ - zabbix_agent_tlspskidentity_check.stat.exists
+ no_log: "{{ ansible_verbosity < 3 }}"
+ tags:
+ - config
+
+- name: AutoPSK | Generate new TLS PSK identity
+ ansible.builtin.set_fact:
+ zabbix_agent_tlspskidentity: >-
+ {{
+ zabbix_agent_visible_hostname
+ | default(zabbix_agent_hostname)
+ + '_'
+ + lookup('password', '/dev/null chars=hexdigits length=4')
+ }}
+ when:
+ - not zabbix_agent_tlspskidentity_check.stat.exists
+ - zabbix_agent_tlspskidentity is undefined
+ - zabbix_agent_tlspsk_auto | bool
+ no_log: "{{ ansible_verbosity < 3 }}"
+ tags:
+ - config
+
+- name: AutoPSK | Template PSK Identity
+ block:
+ - name: AutoPSK | Template PSK Identity | Windows
+ ansible.windows.win_copy:
+ dest: "{{ zabbix_agent_tlspskidentity_file }}"
+ content: "{{ zabbix_agent_tlspskidentity }}"
+ when:
+ - ansible_os_family == "Windows"
+ notify:
+ - restart win zabbix agent
+
+ - name: AutoPSK | Template PSK Identity | Linux
+ ansible.builtin.copy:
+ dest: "{{ zabbix_agent_tlspskidentity_file }}"
+ content: "{{ zabbix_agent_tlspskidentity }}"
+ owner: zabbix
+ group: zabbix
+ mode: 0400
+ become: true
+ when:
+ - ansible_os_family != "Windows"
+ notify:
+ - restart zabbix-agent
+ - restart mac zabbix agent
+ when:
+ - zabbix_agent_tlspskidentity_file is defined
+ - zabbix_agent_tlspskidentity is defined
+ tags:
+ - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/psk_secret.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/psk_secret.yml
new file mode 100644
index 000000000..4fedb605a
--- /dev/null
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/psk_secret.yml
@@ -0,0 +1,112 @@
+- name: AutoPSK | Set Path Variables for Windows
+ ansible.builtin.set_fact:
+ zabbix_agent_tlspskfile: "{{ zabbix_win_install_dir }}\\tls_psk_auto.secret.txt"
+ zabbix_agent_tlspskidentity_file: "{{ zabbix_win_install_dir }}\\tls_psk_auto.identity.txt"
+ when:
+ - ansible_os_family == "Windows"
+ tags:
+ - config
+
+- name: AutoPSK | Check for existing TLS PSK file
+ block:
+ - name: AutoPSK | Check for existing TLS PSK file | Windows
+ ansible.windows.win_stat:
+ path: "{{ zabbix_agent_tlspskfile }}"
+ register: zabbix_agent_tlspskcheck
+ when:
+ - ansible_os_family == "Windows"
+
+ - name: AutoPSK | Check for existing TLS PSK file | Linux
+ ansible.builtin.stat:
+ path: "{{ zabbix_agent_tlspskfile }}"
+ register: zabbix_agent_tlspskcheck
+ become: true
+ when:
+ - ansible_os_family != "Windows"
+ tags:
+ - config
+
+- name: AutoPSK | read existing TLS PSK file
+ ansible.builtin.slurp:
+ src: "{{ zabbix_agent_tlspskfile }}"
+ register: zabbix_agent_tlspsk_base64
+ become: true
+ when:
+ - zabbix_agent_tlspskcheck.stat.exists
+ no_log: "{{ ansible_verbosity < 3 }}"
+ tags:
+ - config
+
+- name: AutoPSK | Save Existing PSK Secret
+ ansible.builtin.set_fact:
+ zabbix_agent_tlspsk_read: "{{ zabbix_agent_tlspsk_base64['content'] | b64decode | trim }}"
+ when: zabbix_agent_tlspskcheck.stat.exists
+ no_log: "{{ ansible_verbosity < 3 }}"
+ tags:
+ - config
+
+- name: AutoPSK | Use Existing PSK Secret
+ ansible.builtin.set_fact:
+ zabbix_agent_tlspsk_secret: "{{ zabbix_agent_tlspsk_read }}"
+ when:
+ - zabbix_agent_tlspskcheck.stat.exists
+ - zabbix_agent_tlspsk_read|length >= 32
+ no_log: "{{ ansible_verbosity < 3 }}"
+ tags:
+ - config
+
+- name: AutoPSK | Generate New PSK Secret
+ ansible.builtin.set_fact:
+ zabbix_agent_tlspsk_secret: "{{ lookup('password', '/dev/null chars=hexdigits length=64') }}"
+ when:
+ - zabbix_agent_tlspsk_secret is undefined
+ - zabbix_agent_tlspsk_auto | bool
+ no_log: "{{ ansible_verbosity < 3 }}"
+ tags:
+ - config
+
+- name: AutoPSK | Template PSK Secret
+ block:
+ - name: Create Directory for PSK File | Windows
+ ansible.windows.win_file:
+ path: "{{ zabbix_agent_tlspskfile | win_dirname }}"
+ state: directory
+ when:
+ - ansible_os_family == "Windows"
+
+ - name: AutoPSK | Template PSK Secret | Windows
+ ansible.windows.win_copy:
+ dest: "{{ zabbix_agent_tlspskfile }}"
+ content: "{{ zabbix_agent_tlspsk_secret }}"
+ when:
+ - ansible_os_family == "Windows"
+ notify:
+ - restart win zabbix agent
+
+ - name: Create Directory for PSK File | Linux
+ ansible.builtin.file:
+ path: "{{ zabbix_agent_tlspskfile | dirname }}"
+ mode: 0755
+ state: directory
+ become: true
+ when:
+ - ansible_os_family != "Windows"
+
+ - name: AutoPSK | Template PSK Secret | Linux
+ ansible.builtin.copy:
+ dest: "{{ zabbix_agent_tlspskfile }}"
+ content: "{{ zabbix_agent_tlspsk_secret }}"
+ owner: zabbix
+ group: zabbix
+ mode: 0400
+ become: true
+ when:
+ - ansible_os_family != "Windows"
+ notify:
+ - restart zabbix-agent
+ - restart mac zabbix agent
+ when:
+ - zabbix_agent_tlspskfile is defined
+ - zabbix_agent_tlspsk_secret is defined
+ tags:
+ - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/selinux.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/selinux.yml
index 2b11d1a47..21e176db6 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/selinux.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/selinux.yml
@@ -29,7 +29,7 @@
until: zabbix_agent_policycoreutils_installed is succeeded
when:
- ansible_os_family == "RedHat"
- - (zabbix_agent_distribution_major_version == "6" or zabbix_agent_distribution_major_version == "7")
+ - ansible_distribution_major_version == "7"
become: true
tags:
- install
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto.yml
deleted file mode 100644
index ad7d49aa3..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- ansible.builtin.include_tasks: tlspsk_auto_linux.yml
- when: (ansible_os_family != "Windows") or (zabbix_agent_docker | bool)
-
-- ansible.builtin.include_tasks: tlspsk_auto_windows.yml
- when: ansible_os_family == "Windows"
-
-- name: AutoPSK | Default tlsaccept and tlsconnect to enforce PSK
- ansible.builtin.set_fact:
- zabbix_agent_tlsaccept: psk
- zabbix_agent_tlsconnect: psk
- when: zabbix_api_create_hosts
- tags:
- - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2.yml
deleted file mode 100644
index 6e5f8dc4d..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- include_tasks: tlspsk_auto_agent2_linux.yml
- when: (ansible_os_family != "Windows") or (zabbix_agent_docker | bool)
-
-- include_tasks: tlspsk_auto_agent2_windows.yml
- when: ansible_os_family == "Windows"
-
-- name: AutoPSK | Default tlsaccept and tlsconnect to enforce PSK
- ansible.builtin.set_fact:
- zabbix_agent2_tlsaccept: psk
- zabbix_agent2_tlsconnect: psk
- when: zabbix_api_create_hosts
- tags:
- - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_common.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_common.yml
deleted file mode 100644
index 3f6e0d2cd..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_common.yml
+++ /dev/null
@@ -1,53 +0,0 @@
----
-# Process PSK Secret
-- name: AutoPSK | Save existing TLS PSK secret
- ansible.builtin.set_fact:
- zabbix_agent2_tlspsk_read: "{{ zabbix_agent2_tlspsk_base64['content'] | b64decode | trim }}"
- when: zabbix_agent2_tlspskcheck.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Use existing TLS PSK secret
- ansible.builtin.set_fact:
- zabbix_agent2_tlspsk_secret: "{{ zabbix_agent2_tlspsk_read }}"
- when:
- - zabbix_agent2_tlspskcheck.stat.exists
- - zabbix_agent2_tlspsk_read|length >= 32
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Generate new TLS PSK secret
- ansible.builtin.set_fact:
- zabbix_agent2_tlspsk_secret: "{{ lookup('password', '/dev/null chars=hexdigits length=64') }}"
- when:
- - not zabbix_agent2_tlspskcheck.stat.exists
- - (zabbix_agent2_tlspsk_read is not defined) or (zabbix_agent2_tlspsk_read|length < 32)
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-# Process PSK Identity
-- name: AutoPSK | Use existing TLS PSK identity
- ansible.builtin.set_fact:
- zabbix_agent2_tlspskidentity: "{{ zabbix_agent2_tlspskidentity_base64['content'] | b64decode | trim }}"
- when:
- - zabbix_agent2_tlspskidentity_check.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Generate new TLS PSK identity
- ansible.builtin.set_fact:
- zabbix_agent2_tlspskidentity: >-
- {{
- zabbix_agent_visible_hostname
- | default(((zabbix_agent2 == True) | ternary(zabbix_agent2_hostname, zabbix_agent_hostname)))
- + '_'
- + lookup('password', '/dev/null chars=hexdigits length=4')
- }}
- when: not zabbix_agent2_tlspskidentity_check.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_linux.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_linux.yml
deleted file mode 100644
index aaff36128..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_linux.yml
+++ /dev/null
@@ -1,80 +0,0 @@
----
-- name: AutoPSK | Set default path variables (Linux)
- ansible.builtin.set_fact:
- zabbix_agent2_tlspskfile: "/etc/zabbix/tls_psk_auto.secret"
- zabbix_agent2_tlspskidentity_file: "/etc/zabbix/tls_psk_auto.identity"
- tags:
- - config
-
-- name: AutoPSK | Check for existing TLS PSK file (Linux)
- ansible.builtin.stat:
- path: "{{ zabbix_agent2_tlspskfile }}"
- register: zabbix_agent2_tlspskcheck
- become: true
- tags:
- - config
-
-- name: AutoPSK | Check for existing TLS PSK identity (Linux)
- ansible.builtin.stat:
- path: "{{ zabbix_agent2_tlspskidentity_file }}"
- register: zabbix_agent2_tlspskidentity_check
- become: true
- tags:
- - config
-
-- name: AutoPSK | read existing TLS PSK file (Linux)
- ansible.builtin.slurp:
- src: "{{ zabbix_agent2_tlspskfile }}"
- register: zabbix_agent2_tlspsk_base64
- become: true
- when:
- - zabbix_agent2_tlspskcheck.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Read existing TLS PSK identity file (Linux)
- ansible.builtin.slurp:
- src: "{{ zabbix_agent2_tlspskidentity_file }}"
- register: zabbix_agent2_tlspskidentity_base64
- become: true
- when: zabbix_agent2_tlspskidentity_check.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- include_tasks: tlspsk_auto_agent2_common.yml
-
-- name: AutoPSK | Template TLS PSK identity in file (Linux)
- ansible.builtin.copy:
- dest: "{{ zabbix_agent2_tlspskidentity_file }}"
- content: "{{ zabbix_agent2_tlspskidentity }}"
- owner: zabbix
- group: zabbix
- mode: 0400
- become: true
- when:
- - zabbix_agent2_tlspskidentity_file is defined
- - zabbix_agent2_tlspskidentity is defined
- notify:
- - restart zabbix-agent
- - restart mac zabbix agent
- tags:
- - config
-
-- name: AutoPSK | Template TLS PSK secret in file (Linux)
- ansible.builtin.copy:
- dest: "{{ zabbix_agent2_tlspskfile }}"
- content: "{{ zabbix_agent2_tlspsk_secret }}"
- owner: zabbix
- group: zabbix
- mode: 0400
- become: true
- when:
- - zabbix_agent2_tlspskfile is defined
- - zabbix_agent2_tlspsk_secret is defined
- notify:
- - restart zabbix-agent
- - restart mac zabbix agent
- tags:
- - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_windows.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_windows.yml
deleted file mode 100644
index 3e1529e6b..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_agent2_windows.yml
+++ /dev/null
@@ -1,66 +0,0 @@
----
-- name: AutoPSK | Set default path variables for Windows
- ansible.builtin.set_fact:
- zabbix_agent2_tlspskfile: "{{ zabbix_win_install_dir }}\\tls_psk_auto.secret.txt"
- zabbix_agent2_tlspskidentity_file: "{{ zabbix_win_install_dir }}\\tls_psk_auto.identity.txt"
- tags:
- - config
-
-- name: AutoPSK | Check for existing TLS PSK file (Windows)
- ansible.windows.win_stat:
- path: "{{ zabbix_agent2_tlspskfile }}"
- register: zabbix_agent2_tlspskcheck
- tags:
- - config
-
-- name: AutoPSK | Check for existing TLS PSK identity (Windows)
- ansible.windows.win_stat:
- path: "{{ zabbix_agent2_tlspskidentity_file }}"
- register: zabbix_agent2_tlspskidentity_check
- tags:
- - config
-
-- name: AutoPSK | read existing TLS PSK file (Windows)
- ansible.builtin.slurp:
- src: "{{ zabbix_agent2_tlspskfile }}"
- register: zabbix_agent2_tlspsk_base64
- when:
- - zabbix_agent2_tlspskcheck.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Read existing TLS PSK identity file (Windows)
- ansible.builtin.slurp:
- src: "{{ zabbix_agent2_tlspskidentity_file }}"
- register: zabbix_agent2_tlspskidentity_base64
- when: zabbix_agent2_tlspskidentity_check.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- ansible.builtin.include_tasks: tlspsk_auto_agent2_common.yml
-
-- name: Windows | AutoPSK | Template TLS PSK identity in file (Windows)
- ansible.windows.win_copy:
- dest: "{{ zabbix_agent2_tlspskidentity_file }}"
- content: "{{ zabbix_agent2_tlspskidentity }}"
- when:
- - zabbix_agent2_tlspskidentity_file is defined
- - zabbix_agent2_tlspskidentity is defined
- notify:
- - restart win zabbix agent
- tags:
- - config
-
-- name: AutoPSK | Template TLS PSK secret in file (Windows)
- ansible.windows.win_copy:
- dest: "{{ zabbix_agent2_tlspskfile }}"
- content: "{{ zabbix_agent2_tlspsk_secret }}"
- when:
- - zabbix_agent2_tlspskfile is defined
- - zabbix_agent2_tlspsk_secret is defined
- notify:
- - restart win zabbix agent
- tags:
- - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_common.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_common.yml
deleted file mode 100644
index 05ef24d0e..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_common.yml
+++ /dev/null
@@ -1,52 +0,0 @@
----
-# Process PSK Secret
-- name: AutoPSK | Save existing TLS PSK secret
- ansible.builtin.set_fact:
- zabbix_agent_tlspsk_read: "{{ zabbix_agent_tlspsk_base64['content'] | b64decode | trim }}"
- when: zabbix_agent_tlspskcheck.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Use existing TLS PSK secret
- ansible.builtin.set_fact:
- zabbix_agent_tlspsk_secret: "{{ zabbix_agent_tlspsk_read }}"
- when:
- - zabbix_agent_tlspskcheck.stat.exists
- - zabbix_agent_tlspsk_read|length >= 32
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Generate new TLS PSK secret
- ansible.builtin.set_fact:
- zabbix_agent_tlspsk_secret: "{{ lookup('password', '/dev/null chars=hexdigits length=64') }}"
- when:
- - (not zabbix_agent_tlspskcheck.stat.exists) or (zabbix_agent_tlspsk_read|length < 32)
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-# Process PSK Identity
-- name: AutoPSK | Use existing TLS PSK identity
- ansible.builtin.set_fact:
- zabbix_agent_tlspskidentity: "{{ zabbix_agent_tlspskidentity_base64['content'] | b64decode | trim }}"
- when:
- - zabbix_agent_tlspskidentity_check.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Generate new TLS PSK identity
- ansible.builtin.set_fact:
- zabbix_agent_tlspskidentity: >-
- {{
- zabbix_agent_visible_hostname
- | default(((zabbix_agent2 != True) | ternary(zabbix_agent_hostname, zabbix_agent_hostname)))
- + '_'
- + lookup('password', '/dev/null chars=hexdigits length=4')
- }}
- when: not zabbix_agent_tlspskidentity_check.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_linux.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_linux.yml
deleted file mode 100644
index 8cc711fcb..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_linux.yml
+++ /dev/null
@@ -1,80 +0,0 @@
----
-- name: AutoPSK | Set default path variables (Linux)
- ansible.builtin.set_fact:
- zabbix_agent_tlspskfile: "/etc/zabbix/tls_psk_auto.secret"
- zabbix_agent_tlspskidentity_file: "/etc/zabbix/tls_psk_auto.identity"
- tags:
- - config
-
-- name: AutoPSK | Check for existing TLS PSK file (Linux)
- ansible.builtin.stat:
- path: "{{ zabbix_agent_tlspskfile }}"
- register: zabbix_agent_tlspskcheck
- become: true
- tags:
- - config
-
-- name: AutoPSK | Check for existing TLS PSK identity (Linux)
- ansible.builtin.stat:
- path: "{{ zabbix_agent_tlspskidentity_file }}"
- register: zabbix_agent_tlspskidentity_check
- become: true
- tags:
- - config
-
-- name: AutoPSK | read existing TLS PSK file (Linux)
- ansible.builtin.slurp:
- src: "{{ zabbix_agent_tlspskfile }}"
- register: zabbix_agent_tlspsk_base64
- become: true
- when:
- - zabbix_agent_tlspskcheck.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Read existing TLS PSK identity file (Linux)
- ansible.builtin.slurp:
- src: "{{ zabbix_agent_tlspskidentity_file }}"
- register: zabbix_agent_tlspskidentity_base64
- become: true
- when: zabbix_agent_tlspskidentity_check.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- include_tasks: tlspsk_auto_common.yml
-
-- name: AutoPSK | Template TLS PSK identity in file (Linux)
- ansible.builtin.copy:
- dest: "{{ zabbix_agent_tlspskidentity_file }}"
- content: "{{ zabbix_agent_tlspskidentity }}"
- owner: zabbix
- group: zabbix
- mode: 0400
- become: true
- when:
- - zabbix_agent_tlspskidentity_file is defined
- - zabbix_agent_tlspskidentity is defined
- notify:
- - restart zabbix-agent
- - restart mac zabbix agent
- tags:
- - config
-
-- name: AutoPSK | Template TLS PSK secret in file (Linux)
- ansible.builtin.copy:
- dest: "{{ zabbix_agent_tlspskfile }}"
- content: "{{ zabbix_agent_tlspsk_secret }}"
- owner: zabbix
- group: zabbix
- mode: 0400
- become: true
- when:
- - zabbix_agent_tlspskfile is defined
- - zabbix_agent_tlspsk_secret is defined
- notify:
- - restart zabbix-agent
- - restart mac zabbix agent
- tags:
- - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_windows.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_windows.yml
deleted file mode 100644
index b9289ac49..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/tlspsk_auto_windows.yml
+++ /dev/null
@@ -1,67 +0,0 @@
----
-- name: AutoPSK | Set default path variables for Windows
- ansible.builtin.set_fact:
- zabbix_agent_tlspskfile: "{{ zabbix_win_install_dir }}\\tls_psk_auto.secret.txt"
- zabbix_agent_tlspskidentity_file: "{{ zabbix_win_install_dir }}\\tls_psk_auto.identity.txt"
- tags:
- - config
-
-- name: AutoPSK | Check for existing TLS PSK file (Windows)
- ansible.windows.win_stat:
- path: "{{ zabbix_agent_tlspskfile }}"
- register: zabbix_agent_tlspskcheck
- tags:
- - config
-
-- name: AutoPSK | Check for existing TLS PSK identity (Windows)
- ansible.windows.win_stat:
- path: "{{ zabbix_agent_tlspskidentity_file }}"
- register: zabbix_agent_tlspskidentity_check
- tags:
- - config
-
-- name: AutoPSK | read existing TLS PSK file (Windows)
- ansible.builtin.slurp:
- src: "{{ zabbix_agent_tlspskfile }}"
- register: zabbix_agent_tlspsk_base64
- when:
- - zabbix_agent_tlspskcheck.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- name: AutoPSK | Read existing TLS PSK identity file (Windows)
- ansible.builtin.slurp:
- src: "{{ zabbix_agent_tlspskidentity_file }}"
- register: zabbix_agent_tlspskidentity_base64
- when: zabbix_agent_tlspskidentity_check.stat.exists
- no_log: "{{ ansible_verbosity < 3 }}"
- tags:
- - config
-
-- include_tasks: tlspsk_auto_common.yml
-
-- name: AutoPSK | Template TLS PSK identity in file (Windows)
- ansible.windows.win_copy:
- dest: "{{ zabbix_agent_tlspskidentity_file }}"
- content: "{{ zabbix_agent_tlspskidentity }}"
- when:
- - zabbix_agent_tlspskidentity_file is defined
- - zabbix_agent_tlspskidentity is defined
- notify:
- - restart win zabbix agent
- tags:
- - config
-
-- name: AutoPSK | Template TLS PSK secret in file (Windows)
- ansible.windows.win_copy:
- dest: "{{ zabbix_agent_tlspskfile }}"
- content: "{{ zabbix_agent_tlspsk_secret }}"
- when:
- - zabbix_agent_tlspskfile is defined
- - zabbix_agent_tlspsk_secret is defined
- - ansible_os_family == "Windows"
- notify:
- - restart win zabbix agent
- tags:
- - config
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/templates/agent.conf.j2 b/ansible_collections/community/zabbix/roles/zabbix_agent/templates/agent.conf.j2
new file mode 100644
index 000000000..7cf1d97e4
--- /dev/null
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/templates/agent.conf.j2
@@ -0,0 +1,142 @@
+{{ ansible_managed | comment }}
+# This is a configuration file for Zabbix Server process
+# To get more information about Zabbix, visit http://www.zabbix.com
+
+# This configuration file is "minimalized", which means all the original comments
+# are removed. The full documentation for your Zabbix Server can be found here:
+# https://www.zabbix.com/documentation/{{ zabbix_agent_version }}/en/manual/appendix/config/
+
+{% if zabbix_agent_aliases is defined and zabbix_agent_aliases %}
+{% if zabbix_agent_aliases is string %}
+Alias={{ zabbix_agent_aliases }}
+{% else %}
+{% for item in zabbix_agent_aliases %}
+Alias={{ item }}
+{% endfor %}
+{% endif %}
+{% else %}
+# Alias=
+{% endif %}
+{% if zabbix_agent_allowkeys is defined and zabbix_agent_allowkeys %}
+{% if zabbix_agent_allowkeys is string %}
+AllowKey={{ zabbix_agent_allowkeys }}
+{% else %}
+{% for item in zabbix_agent_allowkeys %}
+AllowKey={{ item }}
+{% endfor %}
+{% endif %}
+{% else %}
+# AllowKey=
+{% endif %}
+{% if not zabbix_agent2 and ansible_os_family != "Windows" %}
+{{ (zabbix_agent_allowroot is defined and zabbix_agent_allowroot is not none) | ternary('', '# ') }}AllowRoot={{ zabbix_agent_allowroot | default('') }}
+{% endif %}
+{{ (zabbix_agent_buffersend is defined and zabbix_agent_buffersend is not none) | ternary('', '# ') }}BufferSend={{ zabbix_agent_buffersend | default('') }}
+{{ (zabbix_agent_buffersize is defined and zabbix_agent_buffersize is not none) | ternary('', '# ') }}BufferSize={{ zabbix_agent_buffersize | default('') }}
+{% if zabbix_agent2 %}
+{{ (zabbix_agent_controlsocket is defined and zabbix_agent_controlsocket is not none) | ternary('', '# ') }}ControlSocket={{ zabbix_agent_controlsocket | default('') }}
+{% endif %}
+{{ (zabbix_agent_debuglevel is defined and zabbix_agent_debuglevel is not none) | ternary('', '# ') }}DebugLevel={{ zabbix_agent_debuglevel | default('') }}
+{% if zabbix_agent_denykeys is defined and zabbix_agent_denykeys %}
+{% if zabbix_agent_denykeys is string %}
+DenyKey={{ zabbix_agent_denykeys }}
+{% else %}
+{% for item in zabbix_agent_denykeys %}
+DenyKey={{ item }}
+{% endfor %}
+{% endif %}
+{% else %}
+# DenyKey=
+{% endif %}
+{% if not zabbix_agent2 %}
+{{ (zabbix_agent_enableremotecommands is defined and zabbix_agent_enableremotecommands is not none) | ternary('', '# ') }}EnableRemoteCommands={{ zabbix_agent_enableremotecommands | default('') }}
+{% endif %}
+{% if zabbix_agent2 %}
+{{ (zabbix_agent_forceactivechecksonstart is defined and zabbix_agent_forceactivechecksonstart is not none) | ternary('', '# ') }}ForceActiveChecksOnStart={{ zabbix_agent_forceactivechecksonstart | default('') }}
+{% endif %}
+{% if zabbix_agent_version is version_compare('6.2', '>=') %}
+{{ (zabbix_agent_heartbeatfrequency is defined and zabbix_agent_heartbeatfrequency is not none) | ternary('', '# ') }}HeartbeatFrequency={{ zabbix_agent_heartbeatfrequency | default('') }}
+{% endif %}
+{{ (zabbix_agent_hostinterface is defined and zabbix_agent_hostinterface is not none) | ternary('', '# ') }}HostInterface={{ zabbix_agent_hostinterface | default('') }}
+{{ (zabbix_agent_hostinterfaceitem is defined and zabbix_agent_hostinterfaceitem is not none) | ternary('', '# ') }}HostInterfaceItem={{ zabbix_agent_hostinterfaceitem | default('') }}
+{{ (zabbix_agent_hostmetadata is defined and zabbix_agent_hostmetadata is not none) | ternary('', '# ') }}HostMetadata={{ zabbix_agent_hostmetadata | default('') }}
+{{ (zabbix_agent_hostmetadataitem is defined and zabbix_agent_hostmetadataitem is not none) | ternary('', '# ') }}HostMetadataItem={{ zabbix_agent_hostmetadataitem | default('') }}
+{{ (zabbix_agent_hostname is defined and zabbix_agent_hostname is not none) | ternary('', '# ') }}Hostname={{ zabbix_agent_hostname | default('') }}
+{{ (zabbix_agent_hostnameitem is defined and zabbix_agent_hostnameitem is not none) | ternary('', '# ') }}HostnameItem={{ zabbix_agent_hostnameitem | default('') }}
+{{ (zabbix_agent_include is defined and zabbix_agent_include is not none) | ternary('', '# ') }}Include={{ zabbix_agent_include | default('') }}
+{% if not zabbix_agent2 %}
+{{ (zabbix_agent_listenbacklog is defined and zabbix_agent_listenbacklog is not none) | ternary('', '# ') }}ListenBacklog={{ zabbix_agent_listenbacklog | default('') }}
+{% endif %}
+{{ (zabbix_agent_listenip is defined and zabbix_agent_listenip is not none) | ternary('', '# ') }}ListenIP={{ zabbix_agent_listenip | default('') }}
+{{ (zabbix_agent_listenport is defined and zabbix_agent_listenport is not none) | ternary('', '# ') }}ListenPort={{ zabbix_agent_listenport | default('') }}
+{% if not zabbix_agent2 and ansible_os_family != "Windows" %}
+{{ (zabbix_agent_loadmodule is defined and zabbix_agent_loadmodule is not none) | ternary('', '# ') }}LoadModule={{ zabbix_agent_loadmodule | default('') }}
+{{ (zabbix_agent_loadmodulepath is defined and zabbix_agent_loadmodulepath is not none) | ternary('', '# ') }}LoadModulePath={{ zabbix_agent_loadmodulepath | default('') }}
+{% endif %}
+{{ (zabbix_agent_logfile is defined and zabbix_agent_logfile is not none) | ternary('', '# ') }}LogFile={{ zabbix_agent_logfile | default('') }}
+{{ (zabbix_agent_logfilesize is defined and zabbix_agent_logfilesize is not none) | ternary('', '# ') }}LogFileSize={{ zabbix_agent_logfilesize | default('') }}
+{% if not zabbix_agent2 %}
+{{ (zabbix_agent_logremotecommands is defined and zabbix_agent_logremotecommands is not none) | ternary('', '# ') }}LogRemoteCommands={{ zabbix_agent_logremotecommands | default('') }}
+{% endif %}
+{{ (zabbix_agent_logtype is defined and zabbix_agent_logtype is not none) | ternary('', '# ') }}LogType={{ zabbix_agent_logtype | default('') }}
+{% if not zabbix_agent2 %}
+{{ (zabbix_agent_maxlinespersecond is defined and zabbix_agent_maxlinespersecond is not none) | ternary('', '# ') }}MaxLinesPerSecond={{ zabbix_agent_maxlinespersecond | default('') }}
+{% endif %}
+{% if not zabbix_agent2 and ansible_os_family == "Windows" %}
+{{ (zabbix_agent_perfcounter is defined and zabbix_agent_perfcounter is not none) | ternary('', '# ') }}PerfCounter={{ zabbix_agent_perfcounter | default('') }}
+{{ (zabbix_agent_perfcounteren is defined and zabbix_agent_perfcounteren is not none) | ternary('', '# ') }}PerfCounterEn={{ zabbix_agent_perfcounteren | default('') }}
+{% endif %}
+{% if zabbix_agent2 %}
+{{ (zabbix_agent_persistentbufferfile is defined and zabbix_agent_persistentbufferfile is not none) | ternary('', '# ') }}PersistentBufferFile={{ zabbix_agent_persistentbufferfile | default('') }}
+{{ (zabbix_agent_persistentbufferperiod is defined and zabbix_agent_persistentbufferperiod is not none) | ternary('', '# ') }}PersistentBufferPeriod={{ zabbix_agent_persistentbufferperiod | default('') }}
+{% endif %}
+{% if ansible_os_family != "Windows" %}
+{{ (zabbix_agent_pidfile is defined and zabbix_agent_pidfile is not none) | ternary('', '# ') }}PidFile={{ zabbix_agent_pidfile | default('') }}
+{% endif %}
+{% if zabbix_agent_plugins is defined and zabbix_agent_plugins %}
+{% for entry in zabbix_agent_plugins %}
+{% set my_name = entry['name'] %}
+{% for property in entry['options'] %}
+{% set param = property['parameter'] %}
+{% set value = property['value'] %}
+Plugins.{{ my_name }}.{{ param }}={{ value }}
+{% endfor %}
+{% endfor %}
+{% endif %}
+{{ (zabbix_agent_pluginsocket is defined and zabbix_agent_pluginsocket is not none) | ternary('', '# ') }}PluginSocket={{ zabbix_agent_pluginsocket | default('') }}
+{{ (zabbix_agent_plugintimeout is defined and zabbix_agent_plugintimeout is not none) | ternary('', '# ') }}PluginTimeout={{ zabbix_agent_plugintimeout | default('') }}
+{{ (zabbix_agent_refreshactivechecks is defined and zabbix_agent_refreshactivechecks is not none) | ternary('', '# ') }}RefreshActiveChecks={{ zabbix_agent_refreshactivechecks | default('') }}
+{{ (zabbix_agent_server is defined and zabbix_agent_server is not none) | ternary('', '# ') }}Server={{ zabbix_agent_server | default('') }}
+{{ (zabbix_agent_serveractive is defined and zabbix_agent_serveractive is not none) | ternary('', '# ') }}ServerActive={{ zabbix_agent_serveractive | default('') }}
+{{ (zabbix_agent_sourceip is defined and zabbix_agent_sourceip is not none) | ternary('', '# ') }}SourceIP={{ zabbix_agent_sourceip | default('') }}
+{% if not zabbix_agent2 %}
+{{ (zabbix_agent_startagents is defined and zabbix_agent_startagents is not none) | ternary('', '# ') }}StartAgents={{ zabbix_agent_startagents | default('') }}
+{% endif %}
+{% if zabbix_agent2 %}
+{{ (zabbix_agent_statusport is defined and zabbix_agent_statusport is not none) | ternary('', '# ') }}StatusPort={{ zabbix_agent_statusport | default('') }}
+{% endif %}
+{{ (zabbix_agent_timeout is defined and zabbix_agent_timeout is not none) | ternary('', '# ') }}Timeout={{ zabbix_agent_timeout | default('') }}
+{{ (zabbix_agent_tlsconnect is defined and zabbix_agent_tlsconnect is not none) | ternary('', '# ') }}TLSAccept={{ zabbix_agent_tlsconnect | default('') }}
+{{ (zabbix_agent_tlscafile is defined and zabbix_agent_tlscafile is not none) | ternary('', '# ') }}TLSCAFile={{ zabbix_agent_tlscafile | default('') }}
+{{ (zabbix_agent_tlscertfile is defined and zabbix_agent_tlscertfile is not none) | ternary('', '# ') }}TLSCertFile={{ zabbix_agent_tlscertfile | default('') }}
+{% if not zabbix_agent2 and ansible_os_family != "Windows" %}
+{{ (zabbix_agent_tlscipherall is defined and zabbix_agent_tlscipherall is not none) | ternary('', '# ') }}TLSCipherAll={{ zabbix_agent_tlscipherall | default('') }}
+{{ (zabbix_agent_tlscipherall13 is defined and zabbix_agent_tlscipherall13 is not none) | ternary('', '# ') }}TLSCipherAll13={{ zabbix_agent_tlscipherall13 | default('') }}
+{{ (zabbix_agent_tlsciphercert is defined and zabbix_agent_tlsciphercert is not none) | ternary('', '# ') }}TLSCipherCert={{ zabbix_agent_tlsciphercert | default('') }}
+{{ (zabbix_agent_tlsciphercert13 is defined and zabbix_agent_tlsciphercert13 is not none) | ternary('', '# ') }}TLSCipherCert13={{ zabbix_agent_tlsciphercert13 | default('') }}
+{{ (zabbix_agent_tlscipherpsk is defined and zabbix_agent_tlscipherpsk is not none) | ternary('', '# ') }}TLSCipherPSK={{ zabbix_agent_tlscipherpsk | default('') }}
+{{ (zabbix_agent_tlscipherpsk13 is defined and zabbix_agent_tlscipherpsk13 is not none) | ternary('', '# ') }}TLSCipherPSK13={{ zabbix_agent_tlscipherpsk13 | default('') }}
+{% endif %}
+{{ (zabbix_agent_tlsconnect is defined and zabbix_agent_tlsconnect is not none) | ternary('', '# ') }}TLSConnect={{ zabbix_agent_tlsconnect | default('') }}
+{{ (zabbix_agent_tlscrlfile is defined and zabbix_agent_tlscrlfile is not none) | ternary('', '# ') }}TLSCRLFile={{ zabbix_agent_tlscrlfile | default('') }}
+{{ (zabbix_agent_tlskeyfile is defined and zabbix_agent_tlskeyfile is not none) | ternary('', '# ') }}TLSKeyFile={{ zabbix_agent_tlskeyfile | default('') }}
+{{ (zabbix_agent_tlspskfile is defined and zabbix_agent_tlspskfile is not none) | ternary('', '# ') }}TLSPSKFile={{ zabbix_agent_tlspskfile | default('') }}
+{{ (zabbix_agent_tlspskidentity is defined and zabbix_agent_tlspskidentity is not none) | ternary('', '# ') }}TLSPSKIdentity={{ zabbix_agent_tlspskidentity | default('') }}
+{{ (zabbix_agent_tlsservercertissuer is defined and zabbix_agent_tlsservercertissuer is not none) | ternary('', '# ') }}TLSServerCertIssuer={{ zabbix_agent_tlsservercertissuer | default('') }}
+{{ (zabbix_agent_tlsservercertsubject is defined and zabbix_agent_tlsservercertsubject is not none) | ternary('', '# ') }}TLSServerCertSubject={{ zabbix_agent_tlsservercertsubject | default('') }}
+{{ (zabbix_agent_unsafeuserparameters is defined and zabbix_agent_unsafeuserparameters is not none) | ternary('', '# ') }}UnsafeUserParameters={{ zabbix_agent_unsafeuserparameters | default('') }}
+{% if not zabbix_agent2 and ansible_os_family != "Windows" %}
+{{ (zabbix_agent_runas_user is defined and zabbix_agent_runas_user is not none) | ternary('', '# ') }}User={{ zabbix_agent_runas_user | default('') }}
+{% endif %}
+{{ (zabbix_agent_userparamater is defined and zabbix_agent_userparamater is not none) | ternary('', '# ') }}UserParameter={{ zabbix_agent_userparamater | default('') }}
+{{ (zabbix_agent_userparamaterdir is defined and zabbix_agent_userparamaterdir is not none) | ternary('', '# ') }}UserParameterDir={{ zabbix_agent_userparamaterdir | default('') }}
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/templates/zabbix_agent2.conf.j2 b/ansible_collections/community/zabbix/roles/zabbix_agent/templates/zabbix_agent2.conf.j2
deleted file mode 100644
index ea60d032e..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/templates/zabbix_agent2.conf.j2
+++ /dev/null
@@ -1,140 +0,0 @@
-{{ ansible_managed | comment }}
-# This is a configuration file for Zabbix Agent 2
-# To get more information about Zabbix, visit http://www.zabbix.com
-
-# This configuration file is "minimalized", which means all the original comments
-# are removed. The full documentation for your Zabbix Agent 2 can be found here:
-# https://www.zabbix.com/documentation/{{ zabbix_agent_version }}/en/manual/appendix/config/zabbix_agent2{{ "_win" if ansible_os_family == "Windows" else "" }}
-
-{% if ansible_os_family != "Windows" %}
-PidFile={{ zabbix_agent2_pidfile }}
-{% endif %}
-LogType={{ zabbix_agent2_logtype }}
-{% if ansible_os_family == "Windows" %}
-LogFile={{ zabbix_agent2_win_logfile }}
-{% else %}
-LogFile={{ zabbix_agent2_logfile }}
-{% endif %}
-LogFileSize={{ zabbix_agent2_logfilesize }}
-DebugLevel={{ zabbix_agent2_debuglevel }}
-{% if zabbix_agent2_sourceip is defined and zabbix_agent2_sourceip %}
-SourceIP={{ zabbix_agent2_sourceip }}
-{% endif %}
-Server={{ zabbix_agent2_server }}
-ListenPort={{ zabbix_agent2_listenport }}
-{% if zabbix_agent2_listenip is defined and zabbix_agent2_listenip !='0.0.0.0' and zabbix_agent2_listenip %}
-ListenIP={{ zabbix_agent2_listenip }}
-{% endif %}
-{% if zabbix_agent2_statusport is defined and zabbix_agent2_statusport %}
-StatusPort={{ zabbix_agent2_statusport }}
-{% endif %}
-ServerActive={{ zabbix_agent2_serveractive }}
-{% if zabbix_agent2_hostname is defined and zabbix_agent2_hostname %}
-Hostname={{ zabbix_agent2_hostname }}
-{% endif %}
-{% if zabbix_agent2_hostnameitem is defined and zabbix_agent2_hostnameitem %}
-HostnameItem={{ zabbix_agent2_hostnameitem }}
-{% endif %}
-{% if zabbix_agent2_hostmetadata is defined and zabbix_agent2_hostmetadata %}
-HostMetadata={{ zabbix_agent2_hostmetadata }}
-{% endif %}
-{% if zabbix_agent2_hostmetadataitem is defined and zabbix_agent2_hostmetadataitem %}
-HostMetadataItem={{ zabbix_agent2_hostmetadataitem }}
-{% endif %}
-{% if zabbix_agent2_hostinterface is defined and zabbix_agent2_hostinterface %}
-HostInterface={{ zabbix_agent2_hostinterface }}
-{% endif %}
-{% if zabbix_agent2_hostinterfaceitem is defined and zabbix_agent2_hostinterfaceitem %}
-HostInterfaceItem={{ zabbix_agent2_hostinterfaceitem }}
-{% endif %}
-{% if zabbix_agent2_allow_key is defined and zabbix_agent2_allow_key %}
-{% for item in zabbix_agent2_allow_key %}
-AllowKey={{ item }}
-{% endfor %}
-{% endif %}
-{% if zabbix_agent2_deny_key is defined and zabbix_agent2_deny_key %}
-{% for item in zabbix_agent2_deny_key %}
-DenyKey={{ item }}
-{% endfor %}
-{% endif %}
-RefreshActiveChecks={{ zabbix_agent2_refreshactivechecks }}
-BufferSend={{ zabbix_agent2_buffersend }}
-BufferSize={{ zabbix_agent2_buffersize }}
-{% if zabbix_agent2_enablepersistentbuffer is defined and zabbix_agent2_enablepersistentbuffer %}
-EnablePersistentBuffer={{ zabbix_agent2_enablepersistentbuffer }}
-{% endif %}
-{% if zabbix_agent2_persistentbufferperiod is defined and zabbix_agent2_persistentbufferperiod %}
-PersistentBufferPeriod={{ zabbix_agent2_persistentbufferperiod }}
-{% endif %}
-{% if zabbix_agent2_persistentbufferfile is defined and zabbix_agent2_persistentbufferfile %}
-PersistentBufferFile={{ zabbix_agent2_persistentbufferfile }}
-{% endif %}
-{% if zabbix_agent2_zabbix_alias is defined and zabbix_agent2_zabbix_alias %}
-{% if zabbix_agent2_zabbix_alias is string %}
-Alias={{ zabbix_agent2_zabbix_alias }}
-{% else %}
-{% for item in zabbix_agent2_zabbix_alias %}
-Alias={{ item }}
-{% endfor %}
-{% endif %}
-{% endif %}
-Timeout={{ zabbix_agent2_timeout }}
-{% if ansible_os_family == "Windows" %}
-Include={{ zabbix_agent_win_include }}
-{% else %}
-Include={{ zabbix_agent2_include }}/{{ zabbix_agent2_include_pattern }}
-{% endif %}
-{% if zabbix_agent2_additional_include is defined and zabbix_agent2_additional_include is iterable and zabbix_agent2_additional_include is not string %}
-{% for include in zabbix_agent2_additional_include %}
-Include={{ include }}
-{% endfor %}
-{% endif %}
-UnsafeUserParameters={{ zabbix_agent2_unsafeuserparameters }}
-{% if ansible_os_family != "Windows" %}
-ControlSocket={{ zabbix_agent2_controlsocket }}
-{% endif %}
-{% if zabbix_agent2_tlsconnect is defined and zabbix_agent2_tlsconnect %}
-TLSConnect={{ zabbix_agent2_tlsconnect }}
-{% endif %}
-{% if zabbix_agent2_tlsaccept is defined and zabbix_agent2_tlsaccept %}
-TLSAccept={{ zabbix_agent2_tlsaccept }}
-{% endif %}
-{% if zabbix_agent2_tlscafile is defined and zabbix_agent2_tlscafile %}
-TLSCAFile={{ zabbix_agent2_tlscafile }}
-{% endif %}
-{% if zabbix_agent2_tlscrlfile is defined and zabbix_agent2_tlscrlfile %}
-TLSCRLFile={{ zabbix_agent2_tlscrlfile }}
-{% endif %}
-{% if zabbix_agent2_tlsservercertissuer is defined and zabbix_agent2_tlsservercertissuer %}
-TLSServerCertIssuer={{ zabbix_agent2_tlsservercertissuer }}
-{% endif %}
-{% if zabbix_agent2_tlsservercertsubject is defined and zabbix_agent2_tlsservercertsubject %}
-TLSServerCertSubject={{ zabbix_agent2_tlsservercertsubject }}
-{% endif %}
-{% if zabbix_agent2_tlscertfile is defined and zabbix_agent2_tlscertfile %}
-TLSCertFile={{ zabbix_agent2_tlscertfile }}
-{% endif %}
-{% if zabbix_agent2_tlskeyfile is defined and zabbix_agent2_tlskeyfile %}
-TLSKeyFile={{ zabbix_agent2_tlskeyfile }}
-{% endif %}
-{% if zabbix_agent2_tlspskidentity is defined and zabbix_agent2_tlspskidentity %}
-TLSPSKIdentity={{ zabbix_agent2_tlspskidentity }}
-{% endif %}
-{% if zabbix_agent2_tlspskfile is defined and zabbix_agent2_tlspskfile %}
-TLSPSKFile={{ zabbix_agent2_tlspskfile }}
-{% endif %}
-{% if zabbix_agent2_plugins is defined and zabbix_agent2_plugins is iterable %}
-{% for entry in zabbix_agent2_plugins %}
-{% set my_name = entry['name'] %}
-{% for property in entry['options'] %}
-{% set param = property['parameter'] %}
-{% set value = property['value'] %}
-Plugins.{{ my_name }}.{{ param }}={{ value }}
-{% endfor %}
-{% endfor %}
-{% endif %}
-{% if zabbix_agent_version is version('6.0', '>=') %}
-{% if zabbix_agent2_listenbacklog is defined and zabbix_agent2_listenbacklog %}
-ListenBacklog={{ zabbix_agent2_listenbacklog }}
-{% endif %}
-{% endif %}
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/templates/zabbix_agentd.conf.j2 b/ansible_collections/community/zabbix/roles/zabbix_agent/templates/zabbix_agentd.conf.j2
deleted file mode 100644
index 24af45bc3..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/templates/zabbix_agentd.conf.j2
+++ /dev/null
@@ -1,149 +0,0 @@
-{{ ansible_managed | comment }}
-# This is a configuration file for Zabbix Agent
-# To get more information about Zabbix, visit http://www.zabbix.com
-
-# This configuration file is "minimalized", which means all the original comments
-# are removed. The full documentation for your Zabbix Agent can be found here:
-# https://www.zabbix.com/documentation/{{ zabbix_agent_version }}/en/manual/appendix/config/zabbix_agentd{{ "_win" if ansible_os_family == "Windows" else "" }}
-
-{% if ansible_os_family != "Windows" %}
-PidFile={{ zabbix_agent_pidfile }}
-{% endif %}
-{% if zabbix_agent_version is version('3.0', '>=') %}
-LogType={{ zabbix_agent_logtype }}
-{% endif %}
-{% if ansible_os_family == "Windows" %}
-LogFile={{ zabbix_agent_win_logfile }}
-{% else %}
-LogFile={{ zabbix_agent_logfile }}
-{% endif %}
-LogFileSize={{ zabbix_agent_logfilesize }}
-DebugLevel={{ zabbix_agent_debuglevel }}
-{% if zabbix_agent_sourceip is defined and zabbix_agent_sourceip %}
-SourceIP={{ zabbix_agent_sourceip }}
-{% endif %}
-{% if zabbix_agent_version is version('6.0', '<=') %}
-EnableRemoteCommands={{ zabbix_agent_enableremotecommands }}
-{% else %}
-{% if zabbix_agent_allowkeys is defined and zabbix_agent_allowkeys %}
-AllowKey={{ zabbix_agent_allowkeys }}
-{% endif %}
-{% if zabbix_agent_denykeys is defined and zabbix_agent_denykeys %}
-DenyKey={{ zabbix_agent_denykeys }}
-{% endif %}
-{% endif %}
-LogRemoteCommands={{ zabbix_agent_logremotecommands }}
-Server={{ zabbix_agent_server }}
-ListenPort={{ zabbix_agent_listenport }}
-{% if zabbix_agent_listenip is defined and zabbix_agent_listenip !='0.0.0.0' and zabbix_agent_listenip %}
-ListenIP={{ zabbix_agent_listenip }}
-{% endif %}
-StartAgents={{ zabbix_agent_startagents }}
-ServerActive={{ zabbix_agent_serveractive }}
-{% if zabbix_agent_hostname is defined and zabbix_agent_hostname %}
-Hostname={{ zabbix_agent_hostname }}
-{% endif %}
-{% if zabbix_agent_hostnameitem is defined and zabbix_agent_hostnameitem %}
-HostnameItem={{ zabbix_agent_hostnameitem }}
-{% endif %}
-{% if zabbix_agent_hostmetadata is defined and zabbix_agent_hostmetadata %}
-HostMetadata={{ zabbix_agent_hostmetadata }}
-{% endif %}
-{% if zabbix_agent_hostmetadataitem is defined and zabbix_agent_hostmetadataitem %}
-HostMetadataItem={{ zabbix_agent_hostmetadataitem }}
-{% endif %}
-{% if zabbix_agent_allow_key is defined and zabbix_agent_allow_key %}
-{% for item in zabbix_agent_allow_key %}
-AllowKey={{ item }}
-{% endfor %}
-{% endif %}
-{% if zabbix_agent_deny_key is defined and zabbix_agent_deny_key %}
-{% for item in zabbix_agent_deny_key %}
-DenyKey={{ item }}
-{% endfor %}
-{% endif %}
-RefreshActiveChecks={{ zabbix_agent_refreshactivechecks }}
-BufferSend={{ zabbix_agent_buffersend }}
-BufferSize={{ zabbix_agent_buffersize }}
-MaxLinesPerSecond={{ zabbix_agent_maxlinespersecond }}
-{% if zabbix_agent_version is version_compare('6.2', '>=') %}
-HeartbeatFrequency={{ zabbix_agent_heartbeatfrequency }}
-{% endif %}
-{% if zabbix_agent_zabbix_alias is defined and zabbix_agent_zabbix_alias %}
-{% if zabbix_agent_zabbix_alias is string %}
-Alias={{ zabbix_agent_zabbix_alias }}
-{% else %}
-{% for item in zabbix_agent_zabbix_alias %}
-Alias={{ item }}
-{% endfor %}
-{% endif %}
-{% endif %}
-Timeout={{ zabbix_agent_timeout }}
-{% if ansible_os_family != "Windows" %}
-AllowRoot={{ zabbix_agent_allowroot }}
-{% endif %}
-{% if zabbix_agent_runas_user is defined and zabbix_agent_runas_user %}
-User={{ zabbix_agent_runas_user }}
-{% endif %}
-{% if ansible_os_family == "Windows" %}
-Include={{ zabbix_agent_win_include }}
-{% else %}
-Include={{ zabbix_agent_include }}/{{ zabbix_agent_include_pattern }}
-{% endif %}
-{% if zabbix_agent_additional_include is defined and zabbix_agent_additional_include is iterable and zabbix_agent_additional_include is not string %}
-{% for include in zabbix_agent_additional_include %}
-Include={{ include }}
-{% endfor %}
-{% endif %}
-UnsafeUserParameters={{ zabbix_agent_unsafeuserparameters }}
-{% if zabbix_agent_version is version_compare('2.2', '>=') %}
-{% if ansible_os_family != "Windows" %}
-LoadModulePath={{ zabbix_agent_loadmodulepath }}
-{% endif %}
-{% endif %}
-{% if zabbix_agent_loadmodule is defined and zabbix_agent_loadmodule %}
-{% if zabbix_agent_loadmodule is string %}
-LoadModule={{ zabbix_agent_loadmodule }}
-{% else %}
-{% for module in zabbix_agent_loadmodule %}
-LoadModule={{ module }}
-{% endfor %}
-{% endif %}
-{% endif %}
-{% if zabbix_agent_version is version_compare('3.0', '>=') %}
-{% if zabbix_agent_tlsconnect is defined and zabbix_agent_tlsconnect %}
-TLSConnect={{ zabbix_agent_tlsconnect }}
-{% endif %}
-{% if zabbix_agent_tlsaccept is defined and zabbix_agent_tlsaccept %}
-TLSAccept={{ zabbix_agent_tlsaccept }}
-{% endif %}
-{% if zabbix_agent_tlscafile is defined and zabbix_agent_tlscafile %}
-TLSCAFile={{ zabbix_agent_tlscafile }}
-{% endif %}
-{% if zabbix_agent_tlscrlfile is defined and zabbix_agent_tlscrlfile %}
-TLSCRLFile={{ zabbix_agent_tlscrlfile }}
-{% endif %}
-{% if zabbix_agent_tlsservercertissuer is defined and zabbix_agent_tlsservercertissuer %}
-TLSServerCertIssuer={{ zabbix_agent_tlsservercertissuer }}
-{% endif %}
-{% if zabbix_agent_tlsservercertsubject is defined and zabbix_agent_tlsservercertsubject %}
-TLSServerCertSubject={{ zabbix_agent_tlsservercertsubject }}
-{% endif %}
-{% if zabbix_agent_tlscertfile is defined and zabbix_agent_tlscertfile %}
-TLSCertFile={{ zabbix_agent_tlscertfile }}
-{% endif %}
-{% if zabbix_agent_tlskeyfile is defined and zabbix_agent_tlskeyfile %}
-TLSKeyFile={{ zabbix_agent_tlskeyfile }}
-{% endif %}
-{% if zabbix_agent_tlspskidentity is defined and zabbix_agent_tlspskidentity %}
-TLSPSKIdentity={{ zabbix_agent_tlspskidentity }}
-{% endif %}
-{% if zabbix_agent_tlspskfile is defined and zabbix_agent_tlspskfile %}
-TLSPSKFile={{ zabbix_agent_tlspskfile }}
-{% endif %}
-{% endif %}
-{% if zabbix_agent_version is version('6.0', '>=') %}
-{% if zabbix_agent_listenbacklog is defined and zabbix_agent_listenbacklog %}
-ListenBacklog={{ zabbix_agent_listenbacklog }}
-{% endif %}
-{% endif %}
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/vars/Debian.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/vars/Debian.yml
index 4a88411f1..0a9b14650 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/vars/Debian.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/vars/Debian.yml
@@ -2,9 +2,6 @@
# vars file for zabbix_agent (Debian)
zabbix_agent: zabbix-agent
-zabbix_agent_service: zabbix-agent
-zabbix_agent_conf: zabbix_agentd.conf
-zabbix_agent2_conf: zabbix_agent2.conf
zabbix_valid_agent_versions:
# Debian
@@ -28,6 +25,10 @@ zabbix_valid_agent_versions:
- 6.2
- 6.0
# Ubuntu
+ "24":
+ - 6.4
+ - 6.0
+
"22":
- 6.4
- 6.2
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/vars/RedHat.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/vars/RedHat.yml
index 50f0b01ec..d4e6c6e3b 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_agent/vars/RedHat.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/vars/RedHat.yml
@@ -2,9 +2,6 @@
# vars file for zabbix_agent (RedHat)
zabbix_agent: zabbix-agent
-zabbix_agent_service: zabbix-agent
-zabbix_agent_conf: zabbix_agentd.conf
-zabbix_agent2_conf: zabbix_agent2.conf
zabbix_valid_agent_versions:
"9":
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/vars/agent2_vars.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/vars/agent2_vars.yml
new file mode 100644
index 000000000..8c03fa23b
--- /dev/null
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/vars/agent2_vars.yml
@@ -0,0 +1,9 @@
+_pidfile: /var/run/zabbix/zabbix_agent2.pid
+_logfile: /var/log/zabbix/zabbix_agent2.log
+_include: /etc/zabbix/zabbix_agent2.d
+_tls_subject: "{{ zabbix_agent_tlsservercertsubject | default(omit) }}" # FIXME this is not correct and should be removed with 2.0.0, here only to prevent regression
+_win_package: zabbix_agent2-{{ zabbix_version_long }}-windows-amd64-openssl-static.zip
+_win_download_link: "{{ zabbix_win_download_url }}/{{ zabbix_version_long | regex_search('^\\d+\\.\\d+') }}/{{ zabbix_version_long }}/{{ zabbix2_win_package }}"
+_win_logfile: "{{ zabbix_win_install_dir }}\\zabbix_agent2.log"
+_agent_service: zabbix-agent2
+_agent_package: zabbix-agent2
diff --git a/ansible_collections/community/zabbix/roles/zabbix_agent/vars/agent_vars.yml b/ansible_collections/community/zabbix/roles/zabbix_agent/vars/agent_vars.yml
new file mode 100644
index 000000000..c37a5ecc3
--- /dev/null
+++ b/ansible_collections/community/zabbix/roles/zabbix_agent/vars/agent_vars.yml
@@ -0,0 +1,10 @@
+_pidfile: /var/run/zabbix/zabbix_agentd.pid
+_logfile: /var/log/zabbix/zabbix_agentd.log
+_include: /etc/zabbix/zabbix_agentd.d
+_tls_subject: "{{ zabbix_agent_tlsservercertsubject | default(omit) }}" # FIXME this is not correct and should be removed with 2.0.0, here only to prevent regression
+_win_package: zabbix_agent-{{ zabbix_version_long }}-windows-amd64-openssl.zip
+_win_download_link: "{{ zabbix_win_download_url }}/{{ zabbix_version_long | regex_search('^\\d+\\.\\d+') }}/{{ zabbix_version_long }}/{{ zabbix_win_package }}"
+_win_logfile: "{{ zabbix_win_install_dir }}\\zabbix_agentd.log"
+_agent_service: zabbix-agent
+_agent_package: zabbix-agent
+_sender_package: zabbix-sender
diff --git a/ansible_collections/community/zabbix/roles/zabbix_javagateway/README.md b/ansible_collections/community/zabbix/roles/zabbix_javagateway/README.md
index 47092a6a0..0de7af814 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_javagateway/README.md
+++ b/ansible_collections/community/zabbix/roles/zabbix_javagateway/README.md
@@ -39,6 +39,7 @@ See the following list of supported Operating systems with the Zabbix releases.
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Red Hat Fam 7 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | V | V | V |
diff --git a/ansible_collections/community/zabbix/roles/zabbix_javagateway/tasks/Debian.yml b/ansible_collections/community/zabbix/roles/zabbix_javagateway/tasks/Debian.yml
index ad762aa3b..fd970ab75 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_javagateway/tasks/Debian.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_javagateway/tasks/Debian.yml
@@ -46,10 +46,15 @@
Components: {{ zabbix_repo_deb_component }}
Architectures: {{ 'amd64' if ansible_machine != 'aarch64' else 'arm64'}}
Signed-By: {{ zabbix_gpg_key }}
+ register: zabbix_repo
become: true
tags:
- install
+- name: "Debian | Update apt cache if repo was added"
+ ansible.builtin.apt: update_cache=yes
+ when: zabbix_repo is changed
+
- name: "Debian | Installing zabbix-java-gateway"
ansible.builtin.apt:
pkg: zabbix-java-gateway
diff --git a/ansible_collections/community/zabbix/roles/zabbix_javagateway/vars/Debian.yml b/ansible_collections/community/zabbix/roles/zabbix_javagateway/vars/Debian.yml
index 7c36d2d3a..0ea96ac7e 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_javagateway/vars/Debian.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_javagateway/vars/Debian.yml
@@ -12,6 +12,9 @@ zabbix_valid_javagateway_versions:
- 6.2
- 6.0
# Ubuntu
+ "24":
+ - 6.4
+ - 6.0
"22":
- 6.4
- 6.2
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/README.md b/ansible_collections/community/zabbix/roles/zabbix_proxy/README.md
index ee558c8b7..703ec6059 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/README.md
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/README.md
@@ -82,6 +82,7 @@ See the following list of supported Operating systems with the Zabbix releases.
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
| Red Hat Fam 7 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | V | V | V |
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/defaults/main.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/defaults/main.yml
index b2b74ebec..635c40f40 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/defaults/main.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/defaults/main.yml
@@ -43,8 +43,6 @@ zabbix_repo_yum_schema: https
zabbix_repo_yum_gpgcheck: 0
zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_proxy_version }}/{{ ansible_facts.lsb.id | default(ansible_facts['distribution']) | lower }}{% if ansible_facts['architecture'] == 'aarch64' and ansible_facts.lsb.id | default(ansible_facts['distribution']) in ['Debian', 'Ubuntu'] %}-arm64{% endif %}"
zabbix_repo_deb_component: main
-zabbix_proxy_disable_repo:
- - epel
zabbix_repo_yum:
- name: zabbix
description: Zabbix Official Repository - $basearch
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/Debian.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/Debian.yml
index bef68b27a..94b56890c 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/Debian.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/Debian.yml
@@ -2,7 +2,6 @@
- name: "Debian | Set short version name"
ansible.builtin.set_fact:
zabbix_short_version: "{{ zabbix_proxy_version | regex_replace('\\.', '') }}"
- zabbix_python_prefix: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}"
zabbix_underscore_version: "{{ zabbix_proxy_version | regex_replace('\\.', '_') }}"
tags:
- always
@@ -102,108 +101,3 @@
become: true
tags:
- install
-
-- name: "Debian | Installing zabbix-proxy-{{ zabbix_proxy_database }}"
- ansible.builtin.apt:
- pkg: "zabbix-proxy-{{ zabbix_proxy_database }}"
- update_cache: true
- cache_valid_time: 0
- force: true
- state: "{{ zabbix_proxy_package_state }}"
- default_release: "{{ ansible_distribution_release }}"
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: is_zabbix_proxy_package_installed
- until: is_zabbix_proxy_package_installed is succeeded
- become: true
- tags:
- - install
-
-- name: "Debian | Installing zabbix-sql-scripts"
- ansible.builtin.apt:
- pkg: zabbix-sql-scripts
- state: "{{ zabbix_proxy_package_state }}"
- update_cache: true
- cache_valid_time: 0
- default_release: "{{ ansible_distribution_release }}"
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: zabbix_proxy_package_sql_installed
- until: zabbix_proxy_package_sql_installed is succeeded
- when:
- - zabbix_proxy_version is version('6.0', '>=')
- become: true
- tags:
- - install
-
-- name: "Debian | Install Ansible module dependencies"
- ansible.builtin.apt:
- name: "{{ zabbix_python_prefix }}-psycopg2"
- state: present
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: zabbix_proxy_dependencies_installed
- until: zabbix_proxy_dependencies_installed is succeeded
- become: true
- when:
- - zabbix_proxy_database_creation
- tags:
- - install
- - dependencies
-
-- name: "Debian | Install Mysql Client package"
- ansible.builtin.apt:
- name: "{{ mysql_client_pkgs[ansible_distribution_major_version] }}"
- state: present
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: zabbix_proxy_dependencies_installed
- until: zabbix_proxy_dependencies_installed is succeeded
- become: true
- when:
- - zabbix_proxy_database == 'mysql'
- - zabbix_proxy_install_database_client
- tags:
- - install
- - dependencies
- - database
-
-- name: "Debian | Install PostgreSQL Client package"
- ansible.builtin.apt:
- name: postgresql-client
- state: present
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: are_zabbix_proxy_dependency_packages_installed
- until: are_zabbix_proxy_dependency_packages_installed is succeeded
- become: true
- when:
- - zabbix_proxy_database_creation or zabbix_proxy_database_sqlload
- - zabbix_proxy_database == 'pgsql'
- - zabbix_proxy_install_database_client
- tags:
- - install
- - dependencies
- - database
-
-- name: "Debian | Install sqlite3"
- ansible.builtin.apt:
- name: sqlite3
- state: present
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: are_zabbix_proxy_dependency_packages_installed
- until: are_zabbix_proxy_dependency_packages_installed is succeeded
- become: true
- when:
- - zabbix_proxy_database == 'sqlite3'
- tags:
- - install
- - dependencies
- - database
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/RedHat.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/RedHat.yml
index f35b3c7b3..a51baee63 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/RedHat.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/RedHat.yml
@@ -7,19 +7,6 @@
tags:
- always
-- name: "RedHat | Define package without version"
- ansible.builtin.set_fact:
- zabbix_proxy_package: "zabbix-proxy-{{ zabbix_proxy_database }}"
- cacheable: true
- tags:
- - always
-
-- name: "RedHat | Set facts for Zabbix"
- ansible.builtin.set_fact:
- datafiles_path: "/usr/share/doc/zabbix-sql-scripts/{{ zabbix_proxy_db_long }}"
- tags:
- - always
-
- name: "RedHat | Make sure old file is absent"
ansible.builtin.file:
path: /etc/yum.repos.d/zabbix-supported.repo
@@ -47,99 +34,10 @@
tags:
- install
-- name: Install packages for Zabbix Repository
- block:
- - name: "RedHat | Installing zabbix-proxy-{{ zabbix_proxy_database }}"
- ansible.builtin.yum:
- pkg: "{{ zabbix_proxy_package }}-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}"
- state: "{{ zabbix_proxy_package_state }}"
- disablerepo: "{{ zabbix_proxy_disable_repo | default(omit) }}"
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- become: true
- register: is_zabbix_proxy_package_installed
- until: is_zabbix_proxy_package_installed is succeeded
-
- - name: "RedHat | Installing zabbix-sql-scripts"
- ansible.builtin.yum:
- pkg: "zabbix-sql-scripts-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}"
- state: "{{ zabbix_proxy_package_state }}"
- disablerepo: "{{ zabbix_proxy_disable_repo | default(omit) }}"
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: zabbix_proxy_sql_package_installed
- until: zabbix_proxy_sql_package_installed is succeeded
- become: true
- tags:
- - install
-
-- name: "RedHat | Install Ansible PostgreSQL Client package"
+- name: "RedHat | Add EPEL Repo (Centos 7 Only)"
+ when: ansible_facts['distribution_major_version'] == '7'
ansible.builtin.yum:
- name: "{{ pgsql_depenencies[ansible_distribution_major_version] }}"
- state: present
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- become: true
- register: are_zabbix_proxy_pgsql_packages_installed
- until: are_zabbix_proxy_pgsql_packages_installed is succeeded
- when:
- - zabbix_proxy_database_creation or zabbix_proxy_database_sqlload
- - zabbix_proxy_database == 'pgsql'
- tags:
- - install
- - database
- - dependencies
-
-- name: "RedHat | Install Mysql Client Package"
- block:
- - name: "RedHat | Add Mysql Repo (Centos 7 Only)"
- ansible.builtin.yum_repository:
- name: mariadb
- description: MariaDB 10.8 CentOS repository list
- file: mariadb
- baseurl: "https://mirror.rackspace.com/mariadb/yum/10.11/centos{{ ansible_distribution_major_version }}-amd64"
- gpgcheck: no
- when: ansible_distribution_major_version == '7'
-
- - name: "RedHat | Install Mysql Client package"
- ansible.builtin.yum:
- name: "{{ mysql_client_pkgs[ansible_distribution_major_version] }}"
- state: installed
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- become: true
- register: are_zabbix_proxy_mysql_packages_installed
- until: are_zabbix_proxy_mysql_packages_installed is succeeded
- when:
- - zabbix_proxy_database_creation or zabbix_proxy_database_sqlload
- - zabbix_proxy_install_database_client
- - zabbix_proxy_database == 'mysql'
- tags:
- - install
- - database
- - dependencies
-
-- name: "RedHat | Install sqlite3"
- ansible.builtin.yum:
- name:
- - sqlite
- state: present
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: zabbix_proxy_sqlite_packages_installed
- until: zabbix_proxy_sqlite_packages_installed is succeeded
- become: true
- when:
- - zabbix_proxy_database == 'sqlite3'
- tags:
- - install
- - database
- - dependencies
+ name: epel-release
- name: "Configure SELinux when enabled"
ansible.builtin.include_tasks: selinux.yml
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-mysql.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-mysql.yml
new file mode 100644
index 000000000..e3b525a83
--- /dev/null
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-mysql.yml
@@ -0,0 +1,144 @@
+---
+# task file for mysql
+- name: "Install MySQL dependencies"
+ when: zabbix_proxy_database_creation or zabbix_proxy_database_sqlload
+ ansible.builtin.package:
+ name: "{{ _zabbix_proxy_mysql_dependencies[ ansible_facts['distribution_major_version'] ] | select | list }}"
+ environment:
+ http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
+ https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
+ become: true
+ register: _zabbix_proxy_dependencies_installed
+ until: _zabbix_proxy_dependencies_installed is succeeded
+ tags:
+ - install
+ - database
+ - dependencies
+
+# NOTE: Upgrading system-packages with pip is generally a bad idea, but
+# these packaged older versions seems to have a problem with mysql 8 and above
+- name: Upgrade pymysql
+ when:
+ - ansible_facts['distribution'] in ['CentOS', 'Debian', 'Ubuntu']
+ - ansible_facts['distribution_release'] in ['Core', 'buster', 'bullseye', 'bionic', 'focal']
+ ansible.builtin.pip:
+ name: "pymysql>=0.10.0,<0.11.0"
+ state: latest
+
+- name: "MySQL Database prep"
+ when: zabbix_proxy_database_creation | bool
+ delegate_to: "{{ zabbix_proxy_real_dbhost | default(zabbix_proxy_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname)) }}"
+ vars:
+ delegated_dbhost: "{{ (zabbix_proxy_dbhost == 'localhost') | ternary(inventory_hostname, zabbix_proxy_dbhost) }}"
+ tags:
+ - database
+ - skip_ansible_lint
+ block:
+ - name: "MySQL | Create database"
+ community.mysql.mysql_db:
+ login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
+ login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
+ login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
+ login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
+ login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
+ name: "{{ zabbix_proxy_dbname }}"
+ encoding: "{{ zabbix_proxy_dbencoding }}"
+ collation: "{{ zabbix_proxy_dbcollation }}"
+ state: present
+ register: zabbix_database_created
+
+ - name: "MySQL | Create database user"
+ community.mysql.mysql_user:
+ login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
+ login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
+ login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
+ login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
+ login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
+ name: "{{ zabbix_proxy_dbuser }}"
+ password: "{{ zabbix_proxy_dbpassword }}"
+ priv: "{{ zabbix_proxy_dbname }}.*:ALL"
+ host: "{{ zabbix_proxy_privileged_host }}"
+ plugin: "{{ 'mysql_native_password' if (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7') else omit }}"
+ state: present
+
+- name: "MySQL verify or create schema"
+ when: zabbix_proxy_database_sqlload | bool
+ tags:
+ - database
+ block:
+ - name: "MySQL | Get current database version"
+ community.mysql.mysql_query:
+ login_user: "{{ zabbix_proxy_dbuser }}"
+ login_password: "{{ zabbix_proxy_dbpassword }}"
+ login_host: "{{ zabbix_proxy_dbhost }}"
+ login_port: "{{ zabbix_proxy_dbport }}"
+ login_db: "{{ zabbix_proxy_dbname }}"
+ query: 'SELECT mandatory FROM dbversion'
+ rescue:
+ - name: "MySQL | Get and set schema import overrides"
+ delegate_to: "{{ zabbix_proxy_real_dbhost | default(zabbix_proxy_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname)) }}"
+ vars:
+ delegated_dbhost: "{{ (zabbix_proxy_dbhost == 'localhost') | ternary(inventory_hostname, zabbix_proxy_dbhost) }}"
+ block:
+ - name: "MySQL | Get current value for variables"
+ community.mysql.mysql_variables:
+ variable: "{{ name }}"
+ login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
+ login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
+ login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
+ login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
+ login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
+ loop:
+ - innodb_default_row_format
+ - log_bin_trust_function_creators
+ loop_control:
+ loop_var: name
+ register: _mysql_variable_defaults
+
+ - name: "MySQL | Set variable overrides for schema import"
+ when: item.msg != _mysql_schema_import_overrides[item.name]
+ community.mysql.mysql_variables:
+ variable: "{{ item.name }}"
+ value: "{{ _mysql_schema_import_overrides[item.name] }}"
+ login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
+ login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
+ login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
+ login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
+ login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
+ loop: "{{ _mysql_variable_defaults.results }}"
+ loop_control:
+ label: "{{ item.name }}: {{ _mysql_schema_import_overrides[item.name] }}"
+ vars:
+ _mysql_schema_import_overrides:
+ innodb_default_row_format: "dynamic"
+ log_bin_trust_function_creators: "ON"
+
+ - name: "MySQL | Import schema"
+ community.mysql.mysql_db:
+ login_user: "{{ zabbix_proxy_dbuser }}"
+ login_password: "{{ zabbix_proxy_dbpassword }}"
+ login_host: "{{ zabbix_proxy_dbhost }}"
+ login_port: "{{ zabbix_proxy_dbport }}"
+ name: "{{ zabbix_proxy_dbname }}"
+ encoding: "{{ zabbix_proxy_dbencoding }}"
+ collation: "{{ zabbix_proxy_dbcollation }}"
+ state: import
+ target: /usr/share/zabbix-sql-scripts/mysql/proxy.sql
+
+ always:
+ - name: "MySQL | Revert variable overrides for schema import"
+ when: _mysql_variable_defaults is defined
+ delegate_to: "{{ zabbix_proxy_real_dbhost | default(zabbix_proxy_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname)) }}"
+ vars:
+ delegated_dbhost: "{{ (zabbix_proxy_dbhost == 'localhost') | ternary(inventory_hostname, zabbix_proxy_dbhost) }}"
+ community.mysql.mysql_variables:
+ variable: "{{ item.name }}"
+ value: "{{ item.msg }}"
+ login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
+ login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
+ login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
+ login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
+ login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
+ loop: "{{ _mysql_variable_defaults.results | default([]) }}"
+ loop_control:
+ label: "{{ item.name }}: {{ item.msg }}"
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-pgsql.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-pgsql.yml
new file mode 100644
index 000000000..fc2c675ab
--- /dev/null
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-pgsql.yml
@@ -0,0 +1,73 @@
+---
+# task file for postgresql
+- name: "Install PostgreSQL dependencies"
+ when: zabbix_proxy_database_creation or zabbix_proxy_database_sqlload
+ ansible.builtin.package:
+ name: "{{ _zabbix_proxy_pgsql_dependencies | select | list }}"
+ environment:
+ http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
+ https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
+ become: true
+ register: _zabbix_proxy_pgsql_packages_installed
+ until: _zabbix_proxy_pgsql_packages_installed is succeeded
+ tags:
+ - install
+ - database
+ - dependencies
+
+- name: "PostgreSQL Database prep"
+ when: zabbix_proxy_database_creation | bool
+ become: "{{ zabbix_proxy_dbhost_run_install }}"
+ become_user: postgres
+ delegate_to: "{{ zabbix_proxy_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname) }}"
+ vars:
+ delegated_dbhost: "{{ (zabbix_proxy_dbhost == 'localhost') | ternary(inventory_hostname, zabbix_proxy_dbhost) }}"
+ tags:
+ - database
+ block:
+ - name: "PostgreSQL | Create database"
+ community.postgresql.postgresql_db:
+ login_user: "{{ zabbix_proxy_pgsql_login_user | default(omit) }}"
+ login_password: "{{ zabbix_proxy_pgsql_login_password | default(omit) }}"
+ login_host: "{{ zabbix_proxy_pgsql_login_host | default(omit) }}"
+ port: "{{ zabbix_proxy_dbport }}"
+ login_unix_socket: "{{ zabbix_proxy_pgsql_login_unix_socket | default(omit) }}"
+ name: "{{ zabbix_proxy_dbname }}"
+ state: present
+
+ - name: "PostgreSQL | Create database user"
+ community.postgresql.postgresql_user:
+ login_user: "{{ zabbix_proxy_pgsql_login_user | default(omit) }}"
+ login_password: "{{ zabbix_proxy_pgsql_login_password | default(omit) }}"
+ login_host: "{{ zabbix_proxy_pgsql_login_host | default(omit) }}"
+ port: "{{ zabbix_proxy_dbport }}"
+ name: "{{ zabbix_proxy_dbuser }}"
+ password: "{{ ('md5' + (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5')) if zabbix_proxy_dbpassword_hash_method == 'md5' else zabbix_proxy_dbpassword }}"
+ db: "{{ zabbix_proxy_dbname }}"
+ priv: ALL
+ state: present
+ encrypted: true
+
+- name: "PostgreSQL verify or create schema"
+ when: zabbix_proxy_database_sqlload | bool
+ tags:
+ - database
+ block:
+ - name: "PostgreSQL | Get current database version"
+ community.postgresql.postgresql_query:
+ login_user: "{{ zabbix_proxy_dbuser }}"
+ login_password: "{{ zabbix_proxy_dbpassword }}"
+ login_host: "{{ zabbix_proxy_dbhost }}"
+ port: "{{ zabbix_proxy_dbport }}"
+ db: "{{ zabbix_proxy_dbname }}"
+ query: 'SELECT mandatory FROM dbversion'
+ rescue:
+ - name: "PostgreSQL | Import schema"
+ community.postgresql.postgresql_db:
+ login_user: "{{ zabbix_proxy_dbuser }}"
+ login_password: "{{ zabbix_proxy_dbpassword }}"
+ login_host: "{{ zabbix_proxy_dbhost }}"
+ port: "{{ zabbix_proxy_dbport }}"
+ db: "{{ zabbix_proxy_dbname }}"
+ state: restore
+ target: /usr/share/zabbix-sql-scripts/postgresql/proxy.sql
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-sqlite3.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-sqlite3.yml
new file mode 100644
index 000000000..ae8f8602b
--- /dev/null
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/initialize-sqlite3.yml
@@ -0,0 +1,62 @@
+---
+# task file for sqlite3
+- name: "Install SQLite3 dependencies"
+ when: zabbix_proxy_database_creation or zabbix_proxy_database_sqlload
+ ansible.builtin.package:
+ name: "{{ _zabbix_proxy_sqlite3_dependencies }}"
+ environment:
+ http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
+ https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
+ become: true
+ register: _zabbix_proxy_sqlite3_packages_installed
+ until: _zabbix_proxy_sqlite3_packages_installed is succeeded
+ tags:
+ - install
+ - database
+ - dependencies
+
+- name: "SQLite3 | Set path for default dbname"
+ when: zabbix_proxy_dbname == "zabbix_proxy"
+ ansible.builtin.set_fact:
+ zabbix_proxy_dbname: /var/lib/zabbix/zabbix_proxy.db
+ tags:
+ - database
+
+- name: "SQLite3 Database prep"
+ when: zabbix_proxy_database_creation | bool
+ become: true
+ tags:
+ - database
+ block:
+ - name: "SQLite3 | Create path directories"
+ ansible.builtin.file:
+ state: directory
+ name: "{{ zabbix_proxy_dbname | dirname }}"
+ mode: "0744"
+ owner: "{{ zabbix_os_user }}"
+ group: "{{ zabbix_os_user }}"
+ seuser: system_u
+ serole: object_r
+ setype: zabbix_var_lib_t
+
+ - name: "SQLite3 | Import schema"
+ when: zabbix_proxy_database_sqlload
+ become_user: "{{ zabbix_os_user }}"
+ ansible.builtin.shell: |
+ set -euxo pipefail
+ sqlite3 {{ zabbix_proxy_dbname }} < /usr/share/zabbix-sql-scripts/sqlite3/proxy.sql
+ args:
+ creates: "{{ zabbix_proxy_dbname }}"
+ executable: /bin/bash
+
+ - name: "Sqlite3 | Fix zabbix db file permission (SELinux)"
+ when: ansible_selinux.status == "enabled"
+ ansible.builtin.file:
+ state: file
+ path: "{{ zabbix_proxy_dbname }}"
+ mode: "0600"
+ owner: "{{ zabbix_os_user }}"
+ group: "{{ zabbix_os_user }}"
+ seuser: system_u
+ serole: object_r
+ setype: zabbix_var_lib_t
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/main.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/main.yml
index 1e8831c35..3043bdaef 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/main.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/main.yml
@@ -35,13 +35,6 @@
zabbix_api_server_port: "{{ '443' if zabbix_api_use_ssl|bool else '80' }}"
when: zabbix_api_server_port is undefined
-- name: Set Path to SQL File
- ansible.builtin.set_fact:
- datafile_path: "{{ db_file_path[zabbix_short_version] }}"
- tags:
- - install
- - config
-
- name: "Set default ip address for zabbix_proxy_ip"
ansible.builtin.set_fact:
zabbix_proxy_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4'].address }}"
@@ -56,54 +49,45 @@
- name: "Complete OS Specific Tasks"
ansible.builtin.include_tasks: "{{ ansible_os_family }}.yml"
-- name: "Get the file for database schema"
- ansible.builtin.shell: ls -1 {{ db_file_path[zabbix_short_version] }}
- changed_when: false
+- name: "Install zabbix-proxy packages"
+ ansible.builtin.package:
+ name: "{{ _zabbix_proxy_packages }}"
+ state: "{{ zabbix_proxy_package_state }}"
+ update_cache: true
+ disablerepo: "{{ zabbix_proxy_disable_repo | default(_zabbix_proxy_disable_repo | default(omit)) }}"
+ environment:
+ http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
+ https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
+ register: _zabbix_proxy_package_installed
+ until: _zabbix_proxy_package_installed is succeeded
become: true
- when:
- - zabbix_proxy_database_sqlload
- register: ls_output_schema
tags:
- - database
+ - install
-- name: "Installing the database"
- ansible.builtin.include_tasks: "{{ zabbix_proxy_db_long }}.yml"
+- name: "Initialize the database"
+ ansible.builtin.include_tasks: "initialize-{{ zabbix_proxy_database }}.yml"
-- name: "Create include dir zabbix-proxy"
+- name: "Create directories"
ansible.builtin.file:
- path: "{{ zabbix_proxy_include }}"
- owner: "{{ zabbix_os_user }}"
- group: "{{ zabbix_os_user }}"
- mode: "{{ zabbix_proxy_include_mode }}"
state: directory
- become: true
- tags:
- - install
- - config
-
-- name: "Create module dir zabbix-proxy"
- ansible.builtin.file:
- path: "{{ zabbix_proxy_loadmodulepath }}"
+ path: "{{ item.path }}"
owner: "{{ zabbix_os_user }}"
group: "{{ zabbix_os_user }}"
- state: directory
- mode: "0755"
+ mode: "{{ item.mode | default('0755') }}"
become: true
+ loop:
+ - path: "{{ zabbix_proxy_include }}"
+ mode: "{{ zabbix_proxy_include_mode }}"
+ - path: "{{ zabbix_proxy_loadmodulepath }}"
+ - required: "{{ zabbix_proxy_tlspskfile is defined }}"
+ path: "{{ zabbix_proxy_tlspskfile | default('/path/to/zabbix_proxy_tlspskfile/zabbix_proxy.psk') | dirname }}"
+ loop_control:
+ label: "{{ item.path }}"
+ when: item.required | default(true)
tags:
- install
- config
-- name: "Create directory for PSK file if not exist."
- ansible.builtin.file:
- path: "{{ zabbix_proxy_tlspskfile | dirname }}"
- mode: 0755
- state: directory
- become: true
- when:
- - zabbix_proxy_tlspskfile is defined
- tags:
- - config
-
- name: "Place TLS PSK File"
ansible.builtin.copy:
dest: "{{ zabbix_proxy_tlspskfile }}"
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/mysql.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/mysql.yml
deleted file mode 100644
index dde847a53..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/mysql.yml
+++ /dev/null
@@ -1,172 +0,0 @@
----
-# task file for mysql
-- name: "MySQL | Set the correct delegated_dbhost (to support MySQL db deployment on a remote dbhost)"
- ansible.builtin.set_fact:
- delegated_dbhost: "{{ zabbix_proxy_dbhost if (zabbix_proxy_dbhost != 'localhost') else inventory_hostname }}"
- when:
- - zabbix_proxy_dbhost_run_install
- tags:
- - database
-
-- name: "MySQL | Set the correct delegated_dbhost (to support MySQL db deployment on a remote dbhost)"
- ansible.builtin.set_fact:
- delegated_dbhost: "{{ inventory_hostname }}"
- when:
- - not zabbix_proxy_dbhost_run_install
- tags:
- - database
-
-- name: "MySQL | Override delegated_dbhost with real dbhost when dbhost is behind loadbalancer"
- ansible.builtin.set_fact:
- delegated_dbhost: "{{ zabbix_proxy_real_dbhost }}"
- when: zabbix_proxy_real_dbhost | default(false)
- tags:
- - database
-
-- name: PyMySQL
- ansible.builtin.pip:
- name: PyMySQL
- register: installation_dependencies
- until: installation_dependencies is succeeded
- tags:
- - database
-
-- name: "MySQL | Create database"
- community.mysql.mysql_db:
- name: "{{ zabbix_proxy_dbname }}"
- encoding: "{{ zabbix_proxy_dbencoding }}"
- collation: "{{ zabbix_proxy_dbcollation }}"
- login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
- login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
- login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
- login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
- login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
- state: present
- when: zabbix_proxy_database_creation
- register: zabbix_database_created
- delegate_to: "{{ delegated_dbhost }}"
- tags:
- - database
- - skip_ansible_lint
-
-- name: "MySQL | Create database user"
- community.mysql.mysql_user:
- login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
- login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
- login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
- login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
- login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
- name: "{{ zabbix_proxy_dbuser }}"
- password: "{{ zabbix_proxy_dbpassword }}"
- priv: "{{ zabbix_proxy_dbname }}.*:ALL"
- host: "{{ zabbix_proxy_privileged_host }}"
- plugin: "{{ 'mysql_native_password' if (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7') else omit }}"
- state: present
- when: zabbix_proxy_database_creation
- delegate_to: "{{ delegated_dbhost }}"
- tags:
- - database
-
-- name: "MySQL | Check if we have done files"
- ansible.builtin.stat:
- path: /etc/zabbix/schema.done
- register: done_file
- become: true
- when:
- - zabbix_proxy_database_sqlload
- tags:
- - database
-
-- name: "MySQL | Get version_comment"
- community.mysql.mysql_variables:
- variable: version
- login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
- login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
- login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
- login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
- login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
- delegate_to: "{{ delegated_dbhost }}"
- register: install_mysql_version
- tags:
- - database
-
-- name: "MySQL | Get current value for innodb_default_row_format"
- community.mysql.mysql_variables:
- variable: innodb_default_row_format
- login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
- login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
- login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
- login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
- login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
- delegate_to: "{{ delegated_dbhost }}"
- register: mysql_innodb_default_row_format
- when:
- - install_mysql_version.msg is version('5.6', '>=')
- tags:
- - database
-
-- name: "MySQL | Set innodb_default_row_format to dynamic"
- community.mysql.mysql_variables:
- variable: innodb_default_row_format
- value: dynamic
- login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
- login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
- login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
- login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
- login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
- when:
- - zabbix_proxy_database_sqlload | bool
- - not done_file.stat.exists
- - install_mysql_version.msg is version('5.6', '>=')
- - mysql_innodb_default_row_format.msg != 'dynamic'
- delegate_to: "{{ delegated_dbhost }}"
- tags:
- - database
-
-- name: "MySQL | Create database and import file"
- community.mysql.mysql_db:
- login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
- login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
- login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
- login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
- login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
- name: "{{ zabbix_proxy_dbname }}"
- encoding: "{{ zabbix_proxy_dbencoding }}"
- collation: "{{ zabbix_proxy_dbcollation }}"
- state: import
- target: "{{ ls_output_schema.stdout }}"
- when:
- - zabbix_proxy_database_sqlload
- - not done_file.stat.exists
- delegate_to: "{{ delegated_dbhost }}"
- tags:
- - database
-
-- name: "MySQL | Revert innodb_default_row_format to previous value"
- community.mysql.mysql_variables:
- variable: innodb_default_row_format
- value: "{{ mysql_innodb_default_row_format.msg }}"
- login_host: "{{ zabbix_proxy_mysql_login_host | default(omit) }}"
- login_user: "{{ zabbix_proxy_mysql_login_user | default(omit) }}"
- login_password: "{{ zabbix_proxy_mysql_login_password | default(omit) }}"
- login_port: "{{ zabbix_proxy_mysql_login_port | default(omit) }}"
- login_unix_socket: "{{ zabbix_proxy_mysql_login_unix_socket | default(omit) }}"
- when:
- - zabbix_proxy_database_sqlload | bool
- - not done_file.stat.exists
- - mysql_innodb_default_row_format.msg != 'dynamic'
- delegate_to: "{{ delegated_dbhost }}"
- tags:
- - database
-
-- name: "MySQL | Create done file"
- ansible.builtin.file:
- path: /etc/zabbix/schema.done
- state: touch
- mode: "0644"
- become: true
- when:
- - zabbix_proxy_database_sqlload
- - not done_file.stat.exists
- tags:
- - database
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/postgresql.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/postgresql.yml
deleted file mode 100644
index e71af9aba..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/postgresql.yml
+++ /dev/null
@@ -1,96 +0,0 @@
----
-# task file for postgresql
-
-- name: "PostgreSQL | Set the correct delegated_dbhost (to support postgres db deployment on a remote dbhost)"
- ansible.builtin.set_fact:
- delegated_dbhost: "{{ zabbix_proxy_dbhost if (zabbix_proxy_dbhost != 'localhost') else inventory_hostname }}"
- when:
- - zabbix_proxy_dbhost_run_install
- tags:
- - database
-
-- name: "PostgreSQL | Set the correct delegated_dbhost (to support postgres db deployment on a remote dbhost)"
- ansible.builtin.set_fact:
- delegated_dbhost: "{{ inventory_hostname }}"
- when:
- - not zabbix_proxy_dbhost_run_install
- tags:
- - database
-
-- name: "PostgreSQL | Delegated"
- block:
- - name: "PostgreSQL | Delegated | Create database"
- community.postgresql.postgresql_db:
- name: "{{ zabbix_proxy_dbname }}"
- port: "{{ zabbix_proxy_dbport }}"
- state: present
-
- - name: "PostgreSQL | Delegated | Create database user"
- community.postgresql.postgresql_user:
- db: "{{ zabbix_proxy_dbname }}"
- name: "{{ zabbix_proxy_dbuser }}"
- password: "{{ ('md5' + (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5')) if zabbix_proxy_dbpassword_hash_method == 'md5' else zabbix_proxy_dbpassword }}"
- port: "{{ zabbix_proxy_dbport }}"
- priv: ALL
- state: present
- encrypted: true
- become: true
- become_user: postgres
- delegate_to: "{{ delegated_dbhost }}"
- when:
- - zabbix_proxy_database_creation
- - zabbix_proxy_pgsql_login_host is not defined
- tags:
- - database
-
-- name: "PostgreSQL | Remote"
- block:
- - name: "PostgreSQL | Remote | Create database"
- community.postgresql.postgresql_db:
- login_host: "{{ zabbix_proxy_pgsql_login_host | default(omit) }}"
- login_user: "{{ zabbix_proxy_pgsql_login_user | default(omit) }}"
- login_password: "{{ zabbix_proxy_pgsql_login_password | default(omit) }}"
- login_unix_socket: "{{ zabbix_proxy_pgsql_login_unix_socket | default(omit) }}"
- name: "{{ zabbix_proxy_dbname }}"
- port: "{{ zabbix_proxy_dbport }}"
- state: present
- - name: "PostgreSQL | Remote | Create database user"
- community.postgresql.postgresql_user:
- login_host: "{{ zabbix_proxy_pgsql_login_host | default(omit) }}"
- login_user: "{{ zabbix_proxy_pgsql_login_user | default(omit) }}"
- login_password: "{{ zabbix_proxy_pgsql_login_password | default(omit) }}"
- db: "{{ zabbix_proxy_dbname }}"
- name: "{{ zabbix_proxy_dbuser }}"
- password: "{{ ('md5' + (zabbix_proxy_dbpassword + zabbix_proxy_dbuser)|hash('md5')) if zabbix_proxy_dbpassword_hash_method == 'md5' else zabbix_proxy_dbpassword }}"
- port: "{{ zabbix_proxy_dbport }}"
- priv: ALL
- state: present
- encrypted: true
- when:
- - zabbix_proxy_database_creation
- - zabbix_proxy_pgsql_login_host is defined
- tags:
- - database
-
-- name: "PostgreSQL | Handle Compressed Schema File"
- ansible.builtin.set_fact:
- zabbix_proxy_cat_cmd: zcat
- when: "'.gz' in ls_output_schema.stdout"
- tags:
- - database
-
-- name: "PostgreSQL | Importing schema file"
- ansible.builtin.shell: |
- set -euxo pipefail
- {{ zabbix_proxy_cat_cmd }} {{ ls_output_schema.stdout }} | psql -h '{{ zabbix_proxy_dbhost }}' -U '{{ zabbix_proxy_dbuser }}' -d '{{ zabbix_proxy_dbname }}'
- touch /etc/zabbix/schema.done
- args:
- creates: /etc/zabbix/schema.done
- executable: /bin/bash
- environment:
- PGPASSWORD: "{{ zabbix_proxy_dbpassword }}"
- become: true
- when:
- - zabbix_proxy_database_creation
- tags:
- - database
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/sqlite3.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/sqlite3.yml
deleted file mode 100644
index 3d74b73e7..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/tasks/sqlite3.yml
+++ /dev/null
@@ -1,63 +0,0 @@
----
-# task file for sqlite3
-
-- name: "Sqlite3 | Default Database Path"
- ansible.builtin.set_fact:
- zabbix_proxy_dbname: /var/lib/zabbix/zabbix_proxy.db
- when:
- - zabbix_proxy_dbname == "zabbix_proxy"
- tags:
- - database
-
-- name: "Sqlite3 | Create database"
- ansible.builtin.file:
- name: "{{ zabbix_proxy_dbname | dirname }}"
- mode: 0744
- owner: "{{ zabbix_os_user }}"
- group: "{{ zabbix_os_user }}"
- seuser: system_u
- serole: object_r
- setype: zabbix_var_lib_t
- state: directory
- become: true
- when:
- - zabbix_proxy_database_creation
- tags:
- - database
-
-- name: "Sqlite3 | Handle Compressed Schema File"
- ansible.builtin.set_fact:
- zabbix_proxy_cat_cmd: zcat
- when: "'.gz' in ls_output_schema.stdout"
- tags:
- - database
-
-- name: "Sqlite3 | Importing schema file"
- become: true
- become_user: "{{ zabbix_os_user }}"
- ansible.builtin.shell: |
- set -euxo pipefail
- {{ zabbix_proxy_cat_cmd }} {{ ls_output_schema.stdout }} | sqlite3 {{ zabbix_proxy_dbname }}
- args:
- creates: "{{ zabbix_proxy_dbname }}"
- executable: /bin/bash
- environment:
- PGPASSWORD: "{{ zabbix_proxy_dbpassword }}"
- when:
- - zabbix_proxy_database_creation
- tags:
- - database
-
-- name: "Sqlite3 | Fix zabbix db file permission (SELinux)"
- ansible.builtin.file:
- path: "{{ zabbix_proxy_dbname }}"
- state: file
- seuser: system_u
- serole: object_r
- setype: zabbix_var_lib_t
- become: true
- when:
- - ansible_selinux.status == "enabled"
- - zabbix_proxy_database_creation
- tags:
- - database
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/templates/zabbix_proxy.conf.j2 b/ansible_collections/community/zabbix/roles/zabbix_proxy/templates/zabbix_proxy.conf.j2
index 60ae3f0a5..3d585cbab 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/templates/zabbix_proxy.conf.j2
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/templates/zabbix_proxy.conf.j2
@@ -7,9 +7,7 @@
# https://www.zabbix.com/documentation/{{ zabbix_proxy_version }}/en/manual/appendix/config/zabbix_proxy
{{ (zabbix_proxy_allowroot is defined and zabbix_proxy_allowroot is not none) | ternary('','# ') }}AllowRoot={{ zabbix_proxy_allowroot | default('') }}
-{% if zabbix_proxy_version is version('6.0', '>=') %}
{{ (zabbix_proxy_allowunsupporteddbversions is defined and zabbix_proxy_allowunsupporteddbversions is not none) | ternary('','# ') }}AllowUnsupportedDBVersions={{ zabbix_proxy_allowunsupporteddbversions | default('') }}
-{% endif %}
{{ (zabbix_proxy_cachesize is defined and zabbix_proxy_cachesize is not none) | ternary('','# ') }}CacheSize={{ zabbix_proxy_cachesize | default('') }}
{{ (zabbix_proxy_configfrequency is defined and zabbix_proxy_configfrequency is not none) | ternary('','# ') }}ConfigFrequency={{ zabbix_proxy_configfrequency | default('') }}
{{ (zabbix_proxy_datasenderfrequency is defined and zabbix_proxy_datasenderfrequency is not none) | ternary('','# ') }}DataSenderFrequency={{ zabbix_proxy_datasenderfrequency | default('') }}
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/Debian.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/Debian.yml
index 1362e557e..af274952b 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/Debian.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/Debian.yml
@@ -11,6 +11,9 @@ zabbix_valid_proxy_versions:
- 6.4
- 6.2
- 6.0
+ "24":
+ - 6.4
+ - 6.0
"22":
- 6.4
- 6.2
@@ -24,27 +27,37 @@ zabbix_valid_proxy_versions:
- 6.2
- 6.0
-mysql_client_pkgs:
+_zabbix_proxy_pgsql_dependencies:
+ - "{{ zabbix_proxy_install_database_client | ternary('postgresql-client', '') }}"
+ - python3-psycopg2
+
+_zabbix_proxy_mysql_dependencies:
# Debian
"12":
- default-mysql-client
- - "{{ zabbix_python_prefix }}-mysqldb"
+ - python3-pymysql
"11":
- default-mysql-client
- - "{{ zabbix_python_prefix }}-mysqldb"
+ - python3-pymysql
"10":
- mariadb-client
- - "{{ zabbix_python_prefix }}-mysqldb"
+ - python3-pymysql
# Ubuntu
- "22":
+ "24":
- default-mysql-client
- "{{ zabbix_python_prefix }}-mysqldb"
+ "22":
+ - default-mysql-client
+ - python3-pymysql
"20":
- default-mysql-client
- - "{{ zabbix_python_prefix }}-mysqldb"
+ - python3-pymysql
"18":
- default-mysql-client
- - "{{ zabbix_python_prefix }}-mysqldb"
+ - python3-pymysql
+
+_zabbix_proxy_sqlite3_dependencies:
+ - sqlite3
mysql_plugin:
"18": mysql_native_password
@@ -54,3 +67,7 @@ debian_keyring_path: /etc/apt/keyrings/
zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc"
_zabbix_proxy_fping6location: /usr/bin/fping6
_zabbix_proxy_fpinglocation: /usr/bin/fping
+
+_zabbix_proxy_packages:
+ - "zabbix-proxy-{{ zabbix_proxy_database }}"
+ - "zabbix-sql-scripts"
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/RedHat.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/RedHat.yml
index e8ee7e2ae..6a22ec36d 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/RedHat.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/RedHat.yml
@@ -12,27 +12,24 @@ zabbix_valid_proxy_versions:
- 6.2
- 6.0
-pgsql_depenencies:
- "9":
- - python3-psycopg2
- - postgresql
- "8":
- - python3-psycopg2
- - postgresql
- "7":
- - python-psycopg2
- - postgresql
+_zabbix_proxy_pgsql_dependencies:
+ - "{{ zabbix_proxy_install_database_client | ternary('postgresql', '') }}"
+ - python3-psycopg2
-mysql_client_pkgs:
+_zabbix_proxy_mysql_dependencies:
"9":
- - mysql
+ - "{{ zabbix_proxy_install_database_client | ternary('mysql', '') }}"
- python3-PyMySQL
"8":
- - mysql
+ - "{{ zabbix_proxy_install_database_client | ternary('mysql', '') }}"
- python3-PyMySQL
"7":
- - MariaDB-client
- - MySQL-python
+ - "{{ zabbix_proxy_install_database_client | ternary('mariadb', '') }}"
+ - python3-PyMySQL
+ - python36-cryptography
+
+_zabbix_proxy_sqlite3_dependencies:
+ - sqlite
selinux_pkgs:
"9":
@@ -53,3 +50,10 @@ mysql_plugin:
_zabbix_proxy_fping6location: /usr/sbin/fping6
_zabbix_proxy_fpinglocation: /usr/sbin/fping
+
+_zabbix_proxy_packages:
+ - "zabbix-proxy-{{ zabbix_proxy_database }}-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}"
+ - "zabbix-sql-scripts-{{ zabbix_proxy_version }}.{{ zabbix_proxy_version_minor }}"
+
+_zabbix_proxy_disable_repo:
+ - epel
diff --git a/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/main.yml b/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/main.yml
deleted file mode 100644
index 90779c270..000000000
--- a/ansible_collections/community/zabbix/roles/zabbix_proxy/vars/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-# vars file for zabbix_proxy
-db_file_path:
- "62": "/usr/share/zabbix-sql-scripts/{{ zabbix_proxy_db_long }}/proxy.sql"
- "64": "/usr/share/zabbix-sql-scripts/{{ zabbix_proxy_db_long }}/proxy.sql"
- "60": "/usr/share/zabbix-sql-scripts/{{ zabbix_proxy_db_long }}/proxy.sql"
- "50": "/usr/share/doc/zabbix-proxy-{{ zabbix_proxy_database }}*/schema.sql.gz"
diff --git a/ansible_collections/community/zabbix/roles/zabbix_server/README.md b/ansible_collections/community/zabbix/roles/zabbix_server/README.md
index 9557281c3..20f462c48 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_server/README.md
+++ b/ansible_collections/community/zabbix/roles/zabbix_server/README.md
@@ -79,6 +79,7 @@ See the following list of supported Operating systems with the Zabbix releases:
|---------------------|-----|-----|-----|
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | | | V |
diff --git a/ansible_collections/community/zabbix/roles/zabbix_server/defaults/main.yml b/ansible_collections/community/zabbix/roles/zabbix_server/defaults/main.yml
index 933e0339a..b3c669ba9 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_server/defaults/main.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_server/defaults/main.yml
@@ -8,25 +8,27 @@ zabbix_server_manage_service: true
# Database
zabbix_server_database_sqlload: true
zabbix_server_database_timescaledb: false
-zabbix_server_real_dbhost:
+#zabbix_server_real_dbhost:
zabbix_server_dbhost: localhost
zabbix_server_dbname: zabbix-server
zabbix_server_privileged_host: localhost
zabbix_server_dbencoding: utf8
zabbix_server_dbcollation: utf8_bin
-zabbix_server_dbschema:
+#zabbix_server_dbschema:
zabbix_server_dbuser: zabbix-server
zabbix_server_dbpassword: zabbix-server
zabbix_server_dbpassword_hash_method: md5
-zabbix_server_dbsocket:
-zabbix_server_dbport: 5432
+#zabbix_server_dbsocket:
+_zabbix_server_database_default_port:
+ mysql: 3306
+ pgsql: 5432
+zabbix_server_dbport: "{{ _zabbix_server_database_default_port[zabbix_server_database] }}"
zabbix_server_dbhost_run_install: true
zabbix_server_database: pgsql
zabbix_server_database_creation: true
zabbix_server_install_database_client: true
# SELinux specific
-zabbix_server_selinux: false
selinux_allow_zabbix_can_network: false
selinux_allow_zabbix_can_http: false
diff --git a/ansible_collections/community/zabbix/roles/zabbix_server/tasks/RedHat.yml b/ansible_collections/community/zabbix/roles/zabbix_server/tasks/RedHat.yml
index 77fb7cd8a..7fdb5bb72 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_server/tasks/RedHat.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_server/tasks/RedHat.yml
@@ -36,5 +36,4 @@
- name: "RedHat | Configure SELinux when enabled"
ansible.builtin.include_tasks: selinux.yml
- when:
- - zabbix_server_selinux | bool
+ when: ansible_facts.selinux.status | default('disabled') == 'enabled'
diff --git a/ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-mysql.yml b/ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-mysql.yml
index c3fd67c6d..b16b475c9 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-mysql.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-mysql.yml
@@ -27,6 +27,7 @@
- name: "MySQL Database prep"
when: zabbix_server_database_creation
+ become: "{{ zabbix_server_dbhost_run_install }}"
delegate_to: "{{ zabbix_server_real_dbhost | default(zabbix_server_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname)) }}"
vars:
delegated_dbhost: "{{ (zabbix_server_dbhost == 'localhost') | ternary(inventory_hostname, zabbix_server_dbhost) }}"
@@ -81,7 +82,7 @@
query: 'SELECT mandatory FROM dbversion'
rescue:
- name: "MySQL | Get and set schema import overrides"
- delegate_to: "{{ zabbix_server_real_dbhost | default(zabbix_server_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname)) }}"
+ delegate_to: "{{ zabbix_server_real_dbhost | default(zabbix_server_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname), true) }}"
block:
- name: "MySQL | Get current value for variables"
community.mysql.mysql_variables:
@@ -141,7 +142,7 @@
always:
- name: "MySQL | Revert variable overrides for schema import"
- delegate_to: "{{ zabbix_server_real_dbhost | default(zabbix_server_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname)) }}"
+ delegate_to: "{{ zabbix_server_real_dbhost | default(zabbix_server_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname), true) }}"
community.mysql.mysql_variables:
variable: "{{ item.name }}"
value: "{{ item.msg }}"
diff --git a/ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-pgsql.yml b/ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-pgsql.yml
index 65bd0beec..6f40c66f2 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-pgsql.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_server/tasks/initialize-pgsql.yml
@@ -32,7 +32,6 @@
port: "{{ zabbix_server_dbport }}"
login_unix_socket: "{{ zabbix_server_pgsql_login_unix_socket | default(omit) }}"
name: "{{ zabbix_server_dbname }}"
- state: present
- name: "PostgreSQL | Create database user"
community.postgresql.postgresql_user:
@@ -43,10 +42,19 @@
login_unix_socket: "{{ zabbix_server_pgsql_login_unix_socket | default(omit) }}"
name: "{{ zabbix_server_dbuser }}"
password: "{{ ('md5' + (zabbix_server_dbpassword + zabbix_server_dbuser)|hash('md5')) if zabbix_server_dbpassword_hash_method == 'md5' else zabbix_server_dbpassword }}"
+
+ - name: "PostgreSQL | Set database/user permissions"
+ community.postgresql.postgresql_privs:
+ login_user: "{{ zabbix_server_pgsql_login_user | default(omit) }}"
+ login_password: "{{ zabbix_server_pgsql_login_password | default(omit) }}"
+ login_host: "{{ zabbix_server_pgsql_login_host | default(omit) }}"
+ port: "{{ zabbix_server_dbport }}"
+ login_unix_socket: "{{ zabbix_server_pgsql_login_unix_socket | default(omit) }}"
db: "{{ zabbix_server_dbname }}"
- priv: ALL
- state: present
- encrypted: true
+ privs: ALL
+ type: schema
+ objs: public
+ role: "{{ zabbix_server_dbuser }}"
- name: "PostgreSQL | Create timescaledb extension"
when: zabbix_server_database_timescaledb
diff --git a/ansible_collections/community/zabbix/roles/zabbix_server/tasks/selinux.yml b/ansible_collections/community/zabbix/roles/zabbix_server/tasks/selinux.yml
index cd13dbbfd..e30480cd2 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_server/tasks/selinux.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_server/tasks/selinux.yml
@@ -1,125 +1,33 @@
---
-# straight to getenforce binary , workaround for missing python_selinux library
-- name: "SELinux | Get getenforce binary"
- ansible.builtin.stat:
- path: /usr/sbin/getenforce
- register: getenforce_bin
- become: true
- tags:
- - always
-
-- name: "SELinux | Collect getenforce output"
- ansible.builtin.command: getenforce
- register: sestatus
- when: "getenforce_bin.stat.exists"
- changed_when: false
- become: true
- check_mode: false
- tags:
- - always
-
-- name: "Set zabbix_server_selinux to true if getenforce returns Enforcing or Permissive"
- ansible.builtin.set_fact:
- zabbix_server_selinux: "{{ true }}"
- when: 'getenforce_bin.stat.exists and ("Enforcing" in sestatus.stdout or "Permissive" in sestatus.stdout)'
- tags:
- - config
-
-- name: "SELinux | RedHat | Install related SELinux package"
- ansible.builtin.yum:
+- name: "SELinux | Install related SELinux packages"
+ ansible.builtin.package:
name:
- - libsemanage-python
- - policycoreutils
- checkpolicy
- state: present
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: zabbix_server_dependencies_installed
- until: zabbix_server_dependencies_installed is succeeded
- become: true
- when:
- - ansible_os_family == "RedHat"
- - selinux_allow_zabbix_can_network
- - ansible_distribution_major_version == "7" or ansible_distribution_major_version == "6"
- tags:
- - install
-
-- name: "SELinux | RedHat | Install related SELinux package on RHEL8"
- ansible.builtin.yum:
- name:
+ - policycoreutils
- python3-libsemanage
- state: present
+ - python3-policycoreutils
environment:
http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
register: zabbix_server_dependencies_installed
until: zabbix_server_dependencies_installed is succeeded
become: true
- when:
- - ansible_os_family == "RedHat"
- - selinux_allow_zabbix_can_network
- - ansible_distribution_major_version == "8"
tags:
- install
-- name: "SELinux | RedHat | Enable httpd_can_connect_zabbix SELinux boolean"
- ansible.posix.seboolean:
- name: httpd_can_connect_zabbix
- state: true
- persistent: true
- become: true
- when:
- - selinux_allow_zabbix_can_http
- tags:
- - config
-
-- name: "SELinux | RedHat | Enable zabbix_can_network SELinux boolean"
+- name: "SELinux | Set booleans"
ansible.posix.seboolean:
- name: zabbix_can_network
- state: true
+ name: "{{ item.name }}"
+ state: "{{ item.state }}"
persistent: true
become: true
- when:
- - selinux_allow_zabbix_can_network
tags:
- config
-
-- name: "SELinux | RedHat | Install related SELinux package to fix issues"
- ansible.builtin.yum:
- name:
- - policycoreutils-python
- state: present
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: zabbix_server_dependencies_installed
- until: zabbix_server_dependencies_installed is succeeded
- become: true
- when:
- - ansible_os_family == "RedHat"
- - ansible_distribution_major_version == "7" or ansible_distribution_major_version == "6"
- tags:
- - install
-
-- name: "SELinux | RedHat | Install related SELinux package to fix issues on RHEL8"
- ansible.builtin.yum:
- name:
- - policycoreutils
- - checkpolicy
- - python3-libsemanage
- state: present
- environment:
- http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
- https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
- register: zabbix_server_dependencies_installed
- until: zabbix_server_dependencies_installed is succeeded
- become: true
- when:
- - ansible_os_family == "RedHat"
- - ansible_distribution_major_version == "8"
- tags:
- - install
+ loop:
+ - name: httpd_can_connect_zabbix
+ state: "{{ selinux_allow_zabbix_can_http }}"
+ - name: zabbix_can_network
+ state: "{{ selinux_allow_zabbix_can_network }}"
- name: "SELinux | RedHat | Add SEmodule to fix SELinux issue: zabbix_server_alerter.sock"
ansible.builtin.script:
diff --git a/ansible_collections/community/zabbix/roles/zabbix_server/vars/Debian.yml b/ansible_collections/community/zabbix/roles/zabbix_server/vars/Debian.yml
index 75f3751c2..277fa8580 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_server/vars/Debian.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_server/vars/Debian.yml
@@ -17,6 +17,9 @@ zabbix_valid_server_versions:
"10":
- 6.0
# Ubuntu
+ "24":
+ - 6.4
+ - 6.0
"22":
- 6.4
- 6.2
diff --git a/ansible_collections/community/zabbix/roles/zabbix_web/README.md b/ansible_collections/community/zabbix/roles/zabbix_web/README.md
index aac6f9dc2..c1875f208 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_web/README.md
+++ b/ansible_collections/community/zabbix/roles/zabbix_web/README.md
@@ -59,6 +59,7 @@ See the following list of supported Operating Systems with the Zabbix releases.
|---------------------|-----|-----|-----|
| Red Hat Fam 9 | V | V | V |
| Red Hat Fam 8 | V | V | V |
+| Ubuntu 24.04 noble | V | | V |
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | | | V |
diff --git a/ansible_collections/community/zabbix/roles/zabbix_web/templates/php-fpm.conf.j2 b/ansible_collections/community/zabbix/roles/zabbix_web/templates/php-fpm.conf.j2
index e6b02cc9e..3dd337e4d 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_web/templates/php-fpm.conf.j2
+++ b/ansible_collections/community/zabbix/roles/zabbix_web/templates/php-fpm.conf.j2
@@ -8,7 +8,7 @@ listen.acl_users = {{ zabbix_php_fpm_conf_user if zabbix_php_fpm_conf_user is de
{% endif %}
listen.owner = {{ zabbix_php_fpm_conf_user if zabbix_php_fpm_conf_user is defined else zabbix_web_user }}
listen.group = {{ _nginx_group if zabbix_web_http_server=='nginx' else _apache_group }}
-listen.mode = 0644
+listen.mode = 0660
listen.allowed_clients = 127.0.0.1
pm = dynamic
diff --git a/ansible_collections/community/zabbix/roles/zabbix_web/vars/Debian.yml b/ansible_collections/community/zabbix/roles/zabbix_web/vars/Debian.yml
index f49b27155..643b226f5 100644
--- a/ansible_collections/community/zabbix/roles/zabbix_web/vars/Debian.yml
+++ b/ansible_collections/community/zabbix/roles/zabbix_web/vars/Debian.yml
@@ -35,6 +35,9 @@ zabbix_valid_web_versions:
"10":
- 6.0
# Ubuntu
+ "24":
+ - 6.4
+ - 6.0
"22":
- 6.4
- 6.2
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/meta/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/meta/main.yml
new file mode 100644
index 000000000..acdb704c8
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - setup_zabbix
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/main.yml
new file mode 100644
index 000000000..8642afe46
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/main.yml
@@ -0,0 +1,29 @@
+---
+- name: test - do not run tests for Zabbix < 6.4
+ meta: end_play
+ when: zabbix_version is version('6.4', '<')
+
+- block:
+ # setup stuff
+ - include_tasks: zabbix_setup.yml
+
+ # zabbix_discoveryrule module tests
+ - include_tasks: zabbix_tests.yml
+
+ # tear down stuff set up earlier
+ - include_tasks: zabbix_teardown.yml
+
+ always:
+ - name: "cleanup discoveryrule if tests failed"
+ community.zabbix.zabbix_discoveryrule:
+ host_name: ExampleHost
+ name: ExampleRule
+ state: absent
+ ignore_errors: true
+
+ - name: "cleanup discoveryrule if tests failed"
+ community.zabbix.zabbix_discoveryrule:
+ template_name: ExampleTemplate
+ name: ExampleRule
+ state: absent
+ ignore_errors: true
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_setup.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_setup.yml
new file mode 100644
index 000000000..4daf66abf
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_setup.yml
@@ -0,0 +1,25 @@
+---
+
+- name: Create test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ template_groups:
+ - Templates
+
+- name: Create test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ host_groups:
+ - Linux servers
+ - Zabbix servers
+ link_templates:
+ - ExampleTemplate
+ status: enabled
+ state: present
+ interfaces:
+ - type: 1
+ main: 1
+ useip: 1
+ ip: 10.1.1.1
+ dns: ""
+ port: "10050"
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_teardown.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_teardown.yml
new file mode 100644
index 000000000..4a2ec158f
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_teardown.yml
@@ -0,0 +1,9 @@
+- name: remove test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ state: absent
+
+- name: remove test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ state: absent
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_tests.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_tests.yml
new file mode 100644
index 000000000..ffed13e05
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_discoveryrule/tasks/zabbix_tests.yml
@@ -0,0 +1,147 @@
+---
+
+- name: test - create new Zabbix discoveryrule on host with many options set
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: 'vfs.fs.discovery'
+ interval: 1m
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhostrule_new
+
+- name: assert that rule was created
+ ansible.builtin.assert:
+ that: zbxhostrule_new is changed
+
+- name: test - create same Zabbix discoveryrule once again
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: 'vfs.fs.discovery'
+ interval: 1m
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhostrule_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhostrule_existing is changed
+
+- name: test - update existing zabbix discoveryrule
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ host_name: ExampleHost
+ params:
+ interval: 2m
+ state: present
+ register: zbxhostrule_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxhostrule_changed is changed
+
+- name: test - attempt to delete previously created zabbix discoveryrule
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostrule_existing_delete
+
+- name: assert that trigger was deleted
+ ansible.builtin.assert:
+ that: zbxhostrule_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix discoveryrule
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostrule_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhostrule_missing_delete is changed
+
+- name: test - create new Zabbix discoveryrule on template with many options set
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: 'vfs.fs.discovery'
+ interval: 1m
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtemprule_new
+
+- name: assert that rule was created
+ ansible.builtin.assert:
+ that: zbxtemprule_new is changed
+
+- name: test - create same Zabbix discoveryrule once again
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: 'vfs.fs.discovery'
+ interval: 1m
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtemprule_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtemprule_existing is changed
+
+- name: test - update existing zabbix discoveryrule
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ template_name: ExampleTemplate
+ params:
+ interval: 2m
+ state: present
+ register: zbxtemprule_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxtemprule_changed is changed
+
+- name: test - attempt to delete previously created zabbix discoveryrule
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtemprule_existing_delete
+
+- name: assert that trigger was deleted
+ ansible.builtin.assert:
+ that: zbxtemprule_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix discoveryrule
+ community.zabbix.zabbix_discoveryrule:
+ name: TestRule
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtemprule_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtemprule_missing_delete is changed
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/meta/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/meta/main.yml
new file mode 100644
index 000000000..acdb704c8
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - setup_zabbix
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/main.yml
new file mode 100644
index 000000000..131e87ac9
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/main.yml
@@ -0,0 +1,13 @@
+---
+- name: test - do not run tests for Zabbix < 6.4
+ meta: end_play
+ when: zabbix_version is version('6.4', '<')
+
+# setup stuff
+- include_tasks: zabbix_setup.yml
+
+# zabbix_item module tests
+- include_tasks: zabbix_tests.yml
+
+# tear down stuff set up earlier
+- include_tasks: zabbix_teardown.yml
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_setup.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_setup.yml
new file mode 100644
index 000000000..c02a08595
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_setup.yml
@@ -0,0 +1,61 @@
+---
+
+- name: Create example template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ template_groups:
+ - Templates
+
+- name: Create example host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ host_groups:
+ - Linux servers
+ - Zabbix servers
+ link_templates:
+ - ExampleTemplate
+ status: enabled
+ state: present
+ interfaces:
+ - type: 1
+ main: 1
+ useip: 1
+ ip: 10.1.1.1
+ dns: ""
+ port: "10050"
+
+- name: create ping item
+ community.zabbix.zabbix_item:
+ name: ping
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: agent.ping
+ value_type: numeric_unsigned
+ interval: 20s
+ state: present
+
+- name: create ping trigger
+ community.zabbix.zabbix_trigger:
+ name: ping
+ template_name: ExampleTemplate
+ params:
+ severity: warning
+ expression: 'nodata(/ExampleTemplate/agent.ping,1m)=1'
+ manual_close: True
+ state: present
+
+- name: Wait to ensure triggers are firing
+ ansible.builtin.wait_for:
+ timeout: 120
+
+- name: get events for host
+ community.zabbix.zabbix_host_events_info:
+ host_identifier: ExampleHost
+ host_id_type: hostname
+ trigger_severity: warning
+ register: zabbix_host_events
+
+- name: get eventid
+ ansible.builtin.set_fact:
+ zabbix_eventid: "{{ zabbix_host_events.triggers_problem[0].last_event.eventid }}"
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_teardown.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_teardown.yml
new file mode 100644
index 000000000..2df4dd571
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_teardown.yml
@@ -0,0 +1,9 @@
+- name: remove example host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ state: absent
+
+- name: remove example template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ state: absent
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_tests.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_tests.yml
new file mode 100644
index 000000000..48d63b47d
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_host_events_update/tasks/zabbix_tests.yml
@@ -0,0 +1,59 @@
+---
+
+- name: test - acknowledge event
+ community.zabbix.zabbix_host_events_update:
+ params:
+ eventids: "{{ zabbix_eventid }}"
+ action: ack
+ msg: "event acknowledged"
+ register: zbxevent_ack
+
+- name: assert that event was changed
+ ansible.builtin.assert:
+ that: zbxevent_ack is changed
+
+- name: get events updated status
+ community.zabbix.zabbix_host_events_info:
+ host_identifier: ExampleHost
+ host_id_type: hostname
+ trigger_severity: warning
+ register: zabbix_host_events_ack
+
+- name: assert that event was acknowledged
+ ansible.builtin.assert:
+ that: zabbix_host_events_ack.triggers_problem[0].last_event.acknowledged
+
+- name: test - change severity and unacknowledge
+ community.zabbix.zabbix_host_events_update:
+ params:
+ eventids: "{{ zabbix_eventid }}"
+ actions: ['severity', 'unack']
+ severity: high
+ register: zbxevent_sev
+
+- name: assert that event was changed
+ ansible.builtin.assert:
+ that: zbxevent_sev is changed
+
+- name: get events updated status
+ community.zabbix.zabbix_host_events_info:
+ host_identifier: ExampleHost
+ host_id_type: hostname
+ trigger_severity: warning
+ register: zabbix_host_events_unack
+
+- name: assert that event was unacknowledged
+ ansible.builtin.assert:
+ that: zabbix_host_events_unack.triggers_problem[0].last_event.acknowledged == "0"
+
+- name: test - change severity to same
+ community.zabbix.zabbix_host_events_update:
+ params:
+ eventids: "{{ zabbix_eventid }}"
+ action: severity
+ severity: high
+ register: zbxevent_sev_existing
+
+- name: assert that event was not changed
+ ansible.builtin.assert:
+ that: zbxevent_sev_existing is not changed
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/meta/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/meta/main.yml
new file mode 100644
index 000000000..acdb704c8
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - setup_zabbix
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/main.yml
new file mode 100644
index 000000000..531720193
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/main.yml
@@ -0,0 +1,28 @@
+---
+- name: test - do not run tests for Zabbix < 6.4
+ meta: end_play
+ when: zabbix_version is version('6.4', '<')
+
+- block:
+ # setup stuff
+ - include_tasks: zabbix_setup.yml
+
+ # zabbix_item module tests
+ - include_tasks: zabbix_tests.yml
+
+ # tear down stuff set up earlier
+ - include_tasks: zabbix_teardown.yml
+ always:
+ - name: "cleanup host item if tests failed"
+ community.zabbix.zabbix_item:
+ host_name: ExampleHost
+ name: TestItem
+ state: absent
+ ignore_errors: true
+
+ - name: "cleanup template item if tests failed"
+ community.zabbix.zabbix_item:
+ template_name: ExampleTemplate
+ name: TestItem
+ state: absent
+ ignore_errors: true
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_setup.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_setup.yml
new file mode 100644
index 000000000..4daf66abf
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_setup.yml
@@ -0,0 +1,25 @@
+---
+
+- name: Create test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ template_groups:
+ - Templates
+
+- name: Create test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ host_groups:
+ - Linux servers
+ - Zabbix servers
+ link_templates:
+ - ExampleTemplate
+ status: enabled
+ state: present
+ interfaces:
+ - type: 1
+ main: 1
+ useip: 1
+ ip: 10.1.1.1
+ dns: ""
+ port: "10050"
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_teardown.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_teardown.yml
new file mode 100644
index 000000000..4a2ec158f
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_teardown.yml
@@ -0,0 +1,9 @@
+- name: remove test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ state: absent
+
+- name: remove test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ state: absent
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_tests.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_tests.yml
new file mode 100644
index 000000000..86767a716
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_item/tasks/zabbix_tests.yml
@@ -0,0 +1,246 @@
+---
+
+- name: test - create new Zabbix item on host with many options set
+ community.zabbix.zabbix_item:
+ name: TestItem
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: vfs.fs.get
+ value_type: numeric_float
+ units: '%'
+ interval: 1m
+ preprocessing:
+ - type: jsonpath
+ params: '$[?(@.fstype == "ext4")]'
+ error_handler: zabbix_server
+ - type: jsonpath
+ params: "$[*].['bytes', 'inodes'].pused.max()"
+ error_handler: zabbix_server
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhostitem_new
+
+- name: assert that item was created
+ ansible.builtin.assert:
+ that: zbxhostitem_new is changed
+
+- name: test - create same Zabbix item group once again
+ community.zabbix.zabbix_item:
+ name: TestItem
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: vfs.fs.get
+ value_type: numeric_float
+ units: '%'
+ interval: 1m
+ preprocessing:
+ - type: jsonpath
+ params: '$[?(@.fstype == "ext4")]'
+ error_handler: zabbix_server
+ - type: jsonpath
+ params: "$[*].['bytes', 'inodes'].pused.max()"
+ error_handler: zabbix_server
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhostitem_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhostitem_existing is changed
+
+- name: test - update existing zabbix item
+ community.zabbix.zabbix_item:
+ name: TestItem
+ host_name: ExampleHost
+ params:
+ interval: 2m
+ state: present
+ register: zbxhostitem_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxhostitem_changed is changed
+
+- name: test - attempt to delete previously created zabbix item
+ community.zabbix.zabbix_item:
+ name: TestItem
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostitem_existing_delete
+
+- name: assert that item was deleted
+ ansible.builtin.assert:
+ that: zbxhostitem_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix item
+ community.zabbix.zabbix_item:
+ name: TestItem
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostitem_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhostitem_missing_delete is changed
+
+- name: test - create new Zabbix master item on host
+ community.zabbix.zabbix_item:
+ name: TestItem
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: vfs.fs.get
+ value_type: text
+ interval: 1m
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhostmstitem_new
+
+- name: assert that item was created
+ ansible.builtin.assert:
+ that: zbxhostmstitem_new is changed
+
+- name: create dependent item
+ community.zabbix.zabbix_item:
+ name: TestDependItem
+ host_name: ExampleHost
+ params:
+ type: dependent_item
+ key: vfs.fs.pused
+ value_type: numeric_float
+ units: '%'
+ master_item:
+ item_name: TestItem
+ host_name: ExampleHost
+ preprocessing:
+ - type: jsonpath
+ params: '$[?(@.fstype == "ext4")]'
+ error_handler: zabbix_server
+ - type: jsonpath
+ params: "$[*].['bytes', 'inodes'].pused.max()"
+ error_handler: zabbix_server
+ state: present
+ register: zbxhostdependitem_new
+
+- name: assert that item was created
+ ansible.builtin.assert:
+ that: zbxhostdependitem_new is changed
+
+- name: test - attempt to delete previously created zabbix master item
+ community.zabbix.zabbix_item:
+ name: TestItem
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostmstitem_existing_delete
+
+- name: assert that item was deleted
+ ansible.builtin.assert:
+ that: zbxhostmstitem_existing_delete is changed
+
+- name: test - attempt to delete dependent item
+ community.zabbix.zabbix_item:
+ name: TestDependItem
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostdependitem_delete
+
+- name: assert that the item had been removed with its master
+ ansible.builtin.assert:
+ that: not zbxhostdependitem_delete is changed
+
+- name: test - create new Zabbix item on template with many options set
+ community.zabbix.zabbix_item:
+ name: TestItem
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: vfs.fs.get
+ value_type: numeric_float
+ units: '%'
+ interval: 1m
+ preprocessing:
+ - type: jsonpath
+ params: '$[?(@.fstype == "ext4")]'
+ error_handler: zabbix_server
+ - type: jsonpath
+ params: "$[*].['bytes', 'inodes'].pused.max()"
+ error_handler: zabbix_server
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtempitem_new
+
+- name: assert that item was created
+ ansible.builtin.assert:
+ that: zbxtempitem_new is changed
+
+- name: test - create same Zabbix item once again
+ community.zabbix.zabbix_item:
+ name: TestItem
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: vfs.fs.get
+ value_type: numeric_float
+ units: '%'
+ interval: 1m
+ preprocessing:
+ - type: jsonpath
+ params: '$[?(@.fstype == "ext4")]'
+ error_handler: zabbix_server
+ - type: jsonpath
+ params: "$[*].['bytes', 'inodes'].pused.max()"
+ error_handler: zabbix_server
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtempitem_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtempitem_existing is changed
+
+- name: test - update existing zabbix item
+ community.zabbix.zabbix_item:
+ name: TestItem
+ template_name: ExampleTemplate
+ params:
+ interval: 2m
+ state: present
+ register: zbxtempitem_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxtempitem_changed is changed
+
+- name: test - attempt to delete previously created zabbix item
+ community.zabbix.zabbix_item:
+ name: TestItem
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtempitem_existing_delete
+
+- name: assert that item was deleted
+ ansible.builtin.assert:
+ that: zbxtempitem_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix item
+ community.zabbix.zabbix_item:
+ name: TestItem
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtempitem_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtempitem_missing_delete is changed
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/meta/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/meta/main.yml
new file mode 100644
index 000000000..acdb704c8
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - setup_zabbix
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/main.yml
new file mode 100644
index 000000000..ed6ca6d62
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/main.yml
@@ -0,0 +1,30 @@
+---
+- name: test - do not run tests for Zabbix < 6.4
+ meta: end_play
+ when: zabbix_version is version('6.4', '<')
+
+- block:
+ # setup stuff
+ - include_tasks: zabbix_setup.yml
+
+ # zabbix_itemprototype module tests
+ - include_tasks: zabbix_tests.yml
+
+ # tear down stuff set up earlier
+ - include_tasks: zabbix_teardown.yml
+ always:
+ - name: "cleanup host item if tests failed"
+ community.zabbix.zabbix_itemprototype:
+ host_name: ExampleHost
+ discoveryrule_name: ExampleHostRule
+ name: TestItem
+ state: absent
+ ignore_errors: true
+
+ - name: "cleanup template item if tests failed"
+ community.zabbix.zabbix_itemprototype:
+ template_name: ExampleTemplate
+ discoveryrule_name: ExampleTemplateRule
+ name: TestItem
+ state: absent
+ ignore_errors: true
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_setup.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_setup.yml
new file mode 100644
index 000000000..62d4d5e92
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_setup.yml
@@ -0,0 +1,36 @@
+---
+
+- name: Create test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ template_groups:
+ - Templates
+
+- name: Create test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ host_groups:
+ - Linux servers
+ - Zabbix servers
+ link_templates:
+ - ExampleTemplate
+ status: enabled
+ state: present
+ interfaces:
+ - type: 1
+ main: 1
+ useip: 1
+ ip: 10.1.1.1
+ dns: ""
+ port: "10050"
+
+- name: Create new Zabbix discoveryrule on host
+ community.zabbix.zabbix_discoveryrule:
+ name: ExampleHostRule
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: 'vfs.fs.discovery'
+ interval: 1m
+ enabled: True
+ state: present
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_teardown.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_teardown.yml
new file mode 100644
index 000000000..4a2ec158f
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_teardown.yml
@@ -0,0 +1,9 @@
+- name: remove test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ state: absent
+
+- name: remove test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ state: absent
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_tests.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_tests.yml
new file mode 100644
index 000000000..604ecf4d4
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_itemprototype/tasks/zabbix_tests.yml
@@ -0,0 +1,248 @@
+---
+
+- name: test - create new Zabbix item on host with many options set
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: '{% raw %}vfs.fs.size[{#FSNAME},used]{% endraw %}'
+ value_type: numeric_unsigned
+ units: GB
+ interval: 1m
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhostitem_new
+
+- name: assert that item was created
+ ansible.builtin.assert:
+ that: zbxhostitem_new is changed
+
+- name: test - create same Zabbix item group once again
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: '{% raw %}vfs.fs.size[{#FSNAME},used]{% endraw %}'
+ value_type: numeric_unsigned
+ units: GB
+ interval: 1m
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhostitem_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhostitem_existing is changed
+
+- name: test - update existing zabbix item
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ params:
+ interval: 2m
+ state: present
+ register: zbxhostitem_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxhostitem_changed is changed
+
+- name: test - attempt to delete previously created zabbix item
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostitem_existing_delete
+
+- name: assert that item was deleted
+ ansible.builtin.assert:
+ that: zbxhostitem_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix item
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostitem_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhostitem_missing_delete is changed
+
+- name: test - create new Zabbix master item on host
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: '{% raw %}vfs.fs.size[{#FSNAME},used]{% endraw %}'
+ value_type: numeric_unsigned
+ units: B
+ interval: 1m
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhostmstitem_new
+
+- name: assert that item was created
+ ansible.builtin.assert:
+ that: zbxhostmstitem_new is changed
+
+- name: create dependent item
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestDependItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ params:
+ type: dependent_item
+ key: '{% raw %}vfs.fs.size.half[{#FSNAME}]{% endraw %}'
+ value_type: numeric_float
+ units: B
+ master_item:
+ item_name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ preprocessing:
+ - type: javascript
+ params: 'return value / 2;'
+ error_handler: zabbix_server
+ state: present
+ register: zbxhostdependitem_new
+
+- name: assert that item was created
+ ansible.builtin.assert:
+ that: zbxhostdependitem_new is changed
+
+- name: test - attempt to delete previously created zabbix item
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostmstitem_existing_delete
+
+- name: assert that item was deleted
+ ansible.builtin.assert:
+ that: zbxhostmstitem_existing_delete is changed
+
+- name: test - attempt to delete dependent item
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestDependItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ state: absent
+ register: zbxhostdependitem_delete
+
+- name: assert that the item had been removed with its master
+ ansible.builtin.assert:
+ that: not zbxhostdependitem_delete is changed
+
+- name: remove host rule
+ community.zabbix.zabbix_discoveryrule:
+ name: ExampleHostRule
+ host_name: ExampleHost
+ state: absent
+
+- name: Create new Zabbix discoveryrule on template
+ community.zabbix.zabbix_discoveryrule:
+ name: ExampleTemplateRule
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: 'vfs.fs.discovery'
+ interval: 1m
+ enabled: True
+ state: present
+
+- name: test - create new Zabbix item on template with many options set
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleTemplateRule
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: '{% raw %}vfs.fs.size[{#FSNAME},used]{% endraw %}'
+ value_type: numeric_unsigned
+ units: B
+ interval: 1m
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtempitem_new
+
+- name: assert that item was created
+ ansible.builtin.assert:
+ that: zbxtempitem_new is changed
+
+- name: test - create same Zabbix item group once again
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleTemplateRule
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: '{% raw %}vfs.fs.size[{#FSNAME},used]{% endraw %}'
+ value_type: numeric_unsigned
+ units: B
+ interval: 1m
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtempitem_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtempitem_existing is changed
+
+- name: test - update existing zabbix item
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleTemplateRule
+ template_name: ExampleTemplate
+ params:
+ interval: 2m
+ state: present
+ register: zbxtempitem_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxtempitem_changed is changed
+
+- name: test - attempt to delete previously created zabbix item
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleTemplateRule
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtempitem_existing_delete
+
+- name: assert that item was deleted
+ ansible.builtin.assert:
+ that: zbxtempitem_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix item
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:TestItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleTemplateRule
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtempitem_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtempitem_missing_delete is changed
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/meta/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/meta/main.yml
new file mode 100644
index 000000000..acdb704c8
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - setup_zabbix
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/main.yml
new file mode 100644
index 000000000..c410c36da
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/main.yml
@@ -0,0 +1,28 @@
+---
+- name: test - do not run tests for Zabbix < 6.4
+ meta: end_play
+ when: zabbix_version is version('6.4', '<')
+
+- block:
+ # setup stuff
+ - include_tasks: zabbix_setup.yml
+
+ # zabbix_trigger module tests
+ - include_tasks: zabbix_tests.yml
+
+ # tear down stuff set up earlier
+ - include_tasks: zabbix_teardown.yml
+ always:
+ - name: "cleanup host item if tests failed"
+ community.zabbix.zabbix_item:
+ host_name: ExampleHost
+ name: ExampleHostItem
+ state: absent
+ ignore_errors: true
+
+ - name: "cleanup template item if tests failed"
+ community.zabbix.zabbix_item:
+ template_name: ExampleTemplate
+ name: ExampleTemplateItem
+ state: absent
+ ignore_errors: true
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_setup.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_setup.yml
new file mode 100644
index 000000000..de3c7ecf4
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_setup.yml
@@ -0,0 +1,47 @@
+---
+
+- name: Create test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ template_groups:
+ - Templates
+
+- name: Create test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ host_groups:
+ - Linux servers
+ - Zabbix servers
+ link_templates:
+ - ExampleTemplate
+ status: enabled
+ state: present
+ interfaces:
+ - type: 1
+ main: 1
+ useip: 1
+ ip: 10.1.1.1
+ dns: ""
+ port: "10050"
+
+- name: Create test host item
+ community.zabbix.zabbix_item:
+ name: ExampleHostItem
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: agent.ping
+ value_type: numeric_unsigned
+ interval: 1m
+ state: present
+
+- name: Create test template item
+ community.zabbix.zabbix_item:
+ name: ExampleTemplateItem
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: system.cpu.load[percpu,avg1]
+ value_type: numeric_float
+ interval: 1m
+ state: present
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_teardown.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_teardown.yml
new file mode 100644
index 000000000..305484842
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_teardown.yml
@@ -0,0 +1,21 @@
+- name: remove test host item
+ community.zabbix.zabbix_item:
+ name: ExampleHostItem
+ host_name: ExampleHost
+ state: absent
+
+- name: remove test template item
+ community.zabbix.zabbix_item:
+ name: ExampleTemplateItem
+ template_name: ExampleTemplate
+ state: absent
+
+- name: remove test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ state: absent
+
+- name: remove test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ state: absent
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_tests.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_tests.yml
new file mode 100644
index 000000000..c87bd28b6
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_trigger/tasks/zabbix_tests.yml
@@ -0,0 +1,159 @@
+---
+
+- name: test - create new Zabbix trigger on host with many options set
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ host_name: ExampleHost
+ description: test host trigger
+ params:
+ severity: warning
+ expression: 'nodata(/ExampleHost/agent.ping,2m)=1'
+ recovery_mode: recovery_expression
+ recovery_expression: 'nodata(/ExampleHost/agent.ping,2m)=0'
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhosttrigger_new
+
+- name: assert that trigger was created
+ ansible.builtin.assert:
+ that: zbxhosttrigger_new is changed
+
+- name: test - create same Zabbix trigger once again
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ host_name: ExampleHost
+ description: test host trigger
+ params:
+ severity: warning
+ expression: 'nodata(/ExampleHost/agent.ping,2m)=1'
+ recovery_mode: recovery_expression
+ recovery_expression: 'nodata(/ExampleHost/agent.ping,2m)=0'
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhosttrigger_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhosttrigger_existing is changed
+
+- name: test - update existing zabbix trigger
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ host_name: ExampleHost
+ params:
+ manual_close: False
+ state: present
+ register: zbxhosttrigger_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxhosttrigger_changed is changed
+
+- name: test - attempt to delete previously created zabbix trigger
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ host_name: ExampleHost
+ state: absent
+ register: zbxhosttrigger_existing_delete
+
+- name: assert that trigger was deleted
+ ansible.builtin.assert:
+ that: zbxhosttrigger_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix trigger
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ host_name: ExampleHost
+ state: absent
+ register: zbxhosttrigger_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhosttrigger_missing_delete is changed
+
+- name: test - create new Zabbix trigger on template with many options set
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ template_name: ExampleTemplate
+ description: test template trigger
+ params:
+ severity: warning
+ expression: 'count(/ExampleTemplate/system.cpu.load[percpu,avg1],#2,"gt","1.3")>1'
+ recovery_mode: recovery_expression
+ recovery_expression: 'count(/ExampleTemplate/system.cpu.load[percpu,avg1],#2,"lt","1.3")>1'
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtemptrigger_new
+
+- name: assert that trigger was created
+ ansible.builtin.assert:
+ that: zbxtemptrigger_new is changed
+
+- name: test - create same Zabbix trigger once again
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ template_name: ExampleTemplate
+ description: test template trigger
+ params:
+ severity: warning
+ expression: 'count(/ExampleTemplate/system.cpu.load[percpu,avg1],#2,"gt","1.3")>1'
+ recovery_mode: recovery_expression
+ recovery_expression: 'count(/ExampleTemplate/system.cpu.load[percpu,avg1],#2,"lt","1.3")>1'
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtemptrigger_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtemptrigger_existing is changed
+
+- name: test - update existing zabbix trigger
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ template_name: ExampleTemplate
+ params:
+ manual_close: False
+ state: present
+ register: zbxtemptrigger_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxtemptrigger_changed is changed
+
+- name: test - attempt to delete previously created zabbix trigger
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtemptrigger_existing_delete
+
+- name: assert that trigger was deleted
+ ansible.builtin.assert:
+ that: zbxtemptrigger_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix trigger
+ community.zabbix.zabbix_trigger:
+ name: TestTrigger
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtemptrigger_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtemptrigger_missing_delete is changed
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/meta/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/meta/main.yml
new file mode 100644
index 000000000..acdb704c8
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - setup_zabbix
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/main.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/main.yml
new file mode 100644
index 000000000..05bcdb724
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/main.yml
@@ -0,0 +1,44 @@
+---
+- name: test - do not run tests for Zabbix < 6.4
+ meta: end_play
+ when: zabbix_version is version('6.4', '<')
+
+- block:
+ # setup stuff
+ - include_tasks: zabbix_setup.yml
+
+ # zabbix_triggerprototype module tests
+ - include_tasks: zabbix_tests.yml
+
+ # tear down stuff set up earlier
+ - include_tasks: zabbix_teardown.yml
+ always:
+ - name: "cleanup host item if tests failed"
+ community.zabbix.zabbix_itemprototype:
+ host_name: ExampleHost
+ discoveryrule_name: ExampleHostRule
+ name: ExampleHostItem
+ state: absent
+ ignore_errors: true
+
+ - name: "cleanup template item if tests failed"
+ community.zabbix.zabbix_itemprototype:
+ template_name: ExampleTemplate
+ discoveryrule_name: ExampleTemplateRule
+ name: ExampleTemplateItem
+ state: absent
+ ignore_errors: true
+
+ - name: cleanup discovery rule on host if tests failed
+ community.zabbix.zabbix_discoveryrule:
+ name: ExampleHostRule
+ host_name: ExampleHost
+ state: absent
+ ignore_errors: true
+
+ - name: cleanup discovery rule on template if tests failed
+ community.zabbix.zabbix_discoveryrule:
+ name: ExampleTemplateRule
+ template_name: ExampleTemplate
+ state: absent
+ ignore_errors: true
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_setup.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_setup.yml
new file mode 100644
index 000000000..b42134f3a
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_setup.yml
@@ -0,0 +1,48 @@
+---
+
+- name: Create test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ template_groups:
+ - Templates
+
+- name: Create test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ host_groups:
+ - Linux servers
+ - Zabbix servers
+ link_templates:
+ - ExampleTemplate
+ status: enabled
+ state: present
+ interfaces:
+ - type: 1
+ main: 1
+ useip: 1
+ ip: 10.1.1.1
+ dns: ""
+ port: "10050"
+
+- name: Create new Zabbix discoveryrule on host
+ community.zabbix.zabbix_discoveryrule:
+ name: ExampleHostRule
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: 'vfs.fs.discovery'
+ interval: 1m
+ enabled: True
+ state: present
+
+- name: Create host item prototype
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:ExampleItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleHostRule
+ host_name: ExampleHost
+ params:
+ type: zabbix_agent_active
+ key: '{% raw %}vfs.fs.size[{#FSNAME}, pused]{% endraw %}'
+ value_type: numeric_unsigned
+ interval: 1m
+ state: present
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_teardown.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_teardown.yml
new file mode 100644
index 000000000..ef841de56
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_teardown.yml
@@ -0,0 +1,15 @@
+- name: remove test template item
+ community.zabbix.zabbix_item:
+ name: ExampleTemplateItem
+ template_name: ExampleTemplate
+ state: absent
+
+- name: remove test host
+ community.zabbix.zabbix_host:
+ host_name: ExampleHost
+ state: absent
+
+- name: remove test template
+ community.zabbix.zabbix_template:
+ template_name: ExampleTemplate
+ state: absent
diff --git a/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_tests.yml b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_tests.yml
new file mode 100644
index 000000000..7975e20c1
--- /dev/null
+++ b/ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_triggerprototype/tasks/zabbix_tests.yml
@@ -0,0 +1,180 @@
+---
+
+- name: test - create new Zabbix trigger on host with many options set
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ host_name: ExampleHost
+ description: test host trigger
+ params:
+ severity: warning
+ expression: '{% raw %}last(/ExampleHost/vfs.fs.size[{#FSNAME}, pused])>80{% endraw %}'
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhosttrigger_new
+
+- name: assert that trigger was created
+ ansible.builtin.assert:
+ that: zbxhosttrigger_new is changed
+
+- name: test - create same Zabbix trigger once again
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ host_name: ExampleHost
+ description: test host trigger
+ params:
+ severity: warning
+ expression: '{% raw %}last(/ExampleHost/vfs.fs.size[{#FSNAME}, pused])>80{% endraw %}'
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxhosttrigger_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhosttrigger_existing is changed
+
+- name: test - update existing zabbix trigger
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ host_name: ExampleHost
+ params:
+ manual_close: False
+ state: present
+ register: zbxhosttrigger_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxhosttrigger_changed is changed
+
+- name: test - attempt to delete previously created zabbix trigger
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ host_name: ExampleHost
+ state: absent
+ register: zbxhosttrigger_existing_delete
+
+- name: assert that trigger was deleted
+ ansible.builtin.assert:
+ that: zbxhosttrigger_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix trigger
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ host_name: ExampleHost
+ state: absent
+ register: zbxhosttrigger_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxhosttrigger_missing_delete is changed
+
+- name: remove host rule
+ community.zabbix.zabbix_discoveryrule:
+ name: ExampleHostRule
+ host_name: ExampleHost
+ state: absent
+
+- name: Create new Zabbix discoveryrule on template
+ community.zabbix.zabbix_discoveryrule:
+ name: ExampleTemplateRule
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: 'vfs.fs.discovery'
+ interval: 1m
+ enabled: True
+ state: present
+
+- name: Create template item prototype
+ community.zabbix.zabbix_itemprototype:
+ name: '{% raw %}{#FSNAME}:ExampleItemPrototype{% endraw %}'
+ discoveryrule_name: ExampleTemplateRule
+ template_name: ExampleTemplate
+ params:
+ type: zabbix_agent_active
+ key: '{% raw %}vfs.fs.size[{#FSNAME}, pused]{% endraw %}'
+ value_type: numeric_unsigned
+ interval: 1m
+ state: present
+
+- name: test - create new Zabbix trigger on template with many options set
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ template_name: ExampleTemplate
+ description: test template trigger
+ params:
+ severity: warning
+ expression: '{% raw %}last(/ExampleTemplate/vfs.fs.size[{#FSNAME}, pused])>80{% endraw %}'
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtemptrigger_new
+
+- name: assert that trigger was created
+ ansible.builtin.assert:
+ that: zbxtemptrigger_new is changed
+
+- name: test - create same Zabbix trigger once again
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ template_name: ExampleTemplate
+ description: test template trigger
+ params:
+ severity: warning
+ expression: '{% raw %}last(/ExampleTemplate/vfs.fs.size[{#FSNAME}, pused])>80{% endraw %}'
+ manual_close: True
+ enabled: True
+ tags:
+ - tag: tag
+ value: value
+ state: present
+ register: zbxtemptrigger_existing
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtemptrigger_existing is changed
+
+- name: test - update existing zabbix trigger
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ template_name: ExampleTemplate
+ params:
+ manual_close: False
+ state: present
+ register: zbxtemptrigger_changed
+
+- name: expect to succeed and that things changed
+ ansible.builtin.assert:
+ that: zbxtemptrigger_changed is changed
+
+- name: test - attempt to delete previously created zabbix trigger
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtemptrigger_existing_delete
+
+- name: assert that trigger was deleted
+ ansible.builtin.assert:
+ that: zbxtemptrigger_existing_delete is changed
+
+- name: test - attempt to delete non-existing zabbix trigger
+ community.zabbix.zabbix_triggerprototype:
+ name: '{% raw %}Free disk space is less than 20% on volume {#FSNAME}{% endraw %}'
+ template_name: ExampleTemplate
+ state: absent
+ register: zbxtemptrigger_missing_delete
+
+- name: assert that nothing has been changed
+ ansible.builtin.assert:
+ that: not zbxtemptrigger_missing_delete is changed