Skip to main content
Version: 2024.1

Configure Execution Server for Ansible

The first thing you need to do is set up an Execution Server that can execute Ansible configuration management. For this you will need a Linux Execution Server with the following utilities and configurations:

  • Execution Server installed on Linux machine, with the ansible attribute enabled. See Linux Execution Server Installation and Configuration.
  • Python 3.7 (Python 3.9.x is provided out of the box with the Linux Execution Server virtual appliance or script)
  • Ansible 2.9.27
  • pywinrm 0.4.2
  • CentOS sshpass

Indicate Execution Servers that run Ansible

This section explains how to indicate that the Execution Server installation has Ansible installed and therefore can support Ansible operations on Apps.

Notes

To configure an Execution Server using CloudShell Portal:

  1. In the Execution Server machine, log in to CloudShell Portal as administrator.

  2. In the Manage dashboard, click Execution Servers and then select Servers.

  3. In the Servers page, click the Execution Server's name.

    The Attributes window pops up.

  4. Select the Supports Ansible check box to use this Execution Server for Ansible configuration management.

  5. If you have several Execution Servers that support Ansible but want to use this one, see the following section:

    This is recommended for geographically distributed deployments where you want a local Execution Server to perform operations on cloud providers that are physically nearest that Execution Server. For more information, see Managing Public Cloud Apps in Domains or Managing Private Cloud Apps in Domains.

    To set a specific Execution Server for Ansible configuration management:

    1. Select the attribute and specify a value.

    2. Specify the same value on the Execution Server Selector attribute in the cloud provider resource and/or in the Resource Manager Client > Configuration Services > Ansible Configuration service model.

      By default, CloudShell will use the Execution Server defined in the cloud provider resource. If it is not available, CloudShell will use the Execution Server defined in the Ansible Configuration model. Execution Servers specified on the deployed App shell/resource are not used for configuration management.

      note

      You can also configure the designated Ansible Execution Server to perform additional operations, such as running shells or commands.

  6. Click Done.

To configure an Execution Server via command-line:

  1. In the Execution Server machine, run command-line as administrator.

  2. Navigate to the /root/ExecutionServer folder (or opt/ExecutionServer for Linux machines on Azure or AWS).

  3. Run the following command with your details:

    mono QsExecutionServerConsoleConfig.exe /s:localhost /u:admin /p:admin /esn:my_es /ansible /a:"{'Execution Server Selector':'CloudShell domain'}" ***
    AttributeDescription
    /sQuali Server IP address or hostname
    /uCloudShell admin to connect to CloudShell server
    /pCloudShell admin's password
    /esnExecution Server name to register with CloudShell
    /ansibleParameter indicating to Ansible configuration management that this Execution Server supports Ansible operations
    /aAdditional attributes to set on the Execution Server. For example, passing to that option the value {'attributeName1':'attributeValue1', 'attributeName2':'attribauteValue2'} adds two attributes and their values.
    Note that the attributes must have the Execution Server Selector rule.
    Notes
    • If the Execution Server VM does not have an internet connection, make sure the OfflinePackageRepository zip file is extracted to the local PyPi Server repository. For details, see Add the out-of-the-box dependencies package to the local PyPi Server repository.
    • Quali Server must be running when configuring the Execution Server.
    • Depending on your flavor of Linux, you may need to escape parameter values containing special characters with single or double quotes. For example: "admin1234!"

Perform additional configurations on the Execution Server machine

To run Ansible configuration management on this Execution Server, several additional configurations are needed.

To configure the Execution Server to run Ansible:

  1. Install Ansible as globally available command line utility.

    python3 -m pip install ansible
    To install in an offline environment:
    1. Download the offline dependencies from here.

    2. Place them in the Quali Server offline repository:

      C:\Program Files (x86)\QualiSystems\CloudShell\Server\Config\Pypi Server Repository

    3. Run the following command:

      python3 -m pip install ansible --index-url=http://<QUALI_SERVER_IP>:8036/simple --trusted-host <QUALI_SERVER_IP>

      Replace <QUALI_SERVER_IP> with the IP of the machine containing the offline packages.

      index-url tells pip to download from local repo rather than public pypi, and trusted-host says you can trust this local server

  2. Verify install by running:

    ansible --version

    ![](../../Images/Linux2/ansible status.png)

  3. Install pywinrm into same python environment as global Ansible. This library is required by Ansible to connect to Windows Apps.

    python3 -m pip install pywinrm
  4. Install the CentOS sshpass module to allow password authentication to Apps.

    yum install sshpass

Next...

Make sure to Enable WinRM on Windows VMs to Support Configuration Management.