Skip to content

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

@afonso360

Description

@afonso360

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions