Support of Multiple Ansible Versions
  • 06 Sep 2024
  • Dark
    Light
  • PDF

Support of Multiple Ansible Versions

  • Dark
    Light
  • PDF

Article summary

Customers are now able to optionally select which version of Ansible to use to execute a particular Ansible Playbook in IAG. Virtual environments ("VENV") are able to associate any Ansible Playbook in IAG with an existing virtual environment. Any Ansible Playbook not associated with a virtual environment will execute in the default version of Ansible configured for IAG.

Activating and Installing Ansible VENV

Using a Terminal, run the lines of code below and choose the version of Ansible needed (in the example Ansible 2.9.0 is shown).

Place a new virtual environment in the Ansible virtual environment directory:

/opt/automation-gateway/ansible_venvs/

Activate the environment and install the Ansible version of your choice:

python3 -m venv /opt/automation-gateway/ansible_venvs/ansible2.9
source /opt/automation-gateway/ansible_venvs/ansible2.9/bin/activate
pip install ansible==2.9.0

Choosing the Ansible VENV Version to Use

In Automation Gateway, navigate to Ansible and then click on Playbooks to open the menu and select the appropriate Playbook.

From the Parameters tab, open the Select an Ansible Venv dropdown to display the available versions of Ansible to use.

Figure 1: Select an Ansible Venv
01_a_version_4_3

Once you have selected the Ansible version, click the save (disk) icon to automatically set the decorator.

Figure 2: Set as Decorator
02_a_version_4_3

Ansible Configuration

After setting the decorator, navigate to the Ansible Configuration in Automation Gateway to verify the Ansible Venv checkbox is selected and the Ansible Venv Path is shown.

Figure 3: Check Ansible Venv
03_a_version_4_3

If Ansible Venv is not checked, the line to Select an Ansible Venv in the Parameters tab of the Playbook (Figure 1) will be grayed out and unavailable for use.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.