community.dns.adguardhome_rewrite module – Add, update or delete DNS rewrite rules from AdGuardHome
Note
This module is part of the community.dns collection (version 3.3.4).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.dns.
To use it in a playbook, specify: community.dns.adguardhome_rewrite.
New in community.dns 3.3.0
Synopsis
- Add, update or delete DNS rewrite rules from AdGuardHome. 
Parameters
| Parameter | Comments | 
|---|---|
| Domain or wildcard domain that you want to be rewritten by AdGuardHome. | |
| URL of AdGuardHome host. For example,  | |
| Related password for the AdGuardHome user. | |
| Wether a rewrite rule should be added/updated ( Choices: 
 | |
| AdGuardHome user. | |
| Ability to disable TLS certificate validation. This should only set to  Choices: 
 | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: full | Can run in  | |
| Support: full | Will return details on what has changed (or possibly needs changing in  | |
| Support: full | When run twice in a row outside check mode, with the same arguments, the second invocation indicates no change. This assumes that the system controlled/queried by the module has not changed in a relevant way. | 
Examples
- name: Add DNS rewrite rule in AdGuardHome
  community.dns.adguardhome_rewrite:
    state: present
    answer: 127.0.0.1
    domain: example.org
# When removing a rewrite, the current answer value must also match.
# Therefore you can just leave it out and the existing value
# will be used.
- name: Remove rewrite for example.org
  community.dns.adguardhome_rewrite:
    state: absent
    domain: example.org
Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Description | 
|---|---|
| The modified list of rewrite rules afte rewrite rule is applied. Returned: success | |
| Value of the rewrite. Returned: success Sample:  | |
| Domain of the rewrite. Returned: success Sample:  | 
