# CentOS 7 is end-of-life when using Ansible?

**URL:** <https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [December 17, 2020, 7:57am UTC](https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345 "2020-12-17T07:57:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Onno](https://avatars.discourse-cdn.com/v4/letter/o/dec6dc/32.png) [@Onno](https://forum.ansible.com/u/Onno)\
**Post date:** [December 17, 2020, 7:57am UTC](https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345/1 "2020-12-17T07:57:49Z")

</div>

Hi all,  
I stumbled onto the problem  
If you require Python 3 support use the `dnf` Ansible module instead."

This message baffles me. It has for some time and I do not understand what it implies or means.

My conclusion at this point is that CentOS 7 should be considered end-of-life when using Ansible. I’m very much interested in opinions on this matter.

CentOS 7 has Python 2.7.x and Python 2.7.x is EOF jan 2021.

Now of course you can install Python 3 etc but then you there is that message:

If you require Python 3 support use the `dnf` Ansible module instead."

Most Ansible automation for example on Ansible Galaxy uses the package module. This package module is deprecated for Python 3.

Everywhere package is used, Ansible will barf up that message. On CentOS 7.

You can install dnf etc on CentOS 7, remove yum but this won’t help. The message remains.

Is my understanding correct that CentOS 7 is EOF jan 2020 if you want Python3? Python3 implies CentOS 8 or higher?

---

<div class="post-metadata">

**Author:** ![jean-yves](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jean-yves](https://forum.ansible.com/u/jean-yves)\
**Post date:** [December 17, 2020, 8:14am UTC](https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345/2 "2020-12-17T08:14:59Z")

</div>

Hi,

Statement here could interest you :

[https://docs.ansible.com/ansible/latest/reference\_appendices/python\_3\_support.html](https://docs.ansible.com/ansible/latest/reference_appendices/python_3_support.html)

Regards,

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [December 17, 2020, 2:45pm UTC](https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345/3 "2020-12-17T14:45:15Z")

</div>

We have no current plans of dropping Python 2 support for modules in the near future. With EL 7 EOL scheduled for 2024, it’s possible that we continue python2 support for modules until then.

---

<div class="post-metadata">

**Author:** ![aidewuado](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@aidewuado](https://forum.ansible.com/u/aidewuado)\
**Post date:** [December 17, 2020, 5:59pm UTC](https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345/4 "2020-12-17T17:59:24Z")

</div>

You can update python to v3 in centos7

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [December 17, 2020, 6:11pm UTC](https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345/5 "2020-12-17T18:11:57Z")

</div>

While you can install python3 on CentOS, they do not provide yum or selinux python bindings for Python3. Which makes it not totally useful in the context of many things done via Ansible.

In short, you generally need to use the system python for many operations.

Red Hat, and by extension CentOS will continue supporting Py2.7 even after it is EOL. See [https://access.redhat.com/solutions/4455511](https://access.redhat.com/solutions/4455511)

---

<div class="post-metadata">

**Author:** ![nirik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nirik/32/686_2.png) [@nirik](https://forum.ansible.com/u/nirik)\
**Post date:** [December 17, 2020, 8:38pm UTC](https://forum.ansible.com/t/centos-7-is-end-of-life-when-using-ansible/34345/6 "2020-12-17T20:38:58Z")

</div>

...snip...

> Is my understanding correct that CentOS 7 is EOF jan 2020 if you want  
> Python3? Python3 implies CentOS 8 or higher?

Well, I think it's more nuanced than that. CentOS/RHEL7 now does have  
python3.6 shipped with it, but of course it doesn't have all the modules  
that python2 has there.

If your control host is rhel/centos7 and any of your target hosts are  
rhel/centos7 then yeah, you can't use python3 ansible and the package  
module. (since it requires the python2 yum bindings).

python3 ansible should work for the other cases.. where you have newer  
target hosts, don't use package module, etc.

kevin
