Skip to content

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

@williamtwomey

Description

@williamtwomey

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 [email protected] 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions