{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1626","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1626/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1626/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1626/events","html_url":"https://github.com/ansible/ansible-modules-core/pull/1626","id":91632522,"number":1626,"title":"Fixed bug, when MX records pointed to ORIGIN(@) caused unintentional …","user":{"login":"kmadac","id":3167253,"avatar_url":"https://avatars.githubusercontent.com/u/3167253?v=3","gravatar_id":"","url":"https://api.github.com/users/kmadac","html_url":"https://github.com/kmadac","followers_url":"https://api.github.com/users/kmadac/followers","following_url":"https://api.github.com/users/kmadac/following{/other_user}","gists_url":"https://api.github.com/users/kmadac/gists{/gist_id}","starred_url":"https://api.github.com/users/kmadac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmadac/subscriptions","organizations_url":"https://api.github.com/users/kmadac/orgs","repos_url":"https://api.github.com/users/kmadac/repos","events_url":"https://api.github.com/users/kmadac/events{/privacy}","received_events_url":"https://api.github.com/users/kmadac/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bugfix_pull_request","name":"bugfix_pull_request","color":"ded270"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/shipit","name":"shipit","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-06-28T20:01:59Z","updated_at":"2015-10-01T16:17:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/pulls/1626","html_url":"https://github.com/ansible/ansible-modules-core/pull/1626","diff_url":"https://github.com/ansible/ansible-modules-core/pull/1626.diff","patch_url":"https://github.com/ansible/ansible-modules-core/pull/1626.patch"},"body":"If we have domain which has only one A Origin record , everything works fine. \r\nBut , when domain managed by Digital Ocean has MX records which points to Origin (@), calling task digital_ocean_domain will cause unintentional change of one of the A records. For example if we have following records in domain testdom.com:\r\n```\r\nA @  1.1.1.1\r\nA   mail   2.2.2.2\r\nA  webmail 2.2.2.2\r\nMX @ \"v=spf1 mx ~all\" \r\n```\r\n\r\nand we use task which should finished in OK state because domain testdom.com exists with corrct origin record:\r\n\r\n```\r\n- name: \"ensure that domain testdom.com exists in DO DNS\"\r\n  digital_ocean_domain: >\r\n    client_id=xxx\r\n    api_key=xxx\r\n    state=present\r\n    ip=1.1.1.1\r\n    name=testdom.com\r\n```\r\n\r\nwebmail A record is changed to 1.1.1.1, which is not correct and can negatively affect production systems. \r\n\r\nRoot cause for this bug is that algorithm searches for Origin record in all records and not only in A records."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/144776425","html_url":"https://github.com/ansible/ansible-modules-core/pull/1626#issuecomment-144776425","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1626","id":144776425,"user":{"login":"gregdek","id":252125,"avatar_url":"https://avatars.githubusercontent.com/u/252125?v=3","gravatar_id":"","url":"https://api.github.com/users/gregdek","html_url":"https://github.com/gregdek","followers_url":"https://api.github.com/users/gregdek/followers","following_url":"https://api.github.com/users/gregdek/following{/other_user}","gists_url":"https://api.github.com/users/gregdek/gists{/gist_id}","starred_url":"https://api.github.com/users/gregdek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregdek/subscriptions","organizations_url":"https://api.github.com/users/gregdek/orgs","repos_url":"https://api.github.com/users/gregdek/repos","events_url":"https://api.github.com/users/gregdek/events{/privacy}","received_events_url":"https://api.github.com/users/gregdek/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T16:17:06Z","updated_at":"2015-10-01T16:17:06Z","body":"Thanks @kmadac for the PR, and thanks @mgregson for the review. \r\n\r\nMarking for potential inclusion. cc: @ansible/core team."}}