{"id":15775064,"url":"https://github.com/jtyr/ansible-win_dns","last_synced_at":"2025-03-14T06:32:20.599Z","repository":{"id":69603838,"uuid":"227658205","full_name":"jtyr/ansible-win_dns","owner":"jtyr","description":"Ansible role which helps to manage DNS records on Windows DNS.","archived":false,"fork":false,"pushed_at":"2020-02-12T17:48:21.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-06T19:53:42.782Z","etag":null,"topics":["ansible","ansible-role","dns","windows"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtyr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-12T17:13:42.000Z","updated_at":"2024-11-02T20:17:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cbbfbc8-6623-4e67-b4c7-9acc3701032d","html_url":"https://github.com/jtyr/ansible-win_dns","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fansible-win_dns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fansible-win_dns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fansible-win_dns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fansible-win_dns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtyr","download_url":"https://codeload.github.com/jtyr/ansible-win_dns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243538060,"owners_count":20307100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-role","dns","windows"],"created_at":"2024-10-04T16:42:11.418Z","updated_at":"2025-03-14T06:32:20.593Z","avatar_url":"https://github.com/jtyr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"win_dns\n=======\n\nAnsible role which helps to manage DNS records on Windows DNS.\n\nThe configuration of the role is done in such way that it should not be\nnecessary to change the role for any kind of configuration. All can be done\neither by changing role parameters or by declaring completely new configuration\nas a variable. That makes this role absolutely universal. See the examples below\nfor more details.\n\nPlease report any issues or send PR.\n\n\nExamples\n--------\n\n```yaml\n---\n\n- name Example of how to add A record\n  hosts: dc.example.com\n  gather_facts: no\n  become: no\n  vars:\n    win_dns_zone: example.com\n    win_dns_name: test\n    win_dns_type: A\n    win_dns_value: 1.2.3.4\n  roles:\n    - win_dns\n\n- name Example of how to add A record with TTL\n  hosts: dc.example.com\n  gather_facts: no\n  become: no\n  vars:\n    win_dns_zone: example.com\n    win_dns_name: test\n    win_dns_ttl: 300\n    win_dns_type: A\n    win_dns_value: 1.2.3.4\n  roles:\n    - win_dns\n\n- name Example of how to add A record with automatic PTR record\n  hosts: dc.example.com\n  gather_facts: no\n  become: no\n  vars:\n    win_dns_zone: example.com\n    win_dns_name: test\n    win_dns_ttl: 300\n    win_dns_type: A\n    win_dns_value: 1.2.3.4\n    win_dns_autoptr: yes\n  roles:\n    - win_dns\n\n- name Example of how to add CNAME record\n  hosts: dc.example.com\n  gather_facts: no\n  become: no\n  vars:\n    win_dns_zone: example.com\n    win_dns_name: testing\n    win_dns_type: CNAME\n    win_dns_value: test.example.com\n  roles:\n    - win_dns\n\n- name Example of how to add PTR record\n  hosts: dc.example.com\n  gather_facts: no\n  become: no\n  vars:\n    win_dns_zone: 3.2.1.example.com\n    win_dns_name: 4\n    win_dns_type: CNAME\n    win_dns_value: test.example.com\n  roles:\n    - win_dns\n\n- name Example of how to remove record\n  hosts: dc.example.com\n  gather_facts: no\n  become: no\n  vars:\n    win_dns_zone: example.com\n    win_dns_name: test\n    win_dns_type: A\n    win_dns_value: 1.2.3.4\n    win_dns_state: absent\n  roles:\n    - win_dns\n\n- name Example of how to manage multiple records at once\n  hosts: dc.example.com\n  gather_facts: no\n  become: no\n  vars:\n    # Allow to manage PTR records automatically\n    win_dns_autoptr: yes\n    # List of records to manage\n    win_dns_records:\n      - zone: example.com\n        name: test\n        type: A\n        value: 1.2.3.4\n      - zone: example.com\n        name: testing\n        type: CNAME\n        value: test.example.com\n        state: absent\n  roles:\n    - win_dns\n```\n\nIn order to run the playbook, you have to make WinRM working on the machine from\nwhere you run Ansible. It usually requires latest version of\n`requests-kerberos`:\n\n```shell\npip install requests-kerberos\n```\n\nThen you can run it like this:\n\n```shell\nansible-playbook \\\n  -i dc.example.com, \\\n  -e \"{ \\\n    ansible_connection: winrm, \\\n    ansible_port: 5986, \\\n    ansible_user: ansible@EXAMPLE.COM, \\\n    ansible_winrm_transport: kerberos, \\\n    ansible_winrm_server_cert_validation: ignore, \\\n    ansible_password: myt0ps3cr3tp4ssword }\" \\\n  ./site.yaml\n```\n\n\nRole variables\n--------------\n\nList of variables used by the role:\n\n```yaml\n# Zone name (must be provided by the user)\nwin_dns_zone: null\n\n# Name in the zone (must be provided by the user)\nwin_dns_name: null\n\n# Default record type (A, AAAA, CNAME, PTR)\nwin_dns_type: null\n\n# Value of the specific type (must be provided by the user)\nwin_dns_value: null\n\n# TTL (optional)\nwin_dns_ttl: null\n\n# Default TTL\nwin_dns_ttl_default: 3600\n\n# Default state\nwin_dns_state: present\n\n# Whether to add PTR record automatically for every A record\nwin_dns_autoptr: no\n\n# Final list of records\nwin_dns_records:\n  - name: \"{{ win_dns_name }}\"\n    type: \"{{ win_dns_type }}\"\n    value: \"{{ win_dns_value }}\"\n    ttl: \"{{ win_dns_ttl }}\"\n    zone: \"{{ win_dns_zone }}\"\n    state: \"{{ win_dns_state }}\"\n```\n\n\nLicense\n-------\n\nMIT\n\n\nAuthor\n------\n\nJiri Tyr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtyr%2Fansible-win_dns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtyr%2Fansible-win_dns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtyr%2Fansible-win_dns/lists"}