Closed rvalle closed 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.
Merging #53 (b3765fe) into master (94653d3) will decrease coverage by
0.07%
. The diff coverage is52.94%
.
@@ 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.
this is how our inventory is looking if add everything we get form ACS https://pastebin.com/sm09tKum
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.
This is looking closer to something.... brainstorming on use-cases. here is how our inventory is looking now: https://pastebin.com/bYX0eTdx
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.
Working on the new inventory plug in, should fix #51 and #26
This PR covers the following:
Tries to integrate with the current cloudstack module_utils, not replicating code for: cs init, reading cs config, so there is a re-factorization of the AnsibleCloudstack base class. @resmo you need to review it.
Tries to reuse the configuration_fragment used for the rest of the modules.
Provides some unit tests mainly to validate all cases of #51, this are run manually.
Provides an integration test (WIP) to check the inventory plugin itself. I am having my hardest time here, I can't find any documentation about how to do it properly, and not many examples out there. However the test is getting called and it seems possible to validate the plugin.
@resmo I update this as WIP so that you can review and provide comments as finalize it.