Skip to content

Access inventories not currently loaded. #529

@gnat

Description

@gnat

Is your feature request related to a problem? Please describe.
There does not seem to be an obvious way to access inventories other than the one pyinfra is currently operating on.

Would be great to be able to access the host list inside of inventories/production.py while running against inventories/staging.py for example.

Useful case 1: Do fancy auto-configuration (firewalls...) easily using host information inside different inventories.
Useful case 2: Can test scripts using @local, etc. easier.

Describe the solution you'd like
Be able to reach data in other inventories in some way, maybe just allow import ..inventories.production ? Unsure what would be the best approach.

Thanks!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLICLI mode specific issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions