ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.11k stars 3.43k forks source link

ansible.controller.workflow_launch tries to access /api/controller/v2/organizations/ when I believe it should be /api/v2/organizations/ #15622

Open matthieup opened 3 weeks ago

matthieup commented 3 weeks ago

Please confirm the following

Bug Summary

I am try to use ansible.controller.workflow_launch with the following parameters:

    - name: "Run on  {{ target }}"
      ansible.controller.workflow_launch:
        #controller_config_file: config_automation.txt
        controller_host: https://automation_host
        validate_certs: false
        name: Workflow-Template-A
        organization: ORGANIZATION_A
        extra_vars:
          target: "{{ target }}"
        wait: true
        controller_username: "user_aap"
        controller_password: "{{ aap_password }}"

However I keep on getting the message from the task:

The requested object could not be found at /api/controller/v2/organizations/

or

The requested object could not be found at /api/controller/v2/workflow_job_templates/.

Trying to access the URL on the controller, it fails, but /api/v2/organizations/ or /api/v2/workflow_job_templates/ ( without the "controller" part) succeeds. So I do believe the URL is wrong.

AWX version

4.5.6

Select the relevant components

Installation method

N/A

Modifications

no

Ansible version

2.15.12

Operating system

Linux

Web browser

Firefox

Steps to reproduce

    - name: "Run on  {{ target }}"
      ansible.controller.workflow_launch:
        #controller_config_file: config_automation.txt
        controller_host: https://automation_host
        validate_certs: false
        name: Workflow-Template-A
        organization: ORGANIZATION_A
        extra_vars:
          target: "{{ target }}"
        wait: true
        controller_username: "user_aap"
        controller_password: "{{ aap_password }}"

Expected results

It should start the workflow I passed in the name: Workflow-Template-A

Actual results

Getting the message:

The requested object could not be found at /api/controller/v2/organizations/

Additional information

No response

matthieup commented 2 weeks ago

After some research, the problem appears at ansible.controller version 4.6.0, and due to OPTIONAL_API_URLPATTERN_PREFIX .