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

infoblox dynamic inventory truncates extensible attributes #35409

Closed
clementtrebuchet opened this issue Jan 26, 2018 · 1 comment
Closed

infoblox dynamic inventory truncates extensible attributes #35409

clementtrebuchet opened this issue Jan 26, 2018 · 1 comment
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@clementtrebuchet
Copy link
Contributor

clementtrebuchet commented Jan 26, 2018

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible 2.5.0 (devel_infoblox_exattrs 01091cddf6) last updated 2018/01/26 21:41:03 (GMT +200)
  config file = /home/clement/Documents/PROJECTS/ansible_env_setup/ansible/ansible.cfg
  configured module search path = ['/home/clement/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/clement/Documents/PROJECTS/ansible_env_setup/ansible/lib/ansible
  executable location = /home/clement/Documents/PROJECTS/ansible_env_setup/ansible/bin/ansible
  python version = 3.6.3 (default, Oct  9 2017, 12:07:10) [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)]
CONFIGURATION
OS / ENVIRONMENT

Fedora release 27 (Twenty Seven)

SUMMARY

As a network engineer, I need to be able to have the complete list of extensible attributes in my inventory and not a truncated list

The inventory produced by the infoblox inventory script is incomplete. Indeed, we should have the list of complete extensible attributes for each record, a minor bug overwrites the extensible attributes dictionary, the result is in the extensible attributes dictionary with only one entry.

STEPS TO REPRODUCE

python infoblox.py --list

---
# This file provides the configuration information for the Infoblox dynamic
# inventory script that is used to dynamically pull host information from NIOS.
# This file should be copied to /etc/ansible/infoblox.yaml in order for the
# dynamic script to find it.

# Sets the provider arguments for authenticating to the Infoblox server to
# retrieve inventory hosts.  Provider arguments can also be set using
# environment variables.  Supported environment variables all start with
# INFOBLOX_{{ name }}.  For instance, to set the host provider value, the
# environment variable would be INFOBLOX_HOST.
provider:
  host: <SERVER_IP>
  username: <USERNAME>
  password: <PASSWORD>

# Filters allow the dynamic inventory script to restrict the set of hosts that
# are returned from the Infoblox server.
filters:
  # restrict returned hosts by extensible attributes
  extattrs: {'IN_DeviceType': 'ACCESS', 'IN_Service': 'CAMPUS', 'IN_Country': FR', 'IN_Owner': 'LAN'}, 

  # restrict returned hosts to a specified DNS view
  view: default
EXPECTED RESULTS
"XXXX.XXXXX.com": {

                "extattrs": {

                    "IN_Vendor": "XXX",

                    "IN_Country": "XXX",

                    "IN_Service": "XXX",

                    "IN_Site": "XXX",

                    "IN_DeviceType": "XXX",

                    "IN_Owner": "XXX"

                },

                "view": "default"
ACTUAL RESULTS
 "XXXX.XXXXX.com": {
        "extattrs": {
            "IN_Owner": "XXX"
        }, 
        "view": "default"
    }, 

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bug_report needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jan 26, 2018
@clementtrebuchet
Copy link
Contributor Author

see the #35410

clementtrebuchet added a commit to clementtrebuchet/ansible that referenced this issue Jan 26, 2018
@sivel sivel changed the title As a network engineer, I need to be able to have the complete list of extensible attributes in my inventory and not a truncated list infoblox dynamic inventory truncates extensible attributes Jan 26, 2018
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Jan 26, 2018
Lujeni pushed a commit to Lujeni/ansible that referenced this issue Feb 1, 2018
* *FIX: re-create the exattrs dict into the hostvars[name] dict

* *FIX: remove unwanted files

* Fixes ansible#35409: put an str instead of variable
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
No open projects
Development

No branches or pull requests

3 participants