molecule: Compatibility with Ansible devel (2.8) broken
Issue Type
- Bug report
Since 7e92ff823e2bf97ee33c1b7ff87bb8acecb5ae77, molecule doesn’t work with ansible devel version.
Error is:
==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_default.py ____________________
tests/test_default.py:6: in <module>
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
/home/travis/build/ansible/molecule/.tox/ansibledevel-functional/lib/python3.7/site-packages/testinfra/utils/ansible_runner.py:153: in __init__
self.cli.options = self.cli.base_parser(
E AttributeError: 'PlaybookCLI' object has no attribute 'base_parser'
Issue was reported by @maxamillion on #ansible-molecule channel:
@maxamillion | can anyone advise what I'm doing wrong here? https://paste.fedoraproject.org/paste/6Q4OJP4CQxfzGU0HzqTpog
@maxamillion | or what I might be missing
@maxamillion | I *think* it's a bug in testinfra, but I'm not certain
Pilou | maxamillion: it seems base_parser has been removed (7e92ff823e2bf97ee33c1b7ff87bb8acecb5ae77)
@bcoca | maxamillion: tanner was saying this last week, ansible changed the internal options parser
@bcoca | and molecule uses it directly, which now breaks with devel
@bcoca | you can still use with <=2.7
@maxamillion | oh right, I vaguely remember that conversation
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 22 (19 by maintainers)
Commits related to this issue
- Allow ansible-devel to fail for now. Until we fix: * https://github.com/ansible/molecule/issues/1727 Signed-off-by: Luke Murphy <lukewm@riseup.net> — committed to decentral1se/molecule by decentral1se 5 years ago
- Allow ansible-devel to fail for now. Until we fix: * https://github.com/ansible/molecule/issues/1727 Signed-off-by: Luke Murphy <lukewm@riseup.net> — committed to decentral1se/molecule by decentral1se 5 years ago
- Remove `--pre` flag for `molecule` installation Molecule `2.20.1` installs on Python2.7 now. Using `--pre` is resulting in Ansible 2.8-devel, and Molecule currently doesn't work well with Ansible 2.... — committed to kentr/drupal-vm by kentr 5 years ago
- Specify the version of Ansible on TravisCI Specify the version of Ansible installed on TravisCI since there currently seems to be compatibility issues with Ansible 2.8. Related to ansible/molecule#1... — committed to onaio/ansible-rapidpro-indexer by jasonrogena 5 years ago
- #2 Installing testinfra 3.x package before molecule gives a warning `molecule 2.20.1 has requirement testinfra==1.19.0, but you'll have testinfra 3.0.4 which is incompatible.` thats simply wrong - wit... — committed to jonashackt/molecule-ansible-docker-aws by jonashackt 5 years ago
- #3 using Ansible 2.7.x for now, until https://github.com/ansible/molecule/issues/1727 is fixed / release available — committed to jonashackt/molecule-ansible-docker-aws by jonashackt 5 years ago
- CI: ensure a recent version of testinfra is installed before molecule see https://github.com/ansible/molecule/issues/1727 — committed to theoapp/ansible-role-theo-agent by gizero 5 years ago
- fix ci https://github.com/ansible/molecule/issues/1727 — committed to bessonovevgen/apache-1c by bessonovevgen 5 years ago
- Workaround for https://github.com/ansible/molecule/issues/1727 This works around an issue with ansible and molecule that breaks our CI. This issue was recently fixed upstream, but is not yet availab... — committed to nkinder/ansible-keycloak by nkinder 5 years ago
- Workaround for https://github.com/ansible/molecule/issues/1727 This works around an issue with ansible and molecule that breaks our CI. This issue was recently fixed upstream, but is not yet availab... — committed to nkinder/ansible-keycloak by nkinder 5 years ago
- Explicitly install testinfra in .travis.yml To avoid the tests from failing when running testinfra, install the testinfra PIP package before molecule. Related to ansible/molecule#1727 Signed-off-by... — committed to onaio/ansible-nginx by jasonrogena 5 years ago
- Workaround for ansible/molecule#1727 This works around an issue with ansible and molecule that breaks our CI. This issue was recently fixed upstream, but is not yet available in the packages used du... — committed to sradco/logging by sradco 5 years ago
- Workaround for ansible/molecule#1727 This works around an issue with ansible and molecule that breaks our CI. This issue was recently fixed upstream, but is not yet available in the packages used du... — committed to linux-system-roles/logging by sradco 5 years ago
- work around for https://github.com/ansible/molecule/issues/1727 — committed to avinetworks/ansible-role-avicontroller-vmware by deleted user 5 years ago
- Updated US source to: 02dca4b Workaround for ansible/molecule#1727 Updated upstream source commit. Commit details follow: Project: https://github.com/linux-system-roles/logging Branch: master Commi... — committed to oVirt/ovirt-engine-metrics by deleted user 5 years ago
- Fix for molecule inconsistency https://github.com/ansible/molecule/issues/1727 — committed to scigility/kerberos_server by NadOby 5 years ago
- Use Ansible 2.7 .travis.yml To avoid the tests from failing when running testinfra, install Ansible 2.7 instead of 2.8 in the .travis.yml file. Related to ansible/molecule#1727 Signed-off-by: Jason... — committed to onaio/ansible-nginx by jasonrogena 5 years ago
- Use Ansible 2.7 in .travis.yml To avoid the tests from failing when running testinfra, install Ansible 2.7 instead of 2.8 in the .travis.yml file. Related to ansible/molecule#1727 Signed-off-by: Ja... — committed to onaio/ansible-nginx by jasonrogena 5 years ago
- Fix lint errors and update molecule for ansible v2.8 (#23) * Fix yamlint warning * Replace categories by galaxy tags Fixing: E702: Use 'galaxy_tags' rather than 'categories' FIxing: E701: Role... — committed to ultratendency/kerberos_server by lhoss 5 years ago
I got around this by adding testinfra to travis.yml which installed testinfra 3.0+
Ansible 2.8 dropped 😱 😱 😱
Need to get the
testinfra
patch fixed and fix the CI to build 2.8 proper (without fails).Basically
testinfra
uses private API which is not (and never was) guaranteed to be stable. The right way, as for now, is to call CLI. The long-term fix would be to use ansible-runner which (I heard so) is going to be ready at some point in future (aka probably soon).Using molecule’s docker image here, and we need to add the following line to the dockerfile to make it work with ansible 2.8 and testinfra 3.x:
RUN pip install "ansible==2.8.0" "testinfra==3.0.4"
https://github.com/philpep/testinfra/issues/401#issuecomment-489434741
And testinfra is now 3.0.3:
@lwm this is indeed the wise thing to do 😃 I proposed a pull request to testinfra but it is not trivial and I suspect it will be some time before this is fixed.