Skip to content

[Bug]: Running inventory plugin with facts caching crashes #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
afonso360 opened this issue Jan 14, 2025 · 0 comments
Open

[Bug]: Running inventory plugin with facts caching crashes #32

afonso360 opened this issue Jan 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@afonso360
Copy link

What happened?

When running the inventory plugin without any facts cache enabled, everything works as expected.

When I enable facts_caching the plugin fails with:

[WARNING]:  * Failed to parse /Users/afonsobordado/git/nortech/ansible/inventory/netbird.yml with auto plugin: Peer.__init__() missing 1 required positional argument: 'data'

How to reproduce the bug

  1. Run the inventory without facts caching: ansible-inventory -i ./inventory/netbird.yml --list (this works)
  2. Add the following to ansible.cfg
fact_caching = jsonfile
fact_caching_connection = /tmp/facts_cache
fact_caching_timeout = 86400
  1. Run the inventory again: ansible-inventory -i ./inventory/netbird.yml --list
    This now fails with:
[WARNING]:  * Failed to parse (...)/inventory/netbird.yml with auto plugin: Peer.__init__() missing 1 required positional argument: 'data'

Package Version

0.2.0

Python Version

3.13.1

Ansible Version

2.18.1

Which operating systems does with happen with?

macOS

Notes

It looks like on this line when repopulating the peers from cache in never initializes the data field

@afonso360 afonso360 added the bug Something isn't working label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant