Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module: Implementation of zabbix_item #1216

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
typos in examples
Lars van der Hooft committed Apr 24, 2024

Verified

This commit was signed with the committer’s verified signature.
sassanh Sassan Haradji
commit 23169f1c279d746c2ee8e7bb8f5e19a0472a41a6
9 changes: 6 additions & 3 deletions plugins/modules/zabbix_item.py
Original file line number Diff line number Diff line change
@@ -511,13 +511,16 @@
community.zabbix.zabbix_item:
host_name: ExampleHost
item_name: ExampleItem
key: ExampleItem
description: My ExampleItem Description
type: zabbix_internal
value_type: text
status: enabled
state: present
tags:
- tag: ExampleHostsTag
- tag: ExampleHostsTag2
- tag: ExampleItemTag
value: ExampleTagValue
- tag: ExampleItemTag2
value: ExampleTagValue

- name: Update an existing item's check type
@@ -531,7 +534,7 @@
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 # you can use task level ansible_host or delegate_to like in previous example
become: false
community.zabbix.zabbix_host:
community.zabbix.zabbix_item:
host_name: ExampleHost
item_name: ExampleItem
type: simple_check
4 changes: 1 addition & 3 deletions tests/integration/targets/test_zabbix_item/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -4,9 +4,7 @@

- include_tasks: zabbix_item_tests.yml

# - include_tasks: zabbix_item_doc.yml

# - include_tasks: zabbix_item_teardown.yml
- include_tasks: zabbix_item_doc.yml

always:
- name: "Cleanup item if test failed"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# These two tests are close to documentation example

- name: Create a new item or rewrite an existing item's info
community.zabbix.zabbix_item:
host_name: ExampleHost
item_name: ExampleItem
key: ExampleItem
description: My ExampleItem Description
type: zabbix_internal
status: enabled
state: present
tags:
- tag: ExampleItemTag
value: ExampleTagValue
- tag: ExampleItemTag2
value: ExampleTagValue

- name: Update an existing item's check type
community.zabbix.zabbix_item:
host_name: ExampleHost
item_name: ExampleItem
type: simple_check

- name: expect both to succeed
ansible.builtin.assert:
that:
- "zabbix_item_1 is changed"
- "zabbix_item_2 is changed"
Loading