{"action":"closed","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/47839","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/47839/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/47839/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/47839/events","html_url":"https://github.com/ansible/ansible/issues/47839","id":375766232,"node_id":"MDU6SXNzdWUzNzU3NjYyMzI=","number":47839,"title":"nios_a_record can't create two A records with same name","user":{"login":"dmrzzz","id":16159935,"node_id":"MDQ6VXNlcjE2MTU5OTM1","avatar_url":"https://avatars3.githubusercontent.com/u/16159935?v=4","gravatar_id":"","url":"https://api.github.com/users/dmrzzz","html_url":"https://github.com/dmrzzz","followers_url":"https://api.github.com/users/dmrzzz/followers","following_url":"https://api.github.com/users/dmrzzz/following{/other_user}","gists_url":"https://api.github.com/users/dmrzzz/gists{/gist_id}","starred_url":"https://api.github.com/users/dmrzzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmrzzz/subscriptions","organizations_url":"https://api.github.com/users/dmrzzz/orgs","repos_url":"https://api.github.com/users/dmrzzz/repos","events_url":"https://api.github.com/users/dmrzzz/events{/privacy}","received_events_url":"https://api.github.com/users/dmrzzz/received_events","type":"User","site_admin":false},"labels":[{"id":947190508,"node_id":"MDU6TGFiZWw5NDcxOTA1MDg=","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.7","name":"affects_2.7","color":"ededed","default":false},{"id":785271699,"node_id":"MDU6TGFiZWw3ODUyNzE2OTk=","url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":913847981,"node_id":"MDU6TGFiZWw5MTM4NDc5ODE=","url":"https://api.github.com/repos/ansible/ansible/labels/infoblox","name":"infoblox","color":"c5def5","default":false},{"id":496359346,"node_id":"MDU6TGFiZWw0OTYzNTkzNDY=","url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":593252542,"node_id":"MDU6TGFiZWw1OTMyNTI1NDI=","url":"https://api.github.com/repos/ansible/ansible/labels/net_tools","name":"net_tools","color":"fbca04","default":false},{"id":339653091,"node_id":"MDU6TGFiZWwzMzk2NTMwOTE=","url":"https://api.github.com/repos/ansible/ansible/labels/networking","name":"networking","color":"c7def8","default":false},{"id":383076471,"node_id":"MDU6TGFiZWwzODMwNzY0NzE=","url":"https://api.github.com/repos/ansible/ansible/labels/python3","name":"python3","color":"fbca04","default":false},{"id":669975544,"node_id":"MDU6TGFiZWw2Njk5NzU1NDQ=","url":"https://api.github.com/repos/ansible/ansible/labels/support:certified","name":"support:certified","color":"ededed","default":false},{"id":942378949,"node_id":"MDU6TGFiZWw5NDIzNzg5NDk=","url":"https://api.github.com/repos/ansible/ansible/labels/traceback","name":"traceback","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"justjais","id":26872141,"node_id":"MDQ6VXNlcjI2ODcyMTQx","avatar_url":"https://avatars2.githubusercontent.com/u/26872141?v=4","gravatar_id":"","url":"https://api.github.com/users/justjais","html_url":"https://github.com/justjais","followers_url":"https://api.github.com/users/justjais/followers","following_url":"https://api.github.com/users/justjais/following{/other_user}","gists_url":"https://api.github.com/users/justjais/gists{/gist_id}","starred_url":"https://api.github.com/users/justjais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justjais/subscriptions","organizations_url":"https://api.github.com/users/justjais/orgs","repos_url":"https://api.github.com/users/justjais/repos","events_url":"https://api.github.com/users/justjais/events{/privacy}","received_events_url":"https://api.github.com/users/justjais/received_events","type":"User","site_admin":false},"assignees":[{"login":"justjais","id":26872141,"node_id":"MDQ6VXNlcjI2ODcyMTQx","avatar_url":"https://avatars2.githubusercontent.com/u/26872141?v=4","gravatar_id":"","url":"https://api.github.com/users/justjais","html_url":"https://github.com/justjais","followers_url":"https://api.github.com/users/justjais/followers","following_url":"https://api.github.com/users/justjais/following{/other_user}","gists_url":"https://api.github.com/users/justjais/gists{/gist_id}","starred_url":"https://api.github.com/users/justjais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justjais/subscriptions","organizations_url":"https://api.github.com/users/justjais/orgs","repos_url":"https://api.github.com/users/justjais/repos","events_url":"https://api.github.com/users/justjais/events{/privacy}","received_events_url":"https://api.github.com/users/justjais/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2018-10-31T01:59:22Z","updated_at":"2018-11-20T09:02:32Z","closed_at":"2018-11-20T09:02:31Z","author_association":"NONE","body":"<!--- Verify first that your issue is not already reported on GitHub -->\r\n<!--- Also test if the latest release and devel branch are affected too -->\r\n<!--- Complete *all* sections as described, this form is processed automatically -->\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly below -->\r\n\r\nIt is valid in DNS (and in Infoblox DDI) to create several A records with the same name and different ipv4addr, but attempting to accomplish this using Ansible nios_a_record fails.\r\n\r\nBased on the error message (\"Field is not allowed for update: view\"), it seems that Ansible is trying to update the existing A record when it should be creating a new one.  It furthermore fails to accomplish its misguided objective of modifying the existing record because it tries to update the \"view\" field.\r\n\r\n##### ISSUE TYPE\r\n- Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Write the short name of the module, plugin, task or feature below -->\r\nnios_a_record\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes -->\r\n```paste below\r\nansible 2.7.1\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = ['/home/dmrz/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /home/dmrz/.local/lib/python3.5/site-packages/ansible\r\n  executable location = /home/dmrz/.local/bin/ansible\r\n  python version = 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609]\r\n```\r\n\r\n##### CONFIGURATION\r\n<!--- Paste verbatim output from \"ansible-config dump --only-changed\" between quotes -->\r\n```paste below\r\n\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\n<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->\r\nTarget Infoblox grid is running NIOS 8.2.6\r\n\r\n##### STEPS TO REPRODUCE\r\n<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n---\r\n- import_playbook: ipam-provider.yml\r\n\r\n- name: Add two IPAM A records\r\n  hosts: localhost\r\n  gather_facts: false\r\n  vars:\r\n\r\n    view: default\r\n    fqdn: ansibletest.sandbox.illinois.edu\r\n\r\n  tasks:\r\n\r\n    - name: create first A record\r\n      nios_a_record:\r\n        view: \"{{ view }}\"\r\n        name: \"{{ fqdn }}\"\r\n        ipv4addr: \"192.168.0.17\"\r\n        state: present\r\n        provider: \"{{ ipam_provider }}\"\r\n\r\n    - name: create second A record\r\n      nios_a_record:\r\n        view: \"{{ view }}\"\r\n        name: \"{{ fqdn }}\"\r\n        ipv4addr: \"192.168.0.18\"\r\n        state: present\r\n        provider: \"{{ ipam_provider }}\"\r\n```\r\n\r\n(ipam-provider.yml is my helper playbook which jumps through some hoops to set a localhost fact `ipam_provider`)\r\n<!--- HINT: You can paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- Describe what you expected to happen when running the steps above -->\r\n\r\nIt should create two A records for ansibletest.sandbox.illinois.edu, pointing to 192.168.0.17 and 192.168.0.18\r\n\r\n##### ACTUAL RESULTS\r\n<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->\r\n\r\nIt successfully creates the first A record but fails bizarrely on the second one.\r\n\r\n<!--- Paste verbatim command output between quotes -->\r\n```paste below\r\n$ ansible-playbook -vvvv test-two-a-records.yml\r\nansible-playbook 2.7.1\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = ['/home/dmrz/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /home/dmrz/.local/lib/python3.5/site-packages/ansible\r\n  executable location = /home/dmrz/.local/bin/ansible-playbook\r\n  python version = 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609]\r\nUsing /etc/ansible/ansible.cfg as config file\r\nsetting up inventory plugins\r\n/etc/ansible/hosts did not meet host_list requirements, check plugin documentation if this is unexpected\r\n/etc/ansible/hosts did not meet script requirements, check plugin documentation if this is unexpected\r\nParsed /etc/ansible/hosts inventory source with ini plugin\r\n [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'\r\n\r\nLoading callback plugin default of type stdout, v2.0 from /home/dmrz/.local/lib/python3.5/site-packages/ansible/plugins/callback/default.py\r\n\r\nPLAYBOOK: test-two-a-records.yml *************************************************************************************************************************\r\n2 plays in test-two-a-records.yml\r\n\r\nPLAY [Configure IPAM provider] ***************************************************************************************************************************\r\n\r\n(...snip...)\r\n\r\nPLAY [Add two IPAM A records] ****************************************************************************************************************************\r\nMETA: ran handlers\r\n\r\nTASK [create first A record] *****************************************************************************************************************************\r\ntask path: /home/dmrz/test/test-two-a-records.yml:14\r\n<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: dmrz\r\n<127.0.0.1> EXEC /bin/sh -c 'echo ~dmrz && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo /home/dmrz/.ansible/tmp/ansible-tmp-1540949805.4533484-183524758066698 `\" && echo ansible-tmp-1540949805.4533484-183524758066698=\"` echo /home/dmrz/.ansible/tmp/ansible-tmp-1540949805.4533484-183524758066698 `\" ) && sleep 0'\r\nUsing module file /home/dmrz/.local/lib/python3.5/site-packages/ansible/modules/net_tools/nios/nios_a_record.py\r\n<127.0.0.1> PUT /home/dmrz/.ansible/tmp/ansible-local-11944jaw15lw_/tmpxocdg1rb TO /home/dmrz/.ansible/tmp/ansible-tmp-1540949805.4533484-183524758066698/AnsiballZ_nios_a_record.py\r\n<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/dmrz/.ansible/tmp/ansible-tmp-1540949805.4533484-183524758066698/ /home/dmrz/.ansible/tmp/ansible-tmp-1540949805.4533484-183524758066698/AnsiballZ_nios_a_record.py && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/dmrz/.ansible/tmp/ansible-tmp-1540949805.4533484-183524758066698/AnsiballZ_nios_a_record.py && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/dmrz/.ansible/tmp/ansible-tmp-1540949805.4533484-183524758066698/ > /dev/null 2>&1 && sleep 0'\r\nchanged: [localhost] => {\r\n    \"changed\": true,\r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"comment\": null,\r\n            \"extattrs\": null,\r\n            \"ipv4addr\": \"192.168.0.17\",\r\n            \"name\": \"ansibletest.sandbox.illinois.edu\",\r\n            \"provider\": {\r\n                \"host\": \"dev.ipam.illinois.edu\",\r\n                \"http_pool_connections\": 10,\r\n                \"http_pool_maxsize\": 10,\r\n                \"http_request_timeout\": 10,\r\n                \"max_results\": -1000,\r\n                \"max_retries\": 3,\r\n                \"password\": \"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER\",\r\n                \"silent_ssl_warnings\": true,\r\n                \"ssl_verify\": true,\r\n                \"username\": \"dmrz\",\r\n                \"wapi_version\": \"2.7.3\"\r\n            },\r\n            \"state\": \"present\",\r\n            \"ttl\": null,\r\n            \"view\": \"default\"\r\n        }\r\n    }\r\n}\r\n\r\nTASK [create second A record] ****************************************************************************************************************************\r\ntask path: /home/dmrz/test/test-two-a-records.yml:22\r\n<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: dmrz\r\n<127.0.0.1> EXEC /bin/sh -c 'echo ~dmrz && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo /home/dmrz/.ansible/tmp/ansible-tmp-1540949806.7682629-153779630868048 `\" && echo ansible-tmp-1540949806.7682629-153779630868048=\"` echo /home/dmrz/.ansible/tmp/ansible-tmp-1540949806.7682629-153779630868048 `\" ) && sleep 0'\r\nUsing module file /home/dmrz/.local/lib/python3.5/site-packages/ansible/modules/net_tools/nios/nios_a_record.py\r\n<127.0.0.1> PUT /home/dmrz/.ansible/tmp/ansible-local-11944jaw15lw_/tmphpfyx_b_ TO /home/dmrz/.ansible/tmp/ansible-tmp-1540949806.7682629-153779630868048/AnsiballZ_nios_a_record.py\r\n<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/dmrz/.ansible/tmp/ansible-tmp-1540949806.7682629-153779630868048/ /home/dmrz/.ansible/tmp/ansible-tmp-1540949806.7682629-153779630868048/AnsiballZ_nios_a_record.py && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/dmrz/.ansible/tmp/ansible-tmp-1540949806.7682629-153779630868048/AnsiballZ_nios_a_record.py && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/dmrz/.ansible/tmp/ansible-tmp-1540949806.7682629-153779630868048/ > /dev/null 2>&1 && sleep 0'\r\nThe full traceback is:\r\n  File \"/tmp/ansible_nios_a_record_payload_a006qioh/ansible_nios_a_record_payload.zip/ansible/module_utils/net_tools/nios/api.py\", line 151, in _invoke_method\r\n    return method(*args, **kwargs)\r\n  File \"/home/dmrz/.local/lib/python3.5/site-packages/infoblox_client/connector.py\", line 41, in callee\r\n    return func(*args, **kwargs)\r\n  File \"/home/dmrz/.local/lib/python3.5/site-packages/infoblox_client/connector.py\", line 430, in update_object\r\n    code=r.status_code)\r\n\r\nfatal: [localhost]: FAILED! => {\r\n    \"changed\": false,\r\n    \"code\": \"Client.Ibap.Proto\",\r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"comment\": null,\r\n            \"extattrs\": null,\r\n            \"ipv4addr\": \"192.168.0.18\",\r\n            \"name\": \"ansibletest.sandbox.illinois.edu\",\r\n            \"provider\": {\r\n                \"host\": \"dev.ipam.illinois.edu\",\r\n                \"http_pool_connections\": 10,\r\n                \"http_pool_maxsize\": 10,\r\n                \"http_request_timeout\": 10,\r\n                \"max_results\": -1000,\r\n                \"max_retries\": 3,\r\n                \"password\": \"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER\",\r\n                \"silent_ssl_warnings\": true,\r\n                \"ssl_verify\": true,\r\n                \"username\": \"dmrz\",\r\n                \"wapi_version\": \"2.7.3\"\r\n            },\r\n            \"state\": \"present\",\r\n            \"ttl\": null,\r\n            \"view\": \"default\"\r\n        }\r\n    },\r\n    \"msg\": \"Field is not allowed for update: view\",\r\n    \"operation\": \"update_object\",\r\n    \"type\": \"AdmConProtoError\"\r\n}\r\n\tto retry, use: --limit @/home/dmrz/test/test-two-a-records.retry\r\n\r\nPLAY RECAP ***********************************************************************************************************************************************\r\nlocalhost                  : ok=4    changed=1    unreachable=0    failed=1   \r\n```\r\n"}}
{"actor":{"display_login":"justjais"}}