Repository navigation
add ansible playbook runner to ansiblegate module - #48254
Conversation
terminalmage
left a comment
There was a problem hiding this comment.
Just one minor change I would make, otherwise this is ++.
There was a problem hiding this comment.
You can use six.itervalues() here and not need to use the "throwaway" variable.
|
Still need to write tests for this. |
isbm
left a comment
There was a problem hiding this comment.
Generally, if we want to validate the params, we should do it explicitly. Otherwise I would use Pythonic checks (see the comment).
Otherwise, excellent, woohoo!! 😎
There was a problem hiding this comment.
What is the reason to explicitly check the type alongside the value? I.e. why if check: is not sufficient?
There was a problem hiding this comment.
Hmm, still the same question though. I'd say if extra_vars:
|
Test added |
ce14410 to
6ef47ae
Compare
|
re-run py |
isbm
left a comment
There was a problem hiding this comment.
Cool, thanks! Some last little nitpicks though.
There was a problem hiding this comment.
If gitrepo is an empty string this will fail.
There was a problem hiding this comment.
Maybe this is better way, unless we do not want to validate all that and crash with the error "You've passed an empty string instead of a parameters" (or something like that):
if not ansible_kwargs:
ansible_kwargs = {}There was a problem hiding this comment.
I am just going to check if it a dict and if it isn't then i will set it to {}.
|
This should be all set to go on the next test run. |
terminalmage
left a comment
There was a problem hiding this comment.
Is gitrepo part of a naming convention used elsewhere? If not, it may make sense to change it. I'm just worried about confusion between gitrepo (no underscore) and git_kwargs (underscore). It seems like this could lead to confusion/typos.
There was a problem hiding this comment.
@terminalmage actually a very good catch, it slipped out of my radar: the git_<something> is better convention than git<something>.
@gtmanfred could you please appease BOFH (and terminalmage) by looking into name conventions and checking to None one more time? 😉 I would appreciate that.
Other then that, it is good to go as of my current views.
|
@gtmanfred Lint :) |
There was a problem hiding this comment.
bah... i did a search replace... apparently i am just terrible at regex.
There was a problem hiding this comment.
It did fail this time https://jenkins.saltstack.com/job/PR/job/salt-pr-linode-ubuntu14-n/23939/testReport/junit/integration.states.test_ansiblegate/AnsiblePlaybooksTestCase/test_ansible_playbook/
With not having gitrepo in the keys.
isbm
left a comment
There was a problem hiding this comment.
@gtmanfred thanks! Hopefully now it is OK to go.
|
@gtmanfred You've got a test failure here: https://jenkins.saltstack.com/job/PR/job/salt-pr-linode-ubuntu14-n/24000/ |
|
re-run py |
|
@gtmanfred The Py3 tests are failing your new test. Can you take a look? https://jenkins.saltstack.com/job/PR/job/salt-pr-linode-cent7-py3/6163/
|
|
One last test to fix. Working on it this morning |
|
Ok, this should be ready. |
|
@gtmanfred There is still a test failing here, unfortunately: |
|
re-run py |
|
re-run all |
|
re-run py |
|
@gtmanfred I think the following test is related. I am not seeing this fail elsewhere:
https://jenkins.saltstack.com/job/PR/job/salt-pr-linode-ubuntu16-py3/11261/ |
Also, handle @ for extra_vars
handle git_kwargs and ansible_kwargs better as well.
Don't load extra ansible module stuff is ansible is not importable. Use @Depends decorator https://docs.saltstack.com/en/latest/ref/modules/#depends-decorator
Ansiblegate should always be included now, the list and help functions will just be removed in the loader when Depends.enforce_dependencies is run.
|
🎉 |
What does this PR do?
Adds the ability to run ansible playbooks from salt execution modules or from states, specifically for orchestration states.
Tests written?
Added
Commits signed with GPG?
Yes