molecule icon indicating copy to clipboard operation
molecule copied to clipboard

RFE: Remove dependency on ansible-core

Open cidrblock opened this issue 2 years ago • 4 comments

Using molecule in a testing matrix of python interpreters and ansible version is challenging because molecule has a dependency on ansible-core which is > ansible 2.9.

When attempting to test with ansible 2.9, molecule forces an upgrade based on it's own requirements.

I'm not sure exactly where/why ansible-core is needed, but I think we should research this to see if it's possible to allow the user to choose the ansible version desired without conflict.

cidrblock avatar Aug 07 '23 21:08 cidrblock

if it's possible to allow the user to choose the ansible version desired without conflict.

Maybe we can lower the lower bound of ansible-core in ansible-compat


ansible-galaxy is used in code base, but it can be installed separately, which has no impact on packaging molecule.

https://github.com/ansible/molecule/blob/6daea252e28383ab89b9e303491c755ed5c60e56/src/molecule/dependency/ansible_galaxy/base.py#L45

I think we can remove ansible-core dependency in https://github.com/ansible/molecule/blob/6daea252e28383ab89b9e303491c755ed5c60e56/.config/requirements.in#L2

But, ansible-compat also requires ansible-core>=2.12.

https://github.com/ansible/ansible-compat/blob/fece06f4f8afd333946ba58c22dfa257368742c4/pyproject.toml#L40

zhan9san avatar Aug 09 '23 02:08 zhan9san

This is what I was afraid of. For now I dropped the 2.9 tests where I was using molecule.

The other issue here is to test with python 3.8 which is required for 2.9, we're dropping all the way back to molecule 4.0.4.

As the devtools get deeper into the testing of content, IMHO they will need to be a little less agressive dropping python interpreter and core versions. I'm not sure it's worth going backwards, but 3.9/2.12 should be min bar while supported.

(and python 3.12 is right around the corner)

cidrblock avatar Aug 11 '23 20:08 cidrblock

I prefer the users upgrade Python versions in a regular time. It's some boring chore but it can makes the project long live.

If we support many old versions, there would be more redundant code to handle the compatible issue, which would make the maintenance more complicated.

zhan9san avatar Aug 16 '23 03:08 zhan9san

I almost agree 100% almost 100% of the time.......... The only exception being the need to support the at least one version of python supported by the oldest version of ansible/asible-core still supported. 2.9 drops this fall which is great........it's time has passed :)

cidrblock avatar Aug 16 '23 11:08 cidrblock