community.zabbix
community.zabbix copied to clipboard
Add apiinfo_facts module and tests
SUMMARY
Add apiinfo_facts module
ISSUE TYPE
- New Module Pull Request
COMPONENT NAME
community.zabbix.zabbix_apiinfo_facts
ADDITIONAL INFORMATION
- Add apiinfo_facts module and tests.
- This returns only version info now
Codecov Report
Merging #733 (819402f) into main (628d6dd) will decrease coverage by
0.01%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## main #733 +/- ##
==========================================
- Coverage 79.58% 79.58% -0.01%
==========================================
Files 31 32 +1
Lines 4164 4193 +29
Branches 1129 1132 +3
==========================================
+ Hits 3314 3337 +23
- Misses 506 509 +3
- Partials 344 347 +3
I may have miss-lead you with a check mode :disappointed:
https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#creating-an-info-or-a-facts-module
it seems they must to support check mode? Probably a reason why this fails.
I am so sorry
I was just reading through documentation yesterday and noticed the requirements for info/facts modules. Beside check mode, fact modules must return ansible_facts
. Module documentation (RETURN
) should also reflect that. Please see ipinfoio_facts as an example.
To be honest I'd rename this module to either zabbix_api_info or zabbix_api_facts.
Hi, Reviewers. Thank you for your reviewing. I appologize for taking much times to modify. I read creating-an-info-or-a-facts-module (@D3DeFi mentioned). The document says
Modules that query/return general information (and not ansible_facts) should be named _info. General information is non-host specific information, for example information on online/cloud services (you can access different accounts for the same online service from the same host), or information on VMs and containers accessible from the machine, or information on individual files or programs.
Therefor, I think it is _info
module.
To be honest I'd rename this module to either zabbix_api_info or zabbix_api_facts.
I agree it. I renamed module to zabbix_api_info
.
Thanks a lot @masa-orca !
@BGmot Thank you for your reviwing! I updated documents.
I rebased main branch and added this module to action_groups like https://github.com/ansible-collections/community.zabbix/pull/1029.