azure.azcollection.azure_rm_dnsrecordset – Create, delete and update DNS record sets and records¶
Note
This plugin is part of the azure.azcollection collection (version 1.5.0).
To install it use: ansible-galaxy collection install azure.azcollection
.
To use it in a playbook, specify: azure.azcollection.azure_rm_dnsrecordset
.
New in version 0.1.0: of azure.azcollection
Synopsis¶
Creates, deletes, and updates DNS records sets and records within an existing Azure DNS Zone.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
azure >= 2.0.0
Parameters¶
Notes¶
Note
For authentication with Azure you can pass parameters, set environment variables, use a profile stored in ~/.azure/credentials, or log in before you run your tasks or playbook with
az login
.Authentication is also possible using a service principal or Active Directory user.
To authenticate via service principal, pass subscription_id, client_id, secret and tenant or set environment variables AZURE_SUBSCRIPTION_ID, AZURE_CLIENT_ID, AZURE_SECRET and AZURE_TENANT.
To authenticate via Active Directory user, pass ad_user and password, or set AZURE_AD_USER and AZURE_PASSWORD in the environment.
Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing a [default] section and the following keys: subscription_id, client_id, secret and tenant or subscription_id, ad_user and password. It is also possible to add additional profiles. Specify the profile by passing profile or setting AZURE_PROFILE in the environment.
See Also¶
See also
- Sign in with Azure CLI
How to authenticate using the
az login
command.
Examples¶
- name: ensure an "A" record set with multiple records
azure_rm_dnsrecordset:
resource_group: myResourceGroup
relative_name: www
zone_name: testing.com
record_type: A
records:
- entry: 192.168.100.101
- entry: 192.168.100.102
- entry: 192.168.100.103
- name: delete a record set
azure_rm_dnsrecordset:
resource_group: myResourceGroup
record_type: A
relative_name: www
zone_name: testing.com
state: absent
- name: create multiple "A" record sets with multiple records
azure_rm_dnsrecordset:
resource_group: myResourceGroup
zone_name: testing.com
relative_name: "{{ item.name }}"
record_type: "{{ item.type }}"
records: "{{ item.records }}"
with_items:
- { name: 'servera', type: 'A', records: [ { entry: '10.10.10.20' }, { entry: '10.10.10.21' }] }
- { name: 'serverb', type: 'A', records: [ { entry: '10.10.10.30' }, { entry: '10.10.10.41' }] }
- { name: 'serverc', type: 'A', records: [ { entry: '10.10.10.40' }, { entry: '10.10.10.41' }] }
- name: create SRV records in a new record set
azure_rm_dnsrecordset:
resource_group: myResourceGroup
relative_name: _sip._tcp.testing.com
zone_name: testing.com
time_to_live: 7200
record_type: SRV
records:
- entry: sip.testing.com
preference: 10
priority: 20
weight: 10
port: 5060
- name: create PTR record in a new record set
azure_rm_dnsrecordset:
resource_group: myResourceGroup
relative_name: 192.168.100.101.in-addr.arpa
zone_name: testing.com
record_type: PTR
records:
- entry: servera.testing.com
- name: create TXT record in a new record set
azure_rm_dnsrecordset:
resource_group: myResourceGroup
relative_name: mail.testing.com
zone_name: testing.com
record_type: TXT
records:
- entry: 'v=spf1 a -all'
Authors¶
Obezimnaka Boms (@ozboms)
Matt Davis (@nitzmahone)
There were some errors parsing the documentation for this plugin. Please file a bug with the collection.
The errors were:
Unable to normalize azure_rm_dnsrecordset: return due to: 7 validation errors for PluginReturnSchema return -> state -> contains -> arecords -> return extra fields not permitted (type=value_error.extra) return -> state -> contains -> etag -> return extra fields not permitted (type=value_error.extra) return -> state -> contains -> fqdn -> return extra fields not permitted (type=value_error.extra) return -> state -> contains -> provisioning_state -> return extra fields not permitted (type=value_error.extra) return -> state -> contains -> target_resource -> return extra fields not permitted (type=value_error.extra) return -> state -> contains -> ttl -> return extra fields not permitted (type=value_error.extra) return -> state -> contains -> type -> return extra fields not permitted (type=value_error.extra)