Skip to content

[DOC] Describe differences between Ansible group variables and group/node data #1010

@ipspace

Description

@ipspace

Describe the bug

When setting an Ansible variable in a custom group, Ansible inventory correctly inherits the changed setting while the adjust_inventory_host does not.

To Reproduce

See #1007 for details.

Expected behavior

ansible-inventory and netlab connect should get the same idea what ansible_connection variable value should be.

Lab topology

provider: clab

groups:
  linux_ssh:
    members: [ h ]
    vars:
      ansible_connection: ssh

nodes:
  h:
    device: linux

Version

All netlab versions

Additional context

There are two ways to solve this challenge:

  1. Consider custom groups and their vars settings in adjust_inventory_host
  2. Do full inheritance before storing the data in the snapshot file

(1) might seem more complex, but we'd have to have the code to do the inheritance somewhere anyway, so maybe it doesn't matter that much. (2) would result in extra data in netlab inspect or netlab create --output yaml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions