Red Hat is proud to announce that Ansible supports managing Red Hat Enterprise Linux 8 Beta hosts. Before you can manage Red Hat Enterprise Linux 8 Beta nodes with Ansible 2.7, though, you need to set the appropriate python interpreter. Ansible allows you to manage a huge range of hosts and devices, from legacy systems to beta-release testing platforms, by working with both Python 2 and Python 3. However, with Ansible 2.7 managing Red Hat Enterprise Linux 8 Beta, you must define which Python to use. When Ansible 2.8 is released, we plan for Ansible to automatically discover the correct Python to use on Red Hat Enterprise Linux 8 Beta hosts.
Setting the Python interpreter on Red Hat Enterprise Linux 8 Beta managed nodes
You can define the python interpreter Ansible should use on your Red Hat Enterprise Linux 8 Beta nodes with an inventory host_var, a group_var, a play, or an ad-hoc command. You must do this on every Red Hat Enterprise Linux 8 node just as you would for any Python3 enabled host. To set the python interpreter in your inventory with a host_var:
[RHEL8hosts]
RHEL8.example.com ansible_python_interpreter=/usr/libexec/platform-pythonThis example directs Ansible to use the Red Hat Enterprise Linux 8 Platform Python, which is meant for systems-level tooling, rather than the standard python interpreter. Since Ansible will be automating systems-level tasks, this will be our target.
Once you’ve set the correct python interpreter, you can run Ansible to manage this Red Hat Enterprise Linux 8 Beta system:
ansible RHEL8hosts -m yum -a “name=bash state=installed”In Ansible 2.8, Ansible will automatically discover the best ansible_python_interpreter definition, and you will not need to set the python interpreter like this.
Testing Red Hat Enterprise Linux 8 Beta as an Ansible control node
Ansible Engine does not support using a Red Hat Enterprise Linux 8 Beta system as a control node in a production setting. However, you may wish to test this scenario locally to prepare for the eventual Red Hat Enterprise Linux 8 GA release. Note that Red Hat Ansible Engine is planning to support Red Hat Enterprise Linux 8 upon Ansible Engine 2.8 GA release, but at this time we’ll be using the upstream Ansible open source project to test our Red Hat Enterprise Linux 8 Beta control node.
Do not use the system-level Red Hat Enterprise Linux 8 Platform Python for control node actions. Instead, install a user-level Python to run Ansible commands, roles, and playbooks from a Red Hat Enterprise Linux 8 Beta system. We recommend installing Python 3.6 from an Ansible Upstream Project package via PyPI.
On the Red Hat Enterprise Linux 8 Beta host you plan to test as a control node, run the following command either as root or with sudo permissions:
yum -y module install python36This command installs the Python 3.6 AppStream, which allows you to operate on the same version of Python as Platform Python but in a user-facing context. This is important for long-term compatibility but also for the flexibility to modify our environment without impacting the core Red Hat Enterprise Linux 8 Beta Platform.
Once you have Python 3.6 installed, install Ansible as a non-root user (recommended for installing PyPI content).
pip3 install --user ansibleConfirm that your Ansible installation is working with a quick test on localhost, using your Red Hat Enterprise Linux 8 Beta machine as both the control node and a managed node:
ansible localhost -m setup -e ansible_python_interpreter=/usr/libexec/platform-pythonThis ad-hoc command sets the ansible_python_interpreter on your Red Hat Enterprise Linux 8 Beta control node. At this point you can run Ansible on your Red Hat Enterprise Linux 8 Beta system just as you normally would from a standard install using pip.
When testing a Red Hat Enterprise Linux 8 Beta system as an Ansible control node and running against localhost, you use two different Python executables: the Python 3.6 package with Ansible Engine and the Platform Python with the modules kicked off by your ad-hoc task or playbook.
What Next? Questions? Comments? Feedback?
The Ansible Open Source Community is adapting to the release of Red Hat Enterprise Linux 8 Beta in the open, just as we do with all changes in technology. If you have questions, comments, or feedback about Ansible + Red Hat Enterprise Linux 8 Beta or anything else that interests you, we’d love to hear from you.
Sobre el autor
Más como éste
Slash VM provisioning time on Red Hat Openshift Virtualization using Red Hat Ansible Automation Platform
Red Hat Ansible Automation Platform: Measuring Business Impact with Dashboard and Analytics
Technically Speaking | Platform engineering for AI agents
Technically Speaking | Driving healthcare discoveries with AI
Navegar por canal
Automatización
Las últimas novedades en la automatización de la TI para los equipos, la tecnología y los entornos
Inteligencia artificial
Descubra las actualizaciones en las plataformas que permiten a los clientes ejecutar cargas de trabajo de inteligecia artificial en cualquier lugar
Nube híbrida abierta
Vea como construimos un futuro flexible con la nube híbrida
Seguridad
Vea las últimas novedades sobre cómo reducimos los riesgos en entornos y tecnologías
Edge computing
Conozca las actualizaciones en las plataformas que simplifican las operaciones en el edge
Infraestructura
Vea las últimas novedades sobre la plataforma Linux empresarial líder en el mundo
Aplicaciones
Conozca nuestras soluciones para abordar los desafíos más complejos de las aplicaciones
Virtualización
El futuro de la virtualización empresarial para tus cargas de trabajo locales o en la nube