ansible/awx

Empty value in execution_environment should remove selections (ansible.controller.job_template)

Open

#14,841 创建于 2024年2月3日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Python (13,071 star) (3,333 fork)batch import
communitycomponent:awx_collectiongood first issuetype:bug

描述

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • I am NOT reporting a (potential) security vulnerability. (These should be emailed to security@ansible.com instead.)

Bug Summary

When a template has Execution Environment selected but playbook specifies execution_environment = "", the selection in the template should be removed.

AWX version

23.2.0

Select the relevant components

  • UI
  • UI (tech preview)
  • API
  • Docs
  • Collection
  • CLI
  • Other

Installation method

docker development environment

Modifications

no

Ansible version

2.14.2

Operating system

Red Hat Enterprise Linux release 9.1 (Plow)

Web browser

Chrome

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

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

Actual results

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]

Additional information

No response

贡献者指南