feat: add device_instances for target file sharing #202
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_instancesinlabnet.yamlto map multiple physical devices to a single target file: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_1automatically resolves toLG_ENV=targets/linksys_e8450.yamlwithout any manual config needed.Changes
tests/conftest.py: Auto-resolution logicansible/files/coordinator/places.yaml.j2: Template supportdocs/sharing-target-files.md: Full documentationREADME.md: Usage notesBackward Compatible
Existing configs without
device_instanceswould continue to work unchanged.