ansibleworkflowansible-tower

Ansible Tower workflow pause execution


Is there a way in Ansible tower to pause the workflow template execution and wait for the user to provide some kind of input like "approved" or "reject" after completion of a job template and then proceed with the next job template?

I am trying to build a workflow which will have 5 job templates but I want the execution to pause and wait for user input once the second job template execution is successful. Once the user input approved or reject then it should proceed with the third job template execution.

Please let me know if anyone has implemented any such workflow.

Thanks in advance.


Solution

  • One alternative approach I found is using 'wait_for' module. We can create a text file in a host which you have access to and 'wait_for' specific text to be present in the file before continuing.

    You can create a job template with the playbook as follows and include in the workflow template wherever you need to wait.

    - name: Wait until the string "approved" is in the file /tmp/foo before continuing
      wait_for:
        path: /tmp/foo
        search_regex: approved
    

    When the tower workflow waits, you can login to the host and change the text to 'approved'

    Documentation