evrardjp / ansible-keepalived

Keepalived role for ansible deployment
Apache License 2.0
98 stars 98 forks source link

Problem with ansible 2.10.X #174

Closed gevraud closed 3 years ago

gevraud commented 3 years ago

Hello,

Using ansible 2.10.X, the module isn't working

`ERROR! couldn't resolve module/action 'ansible.posix.sysctl'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/home/vagrant/projects/bric/elk/ansible-stack-elk/roles/keepalived/tasks/main.yml': line 54, column 3, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

I installed the galaxy module https://galaxy.ansible.com/ansible/posix?extIdCarryOver=true&sc_cid=701f2000001OH7YAAW and change the line 55 from sysctl: to ansible.posix.sysctl:

Could you make this role compatible with ansible >= 2.10?

Regards

evrardjp commented 3 years ago

That's interesting, our CI should be testing ansible-base 2.10. That's the latest, right? I suppose you mean ansible base, right?

gevraud commented 3 years ago

2.10.5

evrardjp commented 3 years ago

It seems my ansible latest runs 2.10.6. Let me check if I have the same issue.

evrardjp commented 3 years ago

Seems like my ansible-base 2.10.6 works just fine, should I produce a log for you?

Can you try to run tox -e ansible-latest on the keepalived role (as root, as molecule needs docker) ? Does that work better?

I am fine with an overhaul of the role to move to the new module system, but it needs to be in another branch. The porting guide of ansible mentions the current naming is okay for now, however. (edit: added link to porting guide: https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.10.html )

Which leads me to think that your environment might be misconfigured.

gevraud commented 3 years ago

I deleted the role directory and resintalled it. It seems to work fine now.

I don't know what happened.. Strange.

Thx for your quick answer

evrardjp commented 3 years ago

For those interested by new style module names, I have written a (incomplete, doesn't move the molecule tests yet) PoC: https://github.com/evrardjp/ansible-keepalived/tree/ansible-2.10-test . I am not motivated to merge this now, as it will effectively break old versions of ansible.

evrardjp commented 3 years ago

Thx for your quick answer

np, my pleasure!