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 with host when state:present is run several times with same data, when host includes a host alias #278

Open
ChristinaJLear opened this issue Dec 2, 2024 · 0 comments

Comments

@ChristinaJLear
Copy link

.../ansible_collections/infoblox/nios_modules/plugins/module_utils/api.py", line 710, in compare_objects\nAttributeError: 'str' object has no attribute 'get'

tasks:
- name: configure an ipv4 host record with alias - no extattr
infoblox.nios_modules.nios_host_record:
name: "test5.example.com"
ipv4:
- address: "10.10.10.15"
aliases:
- alias_test5_1.example.com
state: present
provider:
host: "192.168.111.10"
username: "admin"
password: "infoblox"
connection: local

The following fixes it:
*** nios_modules/plugins/module_utils/api.py 2024-12-02 14:40:31.238885201 +0000
--- nios_modules/plugins/module_utils/api.py-fixed 2024-12-02 16:18:33.943565524 +0000


*** 704,710 ****
return False

              for subitem in proposed_item:

! if current_item:
# Host IPv4addrs wont contain use_nextserver and nextserver
# If DHCP is false.
dhcp_flag = current_item[0].get('configure_for_dhcp', False)
--- 704,710 ----
return False

              for subitem in proposed_item:

! if key == 'ipv4addrs' and current_item:
# Host IPv4addrs wont contain use_nextserver and nextserver
# If DHCP is false.
dhcp_flag = current_item[0].get('configure_for_dhcp', False)

Creating pull request, also.

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

No branches or pull requests

1 participant