Closed ivarmu closed 1 year ago
This does seem to be a failure of the module, as it is erroring in the module, it's hard to tell why it is failing though, what happens when you do a search for a name on the api for that instance group https://github.com/ansible/awx/blob/ba99ddfd822ed50b7e58543b48e9f6126042db23/awx_collection/plugins/modules/schedule.py#LL299C21-L299C21
This does seem to be a failure of the module, as it is erroring in the module, it's hard to tell why it is failing though, what happens when you do a search for a name on the api for that instance group https://github.com/ansible/awx/blob/ba99ddfd822ed50b7e58543b48e9f6126042db23/awx_collection/plugins/modules/schedule.py#LL299C21-L299C21
It returns correctly the instance_group
information:
Endpoint: api/v2/instance_groups/?name=myinstancegroup
The problem is that the data sent to the instance_group
endpoint includes information for the organization, but an instance group doesn't belong to any organization... Similarly, the execution environments can have or not (globally available) an organization associated.
I've opened the PR https://github.com/ansible/awx/pull/14223 ...
The PR has been merged. Will be solved whith the next AWX release.
Summary
instance_groups
are specified in the input schedule, the Schedule role fails to get the specified instance groupexecution_environment
is specified in the input schedule, the Schedule role fails to get the specified execution_environmentIssue Type
Ansible, Collection, Controller details
OS / ENVIRONMENT
RHEL9
Desired Behavior
The input values exists in the controller, so they should be successfully located by the Schedules role.
Actual Behavior
Please give some details of what is actually happening. Include a minimum complete verifiable example with:
name: Schedules dispatch Test hosts: all connection: local gather_facts: false vars: controller_username: "{{ vault_controller_username | default(lookup('env', 'CONTROLLER_USERNAME')) }}" controller_password: "{{ vault_controller_password | default(lookup('env', 'CONTROLLER_PASSWORD')) }}" controller_hostname: "{{ vault_controller_hostname | default(lookup('env', 'CONTROLLER_HOST')) }}" controller_validate_certs: "{{ vault_controller_validate_certs | default(lookup('env', 'CONTROLLER_VERIFY_SSL')) }}"
pre_tasks:
name: "Setup authentication (block)"
no_log: "{{ controller_configuration_filetree_create_secure_logging }}"
when: controller_oauthtoken is not defined tags:
always block:
name: "Get the Authentication Token for the future requests" ansible.builtin.uri: url: "https://{{ controller_hostname }}/api/v2/tokens/" user: "{{ controller_username }}" password: "{{ controller_password }}" method: POST force_basic_auth: true validate_certs: "{{ controller_validate_certs }}" status_code: 201 register: authtoken_res
name: "Set the oauth token to be used since now" ansible.builtin.set_fact: controller_oauthtoken: "{{ authtoken_res.json.token }}" controller_oauthtoken_url: "{{ authtoken_res.json.url }}"
roles:
post_tasks:
Instance groups exported from the Controller:
STEPS TO REPRODUCE
Shown above.