community.zabbix icon indicating copy to clipboard operation
community.zabbix copied to clipboard

Add apiinfo_facts module and tests

Open masa-orca opened this issue 1 year ago • 4 comments

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

masa-orca avatar Jul 10 '22 18:07 masa-orca

Codecov Report

Merging #733 (819402f) into main (628d6dd) will decrease coverage by 0.01%. The diff coverage is n/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     

see 1 file with indirect coverage changes

codecov[bot] avatar Jul 10 '22 18:07 codecov[bot]

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

D3DeFi avatar Jul 28 '22 09:07 D3DeFi

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.

mu1f407 avatar Jul 30 '22 07:07 mu1f407

To be honest I'd rename this module to either zabbix_api_info or zabbix_api_facts.

BGmot avatar Aug 07 '22 08:08 BGmot

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 .

masa-orca avatar May 02 '23 03:05 masa-orca

Thanks a lot @masa-orca !

BGmot avatar Jun 25 '23 22:06 BGmot

@BGmot Thank you for your reviwing! I updated documents.

masa-orca avatar Jun 29 '23 16:06 masa-orca

I rebased main branch and added this module to action_groups like https://github.com/ansible-collections/community.zabbix/pull/1029.

masa-orca avatar Jul 02 '23 08:07 masa-orca