Skip to content

Building Ansible

linuxonz edited this page Dec 20, 2024 · 107 revisions

Building Ansible

Below versions of Ansible are available in respective distributions at the time of creation of these build instructions:

  • RHEL (8.8, 8.10) have 9.2.0
  • RHEL (9.2, 9.4, 9.5) have 7.7.0
  • SLES 15 SP6 has 9.4.0
  • Ubuntu 20.04 has 2.9.6
  • Ubuntu 22.04 has 2.10.8
  • Ubuntu (24.04, 24.10) have 9.2.0

The instructions provided below specify the steps to build Ansible latest version on Linux on IBM Z for the following distributions:

  • RHEL (8.8, 8.10, 9.2, 9.4, 9.5)
  • SLES 15 SP6
  • Ubuntu (20.04, 22.04, 24.04, 24.10)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Note: Ansible(v11.1.0) was verified at the time of creation of these instructions

1. Install dependencies

  • RHEL (8.8, 8.10, 9.2, 9.4, 9.5)

     sudo yum install -y python3.12-devel python3.12-pip gcc openssl-devel wget
  • SLES 15 SP6

    sudo zypper install -y python312-devel python312-pip gcc openssl-devel wget
  • Ubuntu (20.04, 22.04)

    sudo apt update
    sudo apt install -y wget
  • Ubuntu (24.04, 24.10)

    sudo apt-get update
    sudo apt install -y curl wget python3 python3-pip pipx pkg-config openssl libssl-dev
  • Install Python version 3.x (Ubuntu 20.04, 22.04)

    • Instructions for building Python 3.x can be found here
  • Install Rust on Ubuntu 24.x

    cd $SOURCE_ROOT
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y
    export PATH="$HOME/.cargo/bin:$PATH"

2. Install Ansible

pip3 install cryptography==3.3.2 				# For all distros except RHEL distros and Ubuntu 24.x
python3.12 -m pip install cryptography==3.3.2 			# For RHEL distros

pip3 install ansible==11.1.0 					# For all distros except RHEL distros and Ubuntu 24.x
python3.12 -m pip install ansible==11.1.0 --use-pep517 		# For RHEL distros
pipx install --include-deps ansible==11.1.0			# For Ubuntu 24.x
pipx ensurepath							# For Ubuntu 24.x
source ~/.bashrc 						# For Ubuntu 24.x

Note: In case of an error sudo: pip3: command not found on RHEL or SLES, run above command as sudo -H env PATH=$PATH pip3 install ... instead of sudo pip3 install ....

3. Verification (Optional)

Follow the official guide given here to verify the installation.

References

Clone this wiki locally