Skip to content

Inventory Export - Add Option to Optimize for Dynamic Inventories (ignore hosts/groups) #16175

@zjleblanc

Description

@zjleblanc

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

By default, if you use the export module, then all child entities (hosts and groups) will also be exported. Since these inventories are dynamic and can be re-populated based on the inventory source configuration, the additional child configurations provide no value. For large inventories, this default behavior can add significant time to the export and downstream import process.

The proposed solution would provide a flag for users to indicate they do not want to export hosts/groups associated to a set of dynamic inventories. Ideally dynamic inventories could be "auto-detected", but an additional parameter representing a list of dynamic inventories to which the flag applies would be sufficient.

Select the relevant components

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

Steps to reproduce

  • Have a Controller instance with at least one Dynamic Inventory which has synced from its source (resulting in an arbitrary, non-zero number of hosts/groups)
  • Implement an export process using the collection module (awx.awx.export)
  • Set the proposed "flag" to true and provide list of dynamic inventories
  • Observe that the Inventory and relevant Inventory Sources are exported, not the hosts/groups.
  • Observe that, in the absence of the flag (or false), the export behavior does not regress and exports all related hosts/groups as it would have previously

Current results

Currently, there is no support for ignoring the hosts/groups associated with a dynamic inventory.

Sugested feature result

Users of the export module would have the option to specify a behavior which ignores the hosts/groups associated with a specified list of dynamic inventories to optimize their import/export processes.

Additional information

I implemented a simplified workaround with a customer by modifying the export module and documented that experiment here:
https://autodotes.com/posts/c3w8Mn7Kpa1ImLlLfJQy

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