ansible/awx

Allow force for inventory source synchronisation

Open

#15879 opened on Mar 10, 2025

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Python (13,071 stars) (3,333 forks)batch import
communityhelp wantedtype:enhancement

Description

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.

Feature type

New Feature

Feature Summary

We are running into an issue where inventory source syncrhonisation misses an inventory update. Roughly speaking, the series of events are:

  • trigger job template that syncs inventory source
  • This starts inventory source syncrhonisation
  • While this is happening, trigger job template again with an updated inventory

Depending on the exact timing, this second update will not run an inventory source sync as one is already running. However, this means that the second job template run has an out-of-date inventory.

Looking at the source code, it seems that there is no obvious way to force an inventory sync on every run. I had hoped that one could do something like set update_cache_timeout to -1 or something like that, but it appears that it only accepts positive integers.

Select the relevant components

  • UI
  • API
  • Docs
  • Collection
  • CLI
  • Other

Steps to reproduce

This is a bit difficult to describe, as it depends a bit on timing things correctly. But roughly speaking:

  • Create a job template that uses an inventory that has a source that takes some amount of time to fetch
  • Trigger the job template with the inventory source in one state
  • Before the inventory sync is finished, trigger the job template again in such a way that the inventory is expected to be different

The second sync will not happen, meaning that the secon job template runs with an incorrect inventory.

Current results

The second run uses an out-of-date inventory.

Sugested feature result

Allow somone to specify that the inventory sync happens on every single run

Additional information

No response

Contributor guide