Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove execution_environment selection when empty value is provi… #15603

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

rahulsamant37
Copy link

@rahulsamant37 rahulsamant37 commented Oct 26, 2024

…ded (#14841)

SUMMARY

When a job template has an Execution Environment selected, but the playbook specifies execution_environment: "", the selected environment should be removed to avoid incorrect configurations.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • Collection
AWX VERSION
23.2.0

ADDITIONAL INFORMATION
Steps to reproduce:

  • name: Get all templates from AAP
    ansible.controller.export:
    job_templates: 'all'
    register: aap_templates

  • debug:
    var: aap_templates.assets.job_templates[0].execution_environment

  • set_fact:
    ee: ""

  • name: Create templates
    ansible.controller.job_template:
    name: "{{ aap_templates.assets.job_templates[0].name }}"
    execution_environment: "{{ ee }}"

Expected Results:

markdown
TASK [Create templates] ************************************************************************************************************************************
changed: [localhost]

Actual Results:

markdown
Copy code
TASK [Get all templates from AAP] **************************************************************************************************************************
ok: [localhost]

TASK [debug] ***********************************************************************************************************************************************
ok: [localhost] => {
"aap_templates.assets.job_templates[0].execution_environment": {
"name": "Automation Hub Default execution environment",
"type": "execution_environment"
}
}

TASK [set_fact] ********************************************************************************************************************************************
ok: [localhost]

TASK [Create templates] ************************************************************************************************************************************
ok: [localhost]

@github-actions github-actions bot added component:awx_collection issues related to the collection for controlling AWX community labels Oct 26, 2024
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community component:awx_collection issues related to the collection for controlling AWX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant