-
Notifications
You must be signed in to change notification settings - Fork 665
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
Add Linode driver (v3 API) #1458
Conversation
Looking good so far.... I suggest looking at #1436 and how the model was implemented along with tests. Docker and vagrant are the only drivers which really implement an API from molecule to create.yml. Might be good to define that as part of this. |
35c4051
to
d3484c0
Compare
As a result of direction in the following comment: > ansible#1458 (comment) And the good work and lead of ansible#1436 in: > ansible#1436
OK, I've added the model support in d3484c0, I think. There are now unit tests in place to guard for a proper schema:
Unfortunately, I've found a fairly major bug while E2E testing this which stops this feature from actually being any use at all. That is reported at ansible/ansible#45403 where the bug stops the Linode module destroying the instances it creates 🤒 I'll be heading back over that way to fix that bug. Hopefully, I can get back here in a reasonable time. |
OK, false alarm on ansible/ansible#45403, it was just a docs issue (submitted ansible/ansible#45659 for that). I'll explain the short of it, since it matters here: when a linode is created a |
d1e67d6
to
f753d41
Compare
Closes ansible#1458.
OK, @retr0h, this is ready for a review! I see I just missed the latest release but perhaps this is better off on the devel branch for now ... So, the manual testing I've done for this:
It seems to be in working order! |
Related: #1479. |
@retr0h, can I clarify if you're leaning towards rejecting this PR or accepting it? |
f753d41
to
4b9268d
Compare
Closes ansible#1458.
@lwm Linode has been one I wanted for quite a while. |
@lwm Nicely implemented! I know adding drivers is a pain. |
@lwm Can you please run |
4b9268d
to
19e9d89
Compare
Closes ansible#1458.
19e9d89
to
e0ab6a7
Compare
Closes ansible#1458.
This is missing a bunch of unit tests. I'm going through it now on my checkout. Hold off on submitting any additional work. |
If it makes you feel any better, we're already using this across multiple roles on every CI run over at https://git.coop/aptivate/ansible-roles. Some logs, for example are over at https://git.coop/aptivate/ansible-roles/mysql-server/-/jobs/4071. Let me know if I can add more testing to help. |
Sorry for the delay on this @lwm -- when I add the unit tests for the linode driver, I am getting all kinds of other problems, which means I stumbled across a bug in how I test drivers. I have been busy the last couple weeks and apologize for not looking into this sooner. |
No worries! Thanks for the update. Happy to have helped smoke out a new bug :) |
Just in case others look at this, Linode & Molecule both have Working Groups within IRC |
I'm going to hold off from merging this. As you know Ansible is adopting Molecule, therefore I do not want to merge anything that may impact future architectural decisions, as I will no longer be leading the development of this project. |
Thanks for the explanation. No ideas so far but I believe you're probably right about broken teardown: I've fixed numerous problems with it already after the acquisition and I expect that there may be more issues left unnoticed. |
Do we need something like https://github.com/ansible/ansible/blob/devel/test/sanity/validate-modules/schema.py to validate the he schema? |
@gundalow there's schema validation built-in Molecule already: https://github.com/ansible/molecule/blob/master/molecule/model/schema_v2.py |
#1639 might get me moving forward ... |
a92ca92
to
80f5fdf
Compare
Closes ansible#1458. Signed-off-by: Luke Murphy <[email protected]>
80f5fdf
to
70e3543
Compare
Closes ansible#1458. Signed-off-by: Luke Murphy <[email protected]>
1d3534d
to
d9401d3
Compare
OK, I'm still waiting for the build to run have seen it all go green on my local. @webknjaz, can you give this another pass? There are 3 additional commits now which aim to fix the failing tests. |
CI IS GREEN EDIT: (very intense GIF) https://media0.giphy.com/media/26tPghhb310muUkEw/giphy.gif?cid=3640f6095c3f0fa370336b3655c45568) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few minor things to fix
|
||
.. code-block:: bash | ||
|
||
$ pip install linode-python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should add it since all other drivers in master have their extras entries now.
Closes ansible#1458. Signed-off-by: Luke Murphy <[email protected]>
Full credit to @mickelmayers in ansible#1639. Originall submitted with message like: Platforms_base_schema destroy copy.deepcopy(base_schema). Then when validating multiply molecules it's running with errors. Eg. two moleule with different drivers. One Azure second docker . If docker will be validated first from it schema we are getting. Moving platforms_base_schema to base_schema and changing the util.merge_dicts fixes the issue. Closes ansible#1639. Signed-off-by: Luke Murphy <[email protected]>
This change works towards stopping schema merging clobbering themselves. Without this change, the `test_dependency_shell_has_errors` test is failing due to an incorrect schema. Signed-off-by: Luke Murphy <[email protected]>
The `test_platforms_docker_has_errors` test is failing otherwise. Signed-off-by: Luke Murphy <[email protected]>
6592601
to
b5dc640
Compare
Ah, it was already added. So, fixed that documentation now as well. I've addressed all your comments and pushed. Ready for another pass. |
Thank you to everybody that's help with this! |
🎉 |
* Add Linode driver. Closes ansible#1458. Signed-off-by: Luke Murphy <[email protected]> * Fix incorrect copying of schema for validation. Full credit to @mickelmayers in ansible#1639. Originall submitted with message like: Platforms_base_schema destroy copy.deepcopy(base_schema). Then when validating multiply molecules it's running with errors. Eg. two moleule with different drivers. One Azure second docker . If docker will be validated first from it schema we are getting. Moving platforms_base_schema to base_schema and changing the util.merge_dicts fixes the issue. Closes ansible#1639. Signed-off-by: Luke Murphy <[email protected]> * Merge schema only once. This change works towards stopping schema merging clobbering themselves. Without this change, the `test_dependency_shell_has_errors` test is failing due to an incorrect schema. Signed-off-by: Luke Murphy <[email protected]> * Remove incorrect driver for fixture. The `test_platforms_docker_has_errors` test is failing otherwise. Signed-off-by: Luke Murphy <[email protected]>
This is still a work in progress. I've manually tested parts of it but not a full end to end use.
Just wanted to get this up here to see that it is all going in the right direction in case I miss something.
Will close #1450.