11.1 Preparing your Ansible Nodes

You must ensure that the Ansible nodes are set up appropriately before you begin with the deployment process. The prerequisites on the control and managed nodes are different from each other. The following figure provides a high-level view on how you must prepare your control and managed nodes.

11.1.1 Preparing Your Control Node

Ensure that you perform the following tasks on the control node:

  • Ensure Python3 or later is installed. To check for the Python version, navigate to the /usr/bin/ directory and run the following command:

    For example:

    python3 --version

    For more information, see Python documentation.

  • Ensure pip is installed. To check for the pip version, run the following command:

    For example:

    pip --version

    Ensure that pip has been installed through the Python3 or later version that you installed earlier.

    For more information, see Python documentation.

  • Install Ansible using the pip that you installed earlier. Ensure that you install Ansible version 2.10.5 or later.

    For example:

    pip install ansible

    For more information, see Ansible documentation.

  • Ensure that the managed nodes are reachable from the control node. For example, you can use ping or any relevant mechanisms to ensure the nodes are reachable.

  • Ensure that you establish a password-less authentication between the control node and all the managed nodes in your deployment. Perform the following steps:

    1. Generate a SSH key.

      For example:

      ssh-keygen

    2. Do not enter any password and proceed with the key generation.

    3. Run the following command to enable password-less authentication to the managed node:

      ssh-copy-id root@<FQDN or IP Address of the managed node>

      For example:

      ssh-copy-id root@192.168.0.25

    4. Specify the password of the managed node.

      For example, password.

    5. Test the connection to the managed node:

      ssh 'root@<FQDN or IP Address of the managed node>'

      For example:

      ssh 'root@<192.168.0.25>'

11.1.2 Preparing Your Managed Nodes

Ensure that you perform the following tasks on all the managed nodes:

  • Ensure Python3 or later is installed. To check for the Python version, navigate to the /usr/bin/ directory and run the following command:

    For example:

    python3 --version

    For more information, see Python documentation.

  • Ensure pip is installed. To check for the pip version, run the following command:

    For example:

    pip --version

    Ensure that pip has been installed through the Python3 or later version that you installed earlier.

    For more information, see Python documentation.

  • Install Docker. Ensure that the Docker version is 20.10.6 or later. For more information, see Docker documentation.

  • Install Docker python module using pip:

    For example:

    pip install docker-py

  • Create a shared directory. For more information, see Managing Container Volume Data.

  • Create a network for establishing communication between containers. For example, to create an overlay network, see Setting Up an Overlay Network.