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

AnsibleRunnerV2 broken on upstream changes to PlaybookCLI in devel #401

Closed
jctanner opened this issue Jan 25, 2019 · 7 comments
Closed

AnsibleRunnerV2 broken on upstream changes to PlaybookCLI in devel #401

jctanner opened this issue Jan 25, 2019 · 7 comments

Comments

@jctanner
Copy link

(venv) [jtanner@jtw530 role.1]$ python -c 'from testinfra.utils.ansible_runner import AnsibleRunnerV2; runner = AnsibleRunnerV2()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/data/workspace.issues/AP-MOLECULE_COLLECTION_INIT/venv/lib/python3.7/site-packages/testinfra-1.16.0-py3.7.egg/testinfra/utils/ansible_runner.py", line 153, in __init__
    self.cli.options = self.cli.base_parser(
AttributeError: 'PlaybookCLI' object has no attribute 'base_parser'
(venv) [jtanner@jtw530 role.1]$

Caused by ansible/ansible@7e92ff8#diff-b54c875fc6bfd4d98dcc488f06a07bea

@jctanner jctanner changed the title upstream ansible has changed the api for CLI which has broken AnsibleRunnerV2 AnsibleRunnerV2 broken on upstream changes to PlaybookCLI in devel Jan 25, 2019
@singuliere
Copy link

The commit introducing the change, from the PR and before the squash post merge: ansible/ansible@39e4421

singuliere added a commit to singuliere/testinfra that referenced this issue Feb 8, 2019
As of ansible/ansible#50069 the base_parser
function no longer exists. Use
ansible.arguments.optparse_helpers.create_base_parser
instead.

Fixes: pytest-dev#401
singuliere added a commit to singuliere/testinfra that referenced this issue Feb 8, 2019
As of ansible/ansible#50069 the base_parser
function no longer exists. Use
ansible.arguments.optparse_helpers.create_base_parser
instead.

Fixes: pytest-dev#401
singuliere added a commit to singuliere/testinfra that referenced this issue Feb 8, 2019
As of ansible/ansible#50069 the base_parser
function no longer exists. Use
ansible.arguments.optparse_helpers.create_base_parser
instead.

Fixes: pytest-dev#401
@cboylan
Copy link

cboylan commented Mar 1, 2019

Using https://github.com/ansible/ansible-runner may be more reliable long term method of running ansible from testinfra. I don't have enough knowledge around testinfra or ansible-runner to know for sure, but wanted to make sure this alternative was called out since ansible-runner seems built for this exact use case.

@jctanner
Copy link
Author

jctanner commented Mar 1, 2019

I've already started a port to runner and it's only held up right now by an obscure bug: ansible/ansible-runner#200

@ianw
Copy link
Collaborator

ianw commented Mar 1, 2019

@jctanner thanks for that; I took that gist and got it working for at least a loopback situation and will test more. I missing what was happening with the event capture, ascii codes and molecule, but I hope that with you as the author you can also update the pull request (or make new ones, whatever :) OpenStack should be able to test that pull request as it progresses in our CI too, as an extra level of testing over travis

#410

@philpep
Copy link
Contributor

philpep commented Mar 2, 2019

Great ! +1 for using ansible-runner

@decentral1se
Copy link
Collaborator

🚀 🚀 🚀

ansible-runner integration would indeed be fantastic.

@philpep
Copy link
Contributor

philpep commented May 5, 2019

Hi, I just released 3.0.0 with the new ansible runner which should be compatible with ansible 2.8 please sse the changelog here: https://testinfra.readthedocs.io/en/latest/changelog.html

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 a pull request may close this issue.

6 participants