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

state: absent fails if item is already absent #139

Open
gpettey-ercot opened this issue Aug 24, 2022 · 0 comments
Open

state: absent fails if item is already absent #139

gpettey-ercot opened this issue Aug 24, 2022 · 0 comments

Comments

@gpettey-ercot
Copy link

gpettey-ercot commented Aug 24, 2022

Using nios_a_record with state: absent, if the record does not exist, the module fails.

hosts: all
tasks:
  - name:        remove A
    delegate_to: localhost
    infoblox.nios_modules.nios_a_record:
      provider: "{{ nios_provider }}"
      name:     "{{ item.name }}"
      ipv4addr: "{{ item.addr }}"
      state:    absent
    with_items:
      - name: xyz.com
        addr: 127.0.0.1

ansible-playbook -i xyz-dev1,xyz-dev2, play.yaml

changed: [xyz-dev1 -> localhost] => (item={'name': 'xyz.com', 'addr': '127.0.0.1'})
failed: [xyz-dev2 -> localhost] (item={'name': 'xyz.com', 'addr': '127.0.0.1'}) => {"ansible_loop_var": "item", "changed": false, "code": "Client.Ibap.Data.NotFound", "item": {"addr": "127.0.0.1", "name": "xyz.com"}, "msg": "Reference record:a/ZA5zLm17bmRfMAAuX2RlZlP1bHQuYQ9tLmVyY384LGRldi1yZXBvLnBvcL8ncmVzLDEwLjE1LjMuMTI1:xyz.com/default not found", "operation": "delete_object", "type": "AdmConDataNotFoundError"}
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