Good morning,
Would you guys help me to understand how to get the Ansible correct version in the playbook?
I have newest Ansible:
(ansible) poe@lime:~$ pip3 freeze | grep ansible
ansible==4.6.0
ansible-core==2.11.5
(ansible) poe@lime:~$
But ansible_version
displays core version instead of ansible:
(ansible) poe@lime:~$ ansible localhost -m debug -a ‘var=ansible_version.full’
[WARNING]: No inventory was parsed, only implicit localhost is available
localhost | SUCCESS => {
“ansible_version.full”: “2.11.5”
}
Why is that so?
The same with ansible --version
:
(ansible) poe@lime:~$ ansible --version | head -1
ansible [core 2.11.5]
The only command I’ve found which showing Ansible (not core) version instead is:
(ansible) poe@lime:~$ python -c ‘from ansible_collections.ansible_release import ansible_version; print(ansible_version)’
4.6.0
So the question is, is this expected? I mean, writing a playbook, I’d like to make sure that Ansible 4.6 is used (or not older). But ansible_version
returns ansible core version - is something I should rely on instead? What’s going on here?
Best,
Piotr Kowalczyk