Sobes.tech
Middle+

How to start working with Ansible on a machine where Python is not installed?

sobes.tech AI

Answer from AI

Use the Ansible Engine installer. This is a standalone package that includes Python and all necessary dependencies for working with Ansible. Download the installer executable, make it executable, and run it.

# Download the installer (example link)
wget https://releases.ansible.com/ansible-engine/installer/ansible-engine-installer-latest-linux-x86_64.sh

# Make the file executable
chmod +x ansible-engine-installer-latest-linux-x86_64.sh

# Run the installer
./ansible-engine-installer-latest-linux-x86_64.sh --prefix /opt/ansible --symlink

The --prefix /opt/ansible flag specifies the installation directory. The --symlink flag will create symbolic links to Ansible executable files (such as ansible, ansible-playbook) in /usr/local/bin, making them accessible in $PATH.

After installation, you can check the Ansible version:

# Check the installed Ansible version
ansible --version

This method allows deploying Ansible on a system without prior Python installation, as the installer contains it and all necessary libraries.