ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
836 stars 1.53k forks source link

nios_host_record error when trying to change ip of host record #748

Closed martinberg closed 3 years ago

martinberg commented 4 years ago
SUMMARY

It doesn't seem to be possible to change the ip of a host record with nios_host_record. Ansible returns an error that "The record 'test.example.com' already exists"

ISSUE TYPE
COMPONENT NAME

nios_host_record

ANSIBLE VERSION
ansible 2.9.11
  config file = /home/user/temp/ansible/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.local/lib/python3.6/site-packages/ansible
  executable location = /home/user/.local/bin/ansible
  python version = 3.6.8 (default, Jun 11 2019, 15:15:01) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
CONFIGURATION
DEFAULT_HOST_LIST(/home/user/temp/ansible/ansible.cfg) = ['/home/user/temp/ansible/hosts']
HOST_KEY_CHECKING(/home/user/temp/ansible/ansible.cfg) = False
OS / ENVIRONMENT

localhost: RHEL 7.7 Infoblox: 8.2.4

STEPS TO REPRODUCE

There is an existing host record in the "EXTERN" DNS view called 'testdomain.x.com' with IP-adress '1.1.1.99'

- name: DNS change host ip
  hosts: localhost
  connection: local
  vars:
    nios_provider:
      host: infoblox-host
      username: user
      password: passwd

    dns_revert_list:
      - {hostname: "testdomain.x.com", ip: "1.1.1.100", dnsview: "EXTERN"}

  tasks:
  - name: Change host record IP
    nios_host_record:
      name: "{{ item.hostname }}"
      ipv4:
        - address: "{{ item.ip }}"
      view: "{{ item.dnsview }}"
      state: present
      provider: "{{ nios_provider }}"
    with_items: "{{ dns_revert_list }}"
    tags:
    - site2ip
EXPECTED RESULTS

IP of host record to be changed

ACTUAL RESULTS

Error saying the record already exists. No change was made in the Infoblox environment.

failed: [localhost] (item={'hostname': 'testdomain.x.com', 'ip': '1.1.1.100', 'dnsview': 'EXTERN'}) => {"ansible_loop_var": "item", "changed": false, "code": "Client.Ibap.Data.Conflict", "item": {"dnsview": "EXTERN", "hostname": "testdomain.x.com", "ip": "1.1.1.100"}, "msg": "The record 'testdomain.x.com' already exists.", "operation": "create_object", "type": "AdmConDataError"}
ansibullbot commented 4 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 4 years ago

cc @NilashishC @Qalthos @danielmellado @ganeshrn @justjais @nerzhul @privateip @sganesh-infoblox @trishnaguha click here for bot help

russoz commented 3 years ago

Hi there

The main development of the nios modules has moved over to https://github.com/infobloxopen/infoblox-ansible/

You should probably create the same issue there and close this one. The nios modules are set for deprecation in community.general on version 5.0.0 (spring 2022, still far away but nonetheless set).

Thanks for your contribution!

Akasurde commented 3 years ago

Thank you very much for your interest in Ansible. This plugin/module is no longer maintained in this repository and has been migrated to https://github.com/infobloxopen/infoblox-ansible

Migrated this issue in the above repository - https://github.com/infobloxopen/infoblox-ansible/issues/62.

If you have further questions please stop by IRC or the mailing list: