Ansible - Visual Workflow Northbound Integration

You can automate network configurations through Ansible as the Northbound.

To trigger a workflow by creating an Ansible playbook:

  1. Design a workflow.
  2. Connect all workflow tasks and enable the workflow.
  3. To download the Ansible <.zip> file, click icon above the Start task.
  4. Extract the files.
    The downloaded <.zip> folder contains the following files:
    • Ansible_README txt file - This contains the steps to use the downloaded Ansible playbook.
    • <workflowname>.py - Workflow Python file (Ansible executor file)
    • <workflowname>.yaml - Workflow YAML file

    In the above, the Python (.py) file is used as the module executor for the playbook and the YAML file (.yaml) is used as the sample playbook content for triggering the workflow request into AppViewX.

  5. To execute the playbook, copy the Python <.py> file to the Ansible server and move it into the modules directory present in the ansible python module location.
  6. To find out the ansible python module location, execute the ansible --version command in the Ansible Command Line Interface (CLI).
    Here is a sample output for the command:
    ansible 2.4.2.0
      config file = /etc/ansible/ansible.cfg
      configured module search path = u'/home/appviewx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
      ansible python module location = /usr/lib/python2.7/site-packages/ansible
      executable location = /usr/bin/ansible
      python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
    

    In this sample command, the ansible python module location is /usr/lib/python2.7/site-packages/ansible

  7. Copy the YAML file to any of the playbooks location in the Ansible server. For example: /etc/ansible/playbooks
  8. In the YAML file, update the new workflow request details and save the changes.
  9. Execute the YAML playbook file with the Ansible commands - ansible-playbook <workflowname>.yaml