Uploaded image for project: 'Common Controller SDK'
  1. Common Controller SDK
  2. CCSDK-2112

AWX does support fetching workflows by name; env_vars required

XMLWordPrintable

      The node type ComponentRemoteAnsibleExecutor has the following as one of its inputs:

                  "workflow-job-template-id": {
                    "description": "Primary key (name not supported) of the workflow job template to launch new job.",
                    "required": false,
                    "type": "string"
                  }, 

      However (after a lot of digging), it turns out names are supported after all, with a catch that the name of the workflow job template is composed of '{name}++{organization.name}'. Given that organization is often empty, one just ends up with the two plus signs at the end.

      Once that is known, it's obvious to see in the AWX API responses, too:

      bash-4.3# curl -u admin:password 'http://awxweb:8052/api/v2/workflow_job_templates/deprovision++/' 2>/dev/null  | jq .related.named_url
      "/api/v2/workflow_job_templates/deprovision++/"

      With the ++-name entered as input to the workflow id input, the workflow does get executed properly.

      Thus, the node type can be updated with corrected information for running workflow job templates by name; possibly just in the description, if compatibility issues are a concern.

      A second issue with the definitions is that extra_vars is apparently required (setting to empty string worked):

      "status": {
                  "code": 500,
                  "errorMessage": "error : ansible-command-logs : Execution of job template 12 could not be started for requestId 1. (Response: {\"extra_vars\":[\"This field may not be null.\"]}) ",
                  "eventType": "EVENT_COMPONENT_FAILURE",
                  "message": "failure",
                  "timestamp": "2020-02-21T15:15:43.886Z"
      }

      Setting assignee to Serge Simard as he's implemented the feature, and likely knows what is to be done here.

            agileone agileone
            mirlos mirlos
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: