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

Setting nios_host_record state: absent doesn't remove the record #206

Open
evilhamsterman opened this issue Dec 8, 2023 · 5 comments
Open

Comments

@evilhamsterman
Copy link

Using infoblox.nios_modules 1.5.0

Create a host, (not using nios_next_ip because per #63 which has been open since 2019, it is not idempotent)

- name: Create ansible-test DNS record
  infoblox.nios_modules.nios_host_record:
    name: ansible-tests.example.com
    ipv4addrs:
      - address: 10.100.0.70
    state: present
    provider: "{{ nios_provider }}"

Create works successfully

TASK [Create ansible-test DNS record] **********************************************
ok: [localhost]

Change the state to absent per docs

- name: Delete ansible-test DNS record
  infoblox.nios_modules.nios_host_record:
    name: ansible-tests.example.com
    ipv4addrs:
      - address: 10.100.0.70
    state: absent
    provider: "{{ nios_provider }}"

Task runs and does not indicate a change

TASK [Create ansible-test DNS record] **********************************************
ok: [localhost]

Check Infoblox and the record still exists

@c41m4n
Copy link

c41m4n commented May 14, 2024

I see this issue as well on infoblox.nios_modules v1.6.1.

@dlehrman
Copy link
Contributor

dlehrman commented Jun 3, 2024

I was able to successfully remove the host record after excluding the ipv4 details.

e.g.

- name: Delete ansible-test DNS record
  infoblox.nios_modules.nios_host_record:
    name: ansible-tests.example.com
    state: absent
    provider: "{{ nios_provider }}"

@Torie-Coding
Copy link

I was able to successfully remove the host record after excluding the ipv4 details.

e.g.


- name: Delete ansible-test DNS record

  infoblox.nios_modules.nios_host_record:

    name: ansible-tests.example.com

    state: absent

    provider: "{{ nios_provider }}"

How to you delete it? Even if i dont provide any ip details at all the ansible task is "ok".

@dlehrman
Copy link
Contributor

dlehrman commented Jun 5, 2024

How to you delete it? Even if i dont provide any ip details at all the ansible task is "ok".

If the host record in question was created with DNS disabled (configure_for_dns: false, dns: false, or Enable in DNS unchecked in the GUI), you will need to include configure_for_dns: false in the delete task.

e.g.

- name: Delete ansible-test DNS record
  infoblox.nios_modules.nios_host_record:
    name: ansible-tests.example.com
    configure_for_dns: false
    state: absent
    provider: "{{ nios_provider }}"

@Torie-Coding
Copy link

Wow... but thank you that works!

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

4 participants