ansible/awx

Inventory sources - Overwrite vars doesn't account for removed vars

开放

#16,139 创建于 2025年10月17日

 (1 条评论) (0 个反应) (0 位负责人)Python (3,333 个派生)batch import
communityhelp wantedtype:bug

仓库指标

星标
 (13,071 个星标)
PR 合并指标
 (平均合并 24天 6小时) (30 天内合并 30 个 PR)

描述

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

Vars that get removed from an external inventory source don't get removed in the AWX host facts, even if 'Overwrite' and 'Overwrite variables' is set.

While usually not the biggest deal, in this case we had defined ansible_python_interpreter at the host level as a temporary workaround, but after removing this from the project inventory AWX itself keeps trying to use the old python interpreter.

If a var is no longer defined, it should get removed from the host facts in AWX (especially if it's a magic var)

AWX version

24.6.1

Select the relevant components

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

Installation method

kubernetes

Modifications

no

Ansible version

No response

Operating system

No response

Web browser

No response

Steps to reproduce

  1. Create SCM project
  2. Create Inventory, sourcing the SCM project (Overwrite + Overwrite variables checked)
  3. Sync inventory, run playbook, etc.
  4. Update SCM project inventory to remove a variable that was defined in host_vars
  5. Sync project/inventory, run playbook, etc.

Expected results

A variable that has been removed from the inventory source(s) should get removed from the AWX host facts, especially in the case of a magic var / ansible_*

Actual results

The old variable remains in the AWX host facts

Additional information

No response

贡献者指南