Skip to main content
Version: 2024.1

Test Ansible Playbooks on the Linux Execution Server

Before running the playbook in an App, it is recommended to test it manually. To do that, follow these steps:

  1. On a Linux Execution Server machine, access the /etc/ansible/ansible.cfg file and uncomment the line:

    host_key_checking = False

    Notes
    • At runtime, the Ansible driver creates a local ansible.cfg file and adds the above key.
    • In addition, this local ansible.cfg takes priority over all other config files. See this Ansible documentation page for details about Ansible config file hierarchies.
  2. Create a folder that will be the root of your test. This folder will contain the Ansible playbook as well as any additional folders and files required by the playbook.

  3. Add an inventory file with hosts and their groups (optional) for testing.

    Discovery Dialog

  4. Add one or more playbook files.

    note

    If you plan on using several playbook files in the App, make sure the main one is named site.yml.

    Discovery Dialog

  5. (Optional) Add a "roles” folder.

    Discovery Dialog

  6. (Optional) Populate it with the desired roles.

    Discovery Dialog

  7. Test the playbook by running ansible-playbook –i <InventoryFile> <MainPlaybookFile.yml>. For some sample playbooks, see Ansible Playbook Examples.

    Discovery Dialog

  8. Once you are done developing your playbook, zip the playbook files along with the roles folder, upload it to a repository, and set the URL in the App template, as explained in Add the Playbook to an App.