ngine-io / ansible-collection-cloudstack

CloudStack Ansible Collections
https://galaxy.ansible.com/ngine_io/cloudstack
GNU General Public License v3.0
21 stars 28 forks source link

WIP: Feature new inventory plugin #53

Closed rvalle closed 3 years ago

rvalle commented 3 years ago

Working on the new inventory plug in, should fix #51 and #26

This PR covers the following:

@resmo I update this as WIP so that you can review and provide comments as finalize it.

rvalle commented 3 years ago

@resmo in the Vultr inventory plug-in you normalize the json replied form the platform using a SCHEMA. What are the goals? validation? format values? leave out some variables?

in cloudstack the ansible_host looks more like an expression host.nic[0].ip kind of. I guess I must create some pseudo variables that come from expressions of that type.

codecov[bot] commented 3 years ago

Codecov Report

Merging #53 (b3765fe) into master (94653d3) will decrease coverage by 0.07%. The diff coverage is 52.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   84.39%   84.32%   -0.08%     
==========================================
  Files          53       53              
  Lines        5512     5519       +7     
  Branches     1247     1247              
==========================================
+ Hits         4652     4654       +2     
- Misses        430      435       +5     
  Partials      430      430              
Impacted Files Coverage Δ
plugins/modules/cs_disk_offering.py 97.14% <ø> (ø)
plugins/modules/cs_instance.py 71.52% <0.00%> (ø)
plugins/modules/cs_network.py 80.76% <ø> (-0.30%) :arrow_down:
plugins/modules/cs_service_offering.py 94.59% <ø> (ø)
plugins/module_utils/cloudstack.py 72.46% <56.25%> (-0.35%) :arrow_down:
plugins/modules/cs_router.py 61.15% <0.00%> (-0.83%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 94653d3...b3765fe. Read the comment docs.

rvalle commented 3 years ago

this is how our inventory is looking if add everything we get form ACS https://pastebin.com/sm09tKum

rvalle commented 3 years ago

Now we can control exactly how the host information comes out of the plugin. I think this plugin should not compete with other mechanisms (i.e. ansible facts or instance_info) we must return the required information for grouping, etc.

Right now, with the minimal transformation the inventory would look like: https://pastebin.com/QeHjKgQS

I need to implement the filters that require name-to-id transformations and complete the inventory data so that groupping can be done.

rvalle commented 3 years ago

This is looking closer to something.... brainstorming on use-cases. here is how our inventory is looking now: https://pastebin.com/bYX0eTdx

rvalle commented 3 years ago

I mistakenly rebased my feature branch against upstream/master Now github is show here other commits not belonging to this PR, so I cowardly refuse to keep using this PR and open another one.