Building Ansible - linux-on-ibm-z/docs GitHub Wiki

Building Ansible

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

  • RHEL (8.6, 8.8, 8.9) have 8.3.0
  • RHEL (9.0, 9.2, 9.3) have 7.7.0
  • SLES 12 SP5 has 2.8.1
  • SLES 15 SP5 have 2.9.27
  • Ubuntu 20.04 has 2.9.6
  • Ubuntu 22.04 has 2.10.8
  • Ubuntu 23.10 has 7.7.0

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

  • RHEL (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)
  • SLES (12 SP5, 15 SP5)
  • Ubuntu (20.04, 22.04, 23.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(v9.4.0) was verified at the time of creation of these instructions

Step 1: Install dependencies

  • RHEL (7.8, 7.9)

     sudo yum install -y gcc openssl-devel
     export LANG="en_US.UTF-8"
     export LC_ALL=en_US.UTF-8
    
  • RHEL (8.6, 8.8, 8.9, 9.0, 9.2, 9.3)

     sudo yum install -y python3.11-devel python3.11-pip gcc openssl-devel
    
  • SLES 12 SP5

    sudo zypper install -y openssl-devel gcc make gzip glibc-locale
    export LANG="en_US.UTF-8"
    export LC_ALL=en_US.UTF-8
    
  • SLES 15 SP5

    sudo zypper install -y gcc make openssl-devel wget glibc-locale
    export LANG="en_US.UTF-8"
    export LC_ALL=en_US.UTF-8
    
  • Ubuntu (20.04, 22.04, 23.10)

    sudo apt update
    sudo apt install -y wget
    
  • Install Python version 3.12.x (Ubuntu, RHEL 7.x, SLES)

    • Instructions for building Python 3.12.x can be found here

Step 2: Install Ansible

pip3 install cryptography==3.3.2 # For all distros except RHEL 8.x and 9.x
python3.11 -m pip install cryptography==3.3.2 # For RHEL 8.x and 9.x

pip3 install ansible==9.4.0 # For all distros except RHEL 8.x and 9.x      
python3.11 -m pip install ansible==9.4.0 # For RHEL 8.x, 9.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 ....

Step 3: Verification (Optional)

Follow the official guide given here to verify the installation.

References