Default answers for a job template survey is not working when it is called in a workflow execution

Solution Verified - Updated -

Environment

  • Ansible Automation Platform 2.x

Issue

  • A job template that has a survey set with the default answers is executed successfully in stand alone mode but it fails when it is executed in a workflow.

Resolution

  • Use the following steps to pass the default answers correctly in the workflow:

    1. Delete the job template from the workflow visualizer.
    2. (Optional step) Check the default answers in the survey of the job template. Save.
    3. Add the job template in the workflow now and save.

Note : Delete the job template from the workflow every time the default answers in the survey are modified. Add it back to the workflow after modifying the default answers.

Root Cause

  • Workflow is not picking up the modified value of default answers in the survey of the job template.

Diagnostic Steps

  • Created a playbook to print variables {{ server name }} and {{ password }}

  • Created a job template 1. Added a survey and a default answer to the question.
    output from the job template: "msg": "This is the node-3 and this is the Password1",

  • Created workflow 1 using the template above.
    output from the workflow using the job template: "msg": "This is the node-3 and this is the Password1",

  • Modified the value of the default answers in the survey of the job template 1
    output from the job template: "msg": "This is the node-2 and this is the Password2",

  • Run the workflow containing template 1 without any modification
    output from the workflow using the job template: "msg": "This is the node-3 and this is the Password1"

The variables are not updated when the default answer in the survey of template 1 is modified.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments