Skip to content
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

Merged
merged 5 commits into from
May 5, 2019
Merged

New ansible runner #432

merged 5 commits into from
May 5, 2019

Conversation

philpep
Copy link
Contributor

@philpep philpep commented Apr 29, 2019

Implementation for #431

@philpep philpep force-pushed the ansible-fixes branch 2 times, most recently from 829ef5e to d7f99b0 Compare April 30, 2019 00:50

def run_module(self, host, module_name, module_args, become=False,
check=True, **kwargs):
cmd, args = 'ansible --tree %s', [None]

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!

@decentral1se
Copy link
Collaborator

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".
@philpep
Copy link
Contributor Author

philpep commented May 5, 2019

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

@philpep philpep merged commit 484f08c into master May 5, 2019
@philpep philpep deleted the ansible-fixes branch May 7, 2019 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants