Ansible: The Python 2 bindings for rpm are needed for this module

Ansible logó
Probléma: fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "The Python 2 bindings for rpm are needed for this module. If you require Python 3 support use the `dnf` Ansible module instead.. The Python 2 yum module is needed for this module. If you require Python 3 support use the `dnf` Ansible module instead."}

A 2.8-as Ansible alapértelmezetten a Python 3-as verziójával próbál futni (mivel ugye a 2.x támogatása hamarosan véget ér). Azonban a 3-as Python verzióhoz nem érhető el a yum modul, a javasolt dnf modul pedig nem használható CentOS 7-en mivel ott még yum van.

Megoldás: Átállítani az Ansible alapértelmezetten használt Python változatát a 2-esre. Szomorú. Ezt két módon is megteheted:
Vagy a host definíciós állományban így:

[szekció]
127.0.0.1 ansible_python_interpreter: /usr/bin/python2.7

Vagy a változókat tartalmazó fájlodban, illetve akár az adott playbook változóihoz hozzáadva:

ansible_python_interpreter: /usr/bin/python2.7