-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
New ansible runner #432
New ansible runner #432
Conversation
829ef5e
to
d7f99b0
Compare
|
||
def run_module(self, host, module_name, module_args, become=False, | ||
check=True, **kwargs): | ||
cmd, args = 'ansible --tree %s', [None] |
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 had no idea this existed. Pretty neat!
Sorry, kinda out of the loop but what is the relation of this PR with #410? In the case of manual testing this new runner with testinfra under molecule, I should be aiming to try this PR branch? Thanks for the good work! |
Use a custom inventory so the test does not depend on "host" fixture and run faster. Also use AnsibleRunner instead of AnsibleBackend.
This will be used in next commit.
Following specification on #431 * Use ansible-inventory cli to parse inventory, group and host variables * Ansible backend re-use existing backend (local, ssh) to run commands. This is a breaking change because we do not support all connection backends from ansible. * The Ansible module run with the ansible cli. * Add more tests * Fix the skipped "encoding" test which pass now. This fix maintainability issue with ansible and the license issue (ansible is GPL). Closes #431
Group can be nested with the ":children" notation. https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#groups-of-groups-and-group-variables Also handle "all" like a normal group since "ansible-inventory" output all groups (including "ungrouped") to be a children of "all".
I merge this PR. I think it's a good enough base to work with. It should be fully backward compatible, enough performant and fixes all the issues from #431 . It think we will probably have small regressions , I bet around sudo or with some complex usages in test suites, so this will go in a major release 3.0.0 |
Implementation for #431