infobloxopen / infoblox-ansible

Ansible modules for interfacing to Infoblox systems
GNU General Public License v3.0
54 stars 60 forks source link

Cannot inherit EAs from parent network while creating a host record #174

Open nikhilsharma343 opened 1 year ago

nikhilsharma343 commented 1 year ago

Hi,

Is there a way we can inherit EAs from parent network while creating a host record. I tried use_for_ea_inheritance: true but getting this error, was under impression NIOS inheriting the infoblox-client python module methods?

robertattenberger commented 1 year ago

Hello,

I have got basically the same problem, but I use minimal different task-call and get a different error. The result that I cannot inherit EAs from parent network while creating a host record is also the same.

My task-call is the following:

- name: create DNS-host-record
  infoblox.nios_modules.nios_host_record:
    ipv4addrs:
      - ipv4addr: "{{ ip }}"
        use_for_ea_inheritance: true
    name: "{{ fqdn }}"
    provider:
      host: "{{ infoblox_fqdn }}"
      password: "{{ infoblox_password }}"
      username: "{{ infoblox_username }}"
    state: present
delegate_to: localhost

So I leave the "-" ahead of "use_for_ea_inheritance" away. My error message is 'Unsupported parameters for (infoblox.nios_modules.nios_host_record) module: ipv4addrs.use_for_ea_inheritance. Supported parameters include: comment, view (dns_view), configure_for_dns (dns), aliases, state, extattrs, ipv4addrs (ipv4), provider, ipv6addrs (ipv6), ttl, name.'

I was able to fix that problem by doing the following adaption in collections/ansible_collections/infoblox/nios_modules/plugins/modules/nios_host_record.py

@@ -328,7 +328,8 @@ def main():
         configure_for_dhcp=dict(type='bool', required=False, aliases=['dhcp']),
         mac=dict(required=False),
         add=dict(type='bool', required=False),
-        remove=dict(type='bool', required=False)
+        remove=dict(type='bool', required=False),
+        use_for_ea_inheritance=dict(type='bool', required=False)
     )
     ipv6addr_spec = dict(

It would be great, if that or a similar adaption could be done in the official collection. This would affect that everyone could use it and we can upgrade the collection without needing to mention about that adaption.

johnrmarley commented 1 year ago

Looks there are a bunch of other parameters listed in the docs that are not supported either. There are eight other use_* parameters in the docs for starters. https://ipam.illinois.edu/wapidoc/objects/record.host_ipv4addr.html

pcunning-rh commented 1 month ago

+1 on adding use_for_ea_inheritance=dict(type='bool', required=False) to the nios_host_record.py module, this has helped us with the same issue.

SanjeevManurkar commented 3 weeks ago

We will look at this and try to prioritize this ask for upcoming releases.