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

[Bug]: opsmill.infrahub.inventory Nested include of the same relationship name override other relationship #125

Open
BeArchiTek opened this issue Oct 11, 2024 · 0 comments
Assignees
Labels
type/bug Something isn't working

Comments

@BeArchiTek
Copy link
Contributor

Ansible Infrahub Collection version

v1.2.1

Ansible version

ansible [core 2.14.0]
  config file = /Bearchitek/sandbox/ansible.cfg
  configured module search path = ['/Bearchitek/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Bearchitek/.pyenv/versions/3.11.8/envs/opsmill-3.11/lib/python3.11/site-packages/ansible
  ansible collection location = /Bearchitek/.ansible/collections:/usr/share/ansible/collections
  executable location = /Bearchitek/.pyenv/versions/opsmill-3.11/bin/ansible
  python version = 3.11.8 (main, May 21 2024, 09:30:28) [Clang 15.0.0 (clang-1500.0.40.1)] (/Bearchitek/.pyenv/versions/3.11.8/envs/opsmill-3.11/bin/python)
  jinja version = 3.1.4
  libyaml = True

Infrahub version

v0.16.3

Python version

3.11

Steps to Reproduce

Using a similar inventory file

plugin: opsmill.infrahub.inventory

api_endpoint: "http://localhost:8000"
validate_certs: False
token: "{{ lookup('ansible.builtin.env', 'INFRAHUB_API_TOKEN') }}"

timeout: 30
strict: false


nodes:
  InfraDevice:
    include:
      - name
      - hostname
      - location.name
      - location.parent.name
      - location.parent.parent.name
  1. Run ansible-inventory -y --list
  2. Look at the location, the parent > Name is not present
  3. Swap the 2 lines "location.parent.name" and "location.parent.parent.name" and run the ansible-inventory command again
  4. Now parent > Name is present but not Parent > Parent > Name

Expected Behavior

It should work

Observed Behavior

When including different relationships, if 2 of them have the same name at different hierarchy, one of them will be override by the others.

@BeArchiTek BeArchiTek added the type/bug Something isn't working label Oct 11, 2024
@BeArchiTek BeArchiTek self-assigned this Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant