community.dns.adguardhome_rewrite_info module – Retrieve DNS rewrite rules from AdGuardHome

Note

This module is part of the community.dns collection (version 3.3.0).

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_info.

New in community.dns 3.3.0

Synopsis

  • Retrieves DNS rewrite rules from AdGuardHome.

Parameters

Parameter

Comments

host

string / required

URL of AdGuardHome host.

For example, https://my-adguard.my-domain or http://192.168.1.2.

password

string / required

Related password for the AdGuardHome user.

username

string / required

AdGuardHome user.

validate_certs

boolean

Ability to disable TLS certificate validation.

This should only set to false when the network path between the host the module is run on and the AdGuard host is fully under your control and trusted.

Choices:

  • false

  • true ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: full

This action does not modify state.

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: N/A

This action does not modify state.

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

idempotent

Support: full

This action does not modify state.

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: Get DNS rewrites from AdGuardHome
  register: rewrite
  community.dns.adguardhome_rewrite_info:
    username: admin
    password: admin
    host: https://dns.osuv.de

- name: Display the rewrite rules
  debug:
    var: rewrite

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

rules

list / elements=dictionary

The list of fetched rewrite rules.

Returned: success

answer

string

Value of the rewrite.

Returned: success

Sample: "192.168.178.71"

domain

string

Domain of the rewrite.

Returned: success

Sample: "dns.osuv.de"

Authors

  • Markus Bergholz (@markuman)