{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/30201","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/30201/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/30201/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/30201/events","html_url":"https://github.com/ansible/ansible/pull/30201","id":257144888,"number":30201,"title":"Support Adding And Removing Digital Ocean Domain Records","user":{"login":"zeroSteiner","id":2058303,"avatar_url":"https://avatars1.githubusercontent.com/u/2058303?v=4","gravatar_id":"","url":"https://api.github.com/users/zeroSteiner","html_url":"https://github.com/zeroSteiner","followers_url":"https://api.github.com/users/zeroSteiner/followers","following_url":"https://api.github.com/users/zeroSteiner/following{/other_user}","gists_url":"https://api.github.com/users/zeroSteiner/gists{/gist_id}","starred_url":"https://api.github.com/users/zeroSteiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeroSteiner/subscriptions","organizations_url":"https://api.github.com/users/zeroSteiner/orgs","repos_url":"https://api.github.com/users/zeroSteiner/repos","events_url":"https://api.github.com/users/zeroSteiner/events{/privacy}","received_events_url":"https://api.github.com/users/zeroSteiner/received_events","type":"User","site_admin":false},"labels":[{"id":686214011,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.5","name":"affects_2.5","color":"ededed","default":false},{"id":61528803,"url":"https://api.github.com/repos/ansible/ansible/labels/cloud","name":"cloud","color":"c7def8","default":false},{"id":501518759,"url":"https://api.github.com/repos/ansible/ansible/labels/community_review","name":"community_review","color":"f9d0c4","default":false},{"id":379680546,"url":"https://api.github.com/repos/ansible/ansible/labels/digital_ocean","name":"digital_ocean","color":"c5def5","default":false},{"id":48457821,"url":"https://api.github.com/repos/ansible/ansible/labels/feature_pull_request","name":"feature_pull_request","color":"006b75","default":false},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":581543918,"url":"https://api.github.com/repos/ansible/ansible/labels/stale_ci","name":"stale_ci","color":"fef2c0","default":false},{"id":636327968,"url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-09-12T18:52:12Z","updated_at":"2017-10-08T03:19:12Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/30201","html_url":"https://github.com/ansible/ansible/pull/30201","diff_url":"https://github.com/ansible/ansible/pull/30201.diff","patch_url":"https://github.com/ansible/ansible/pull/30201.patch"},"body":"##### SUMMARY\r\nThis PR updates the `digital_ocean_domain` module to allow it to not only add and remove domains but also records for those domains.\r\n\r\nThe module is backwards compatible as the new `type` option defaults to None and when it is None, the module operates on domains. Alternatively the `type` option can be one of the record types supported by Digital Ocean such as A, AAAA, CNAME, TXT etc. and these records can be added or removed.\r\n\r\nThe new `data` option specifies the data to use when creating a new record, or a regex that can be used to match a record for removal. This allows removing records when the current value is not entirely known.\r\n\r\nWhen operating on records (because `type` is set), the `name` field is first checked to see if it an existing domain, if it is the special name of `@` is used. If the `name` field is not an existing domain, the hostname field is removed from the domain and the API is checked again to see if the domain exists. I hope this is intuitive for users.\r\n\r\n##### ISSUE TYPE\r\n - Feature Pull Request\r\n\r\n##### COMPONENT NAME\r\n`digital_ocean_domain`\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.3.2.0\r\n  config file = /home/steiner/.ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n  python version = 3.6.2 (default, Aug 11 2017, 11:59:59) [GCC 7.1.1 20170622 (Red Hat 7.1.1-3)]\r\n```\r\n\r\n\r\n##### ADDITIONAL INFORMATION\r\n**Before the patch:**\r\n```\r\nansible localhost -m digital_ocean_domain -a \"api_token=API_KEY state=absent name=zerosteiner.com data='v\\=spf1\\ .*' type=txt\" \r\n [WARNING]: Found both group and host with same name: zerosteiner.com\r\n\r\nlocalhost | FAILED! => {\r\n    \"changed\": false,\r\n    \"failed\": true,\r\n    \"msg\": \"Unsupported parameters for (digital_ocean_domain) module: data,type. Supported parameters include: api_token,id,ip,name,state\"\r\n}\r\n```\r\n\r\n**With the patch: (Example is removing an SPF record)**\r\n```\r\nansible localhost -m digital_ocean_domain -a \"api_token=API_KEY state=absent name=zerosteiner.com data='v\\=spf1\\ .*' type=txt\"\r\n[DEPRECATED] DEFAULT_SUDO_FLAGS: In favor of become which is a generic framework. It will be removed in 2.8. As alternative use one of [become]\r\n[DEPRECATED] [defaults]hostfile: The key is misleading as it can also be a list of hosts, a directory or a list of paths. It will be removed in 2.8. As alternative use one of [inventory]\r\n[DEPRECATION WARNING]: DEFAULT_SUDO_FLAGS option, In favor of become which is a generic framework . This feature will be removed in version 2.8. Deprecation warnings can be disabled by setting \r\ndeprecation_warnings=False in ansible.cfg.\r\n[DEPRECATION WARNING]: [defaults]hostfile option, The key is misleading as it can also be a list of hosts, a directory or a list of paths . This feature will be removed in version 2.8. Deprecation \r\nwarnings can be disabled by setting deprecation_warnings=False in ansible.cfg.\r\n [WARNING]: Found both group and host with same name: zerosteiner.com\r\n\r\nlocalhost | SUCCESS => {\r\n    \"changed\": true, \r\n    \"domain\": {\r\n        \"name\": \"zerosteiner.com\", \r\n        \"ttl\": 1800, \r\n        \"zone_file\": \"$ORIGIN zerosteiner.com.\\n$TTL 1800\\nzerosteiner.com. IN SOA ns1.digitalocean.com. hostmaster.zerosteiner.com. 1505238748 10800 3600 604800 1800\\nzerosteiner.com. 1800 IN NS ns1.digitalocean.com.\\nzerosteiner.com. 1800 IN NS ns2.digitalocean.com.\\nzerosteiner.com. 1800 IN NS ns3.digitalocean.com.\\nzerosteiner.com. 1800 IN A 104.131.39.224\\nhome.zerosteiner.com. 3600 IN CNAME zerosteiner.mynetgear.com.\\nbandit.zerosteiner.com. 1800 IN A 104.131.96.203\\nzerosteiner.com. 3600 IN TXT keybase-site-verification=226qlUWaG6tkQt-UwUUo3RjfjvQ2gtxrBMcV3Cu0pmw\\nzerosteiner.com. 1800 IN TXT v=spf1 a mx -all\\nworker.zerosteiner.com. 1800 IN A 45.55.93.8\\n\"\r\n    }, \r\n    \"failed\": false, \r\n    \"record\": {\r\n        \"data\": \"v=spf1 a mx -all\", \r\n        \"domain_id\": \"zerosteiner.com\", \r\n        \"flags\": null, \r\n        \"id\": 28429588, \r\n        \"name\": \"@\", \r\n        \"port\": null, \r\n        \"priority\": null, \r\n        \"tag\": null, \r\n        \"ttl\": 1800, \r\n        \"type\": \"TXT\", \r\n        \"weight\": null\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/334980095","html_url":"https://github.com/ansible/ansible/pull/30201#issuecomment-334980095","issue_url":"https://api.github.com/repos/ansible/ansible/issues/30201","id":334980095,"user":{"login":"ansibot","id":6585283,"avatar_url":"https://avatars0.githubusercontent.com/u/6585283?v=4","gravatar_id":"","url":"https://api.github.com/users/ansibot","html_url":"https://github.com/ansibot","followers_url":"https://api.github.com/users/ansibot/followers","following_url":"https://api.github.com/users/ansibot/following{/other_user}","gists_url":"https://api.github.com/users/ansibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibot/subscriptions","organizations_url":"https://api.github.com/users/ansibot/orgs","repos_url":"https://api.github.com/users/ansibot/repos","events_url":"https://api.github.com/users/ansibot/events{/privacy}","received_events_url":"https://api.github.com/users/ansibot/received_events","type":"User","site_admin":false},"created_at":"2017-10-08T03:19:12Z","updated_at":"2017-10-08T03:19:12Z","author_association":"CONTRIBUTOR","body":"cc @BondAnthony\n[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)\n<!--- boilerplate: notify --->"}}
{"actor":{"display_login":"ansibot"}}