# Warning in Ansible for Rocky but not for RHEL

**URL:** <https://forums.rockylinux.org/t/warning-in-ansible-for-rocky-but-not-for-rhel/5102>\
**Category:** Rocky Linux Help & Support\
**Created:** [January 13, 2022, 6:17am UTC](https://forums.rockylinux.org/t/warning-in-ansible-for-rocky-but-not-for-rhel/5102 "2022-01-13T06:17:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lee](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/lee/32/807_2.png) [@lee](https://forums.rockylinux.org/u/lee)\
**Post date:** [January 13, 2022, 6:17am UTC](https://forums.rockylinux.org/t/warning-in-ansible-for-rocky-but-not-for-rhel/5102/1 "2022-01-13T06:17:39Z")

</div>

Hi,

I get the following warning in Rocky Linux 8.5 hosts, but not in RHEL 8.5 hosts, during gather facts of Ansible playbook.

* * *

## [WARNING]: Platform linux on host myhostname is using the discovered Python interpreter at /usr/bin/python3.9, but future installation of another Python interpreter could change the meaning of that path. See [https://docs.ansible.com/ansible-](https://docs.ansible.com/ansible-) core/2.12/reference\_appendices/interpreter\_discovery.html for more information.

Why is this?

---

<div class="post-metadata">

**Author:** ![StopMotionCuber](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@StopMotionCuber](https://forums.rockylinux.org/u/StopMotionCuber)\
**Post date:** [January 13, 2022, 10:18am UTC](https://forums.rockylinux.org/t/warning-in-ansible-for-rocky-but-not-for-rhel/5102/2 "2022-01-13T10:18:47Z")

</div>

The problem is that under certain circumstances (Python \> 3.6 installed) the platform detects that it is running on rocky, which was not hardcoded into ansible. I submitted a PR [upstream](https://github.com/ansible/ansible/pull/76728) which fixes this issue, should land in ansible 2.13

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [January 13, 2022, 10:39am UTC](https://forums.rockylinux.org/t/warning-in-ansible-for-rocky-but-not-for-rhel/5102/3 "2022-01-13T10:39:31Z")

</div>

One does get the warning in AlmaLinux too – with Ansible 2.9 packaged by CentOS SIG and with only the platform\_python (3.6) installed.

EL8 has semi-hidden platform\_python, which will remain version 3.6 for the life of RHEL 8. System tools, like ‘dnf’ do use that Python.  
On (minimal) install no Python is installed for the users. There are multiple streams available. The version 3.6 for users merely uses the platform\_python; the other versions supply binaries.

On RHEL Ansible is presumably fixed to use the platform\_python. On “unknown” distros it takes “first found” Python. Since that search result could change if different Python stream is installed, the behaviour of Ansible could be affected. Hence the warning?

---

<div class="post-metadata">

**Author:** ![lee](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/lee/32/807_2.png) [@lee](https://forums.rockylinux.org/u/lee)\
**Post date:** [January 17, 2022, 5:38am UTC](https://forums.rockylinux.org/t/warning-in-ansible-for-rocky-but-not-for-rhel/5102/4 "2022-01-17T05:38:02Z")

</div>

Thanks for the explanation and the PR. 👍

---

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [August 24, 2023, 4:53am UTC](https://forums.rockylinux.org/t/warning-in-ansible-for-rocky-but-not-for-rhel/5102/5 "2023-08-24T04:53:35Z")

</div>


