Skip to content
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

[Feature]: Inventory - Be able to request only on attribute on a relationship #73

Open
BeArchiTek opened this issue Jun 27, 2024 · 0 comments
Labels
type/feature New feature or request

Comments

@BeArchiTek
Copy link
Contributor

Infrahub version

v0.14.2

Feature type

Change to existing Plugin

Proposed functionality

As a user i would like to be able to fine-tuned the host_vars, for that, I would like to have a finer approach in the Inventory to avoid getting all the attributes of a given related_node if I a interested in only one

Use case

Be able to request only one attribute of a relationship instead of the full object to keep the host_vars cleaner

Example: if you want to get only the ansible_network_os attribute in platform you could do

plugin: opsmill.infrahub.inventory
api_endpoint: "http://localhost:8000"
token: "{{ lookup('ansible.builtin.env', 'INFRAHUB_API_TOKEN') }}"
timeout: 30

strict: false

nodes:
  InfraDevice:
    include:
      - id
      - name
      - platform.ansible_network_os

instead of

plugin: opsmill.infrahub.inventory
api_endpoint: "http://localhost:8000"
token: "{{ lookup('ansible.builtin.env', 'INFRAHUB_API_TOKEN') }}"
timeout: 30

strict: false

nodes:
 InfraDevice:
   include:
     - id
     - name
     - platform

compose:
 platform: platform.ansible_network_os

External dependencies

none

@BeArchiTek BeArchiTek added the type/feature New feature or request label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant