Skip to content

Conversation

@francoriba
Copy link

@francoriba francoriba commented Nov 24, 2025

Add device_instances for sharing target files

Labs with multiple devices of the same model (e.g., 3x Belkin RT3200) had to duplicate target files or hardcode lab-specific configs, creating maintenance overhead.

Solution

Use device_instances in labnet.yaml to map multiple physical devices to a single target file:

labs:
  labgrid-example:
    devices:
      - linksys_e8450
    device_instances:
      linksys_e8450:
        - device_1
        - device_2
        - device_3

Creates 3 places, all using targets/linksys_e8450.yaml. Device-specific config (serial, IP, power) stays in exporter.

Key change

Automatic resolution: Setting LG_PLACE=labgrid-example-device_1 automatically resolves to LG_ENV=targets/linksys_e8450.yaml without any manual config needed.

Changes

  • tests/conftest.py: Auto-resolution logic
  • ansible/files/coordinator/places.yaml.j2: Template support
  • docs/sharing-target-files.md: Full documentation
  • README.md: Usage notes

Backward Compatible

Existing configs without device_instances would continue to work unchanged.

francoriba and others added 4 commits November 24, 2025 16:49
Signed-off-by: Franco <franco.riba@mi.unc.edu.ar>
Signed-off-by: Franco <franco.riba@mi.unc.edu.ar>
Signed-off-by: Franco <franco.riba@mi.unc.edu.ar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant