mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-11 19:25:54 +00:00
New DNSConfig management module
There is a new vaultcontainer management module placed in the plugins folder: plugins/modules/ipadnsconfig.py The dnsconfig module allows to modify global DNS configuration. Here is the documentation for the module: README-dnsconfig.md New example playbooks have been added: playbooks/dnsconfig/set_configuration.yml playbooks/dnsconfig/disable-global-forwarders.yml playbooks/dnsconfig/disallow-reverse-sync.yml New tests for the module: tests/dnsconfig/test_dnsconfig.yml
This commit is contained in:
141
tests/dnsconfig/test_dnsconfig.yml
Normal file
141
tests/dnsconfig/test_dnsconfig.yml
Normal file
@@ -0,0 +1,141 @@
|
||||
---
|
||||
- name: Test dnsconfig
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
gather_facts: true
|
||||
|
||||
tasks:
|
||||
# Setup.
|
||||
- name: Ensure forwarders are absent.
|
||||
ipadnsconfig:
|
||||
forwarders:
|
||||
- ip_address: 8.8.8.8
|
||||
- ip_address: 8.8.4.4
|
||||
- ip_address: 2001:4860:4860::8888
|
||||
- ip_address: 2001:4860:4860::8888
|
||||
port: 53
|
||||
state: absent
|
||||
|
||||
# Tests.
|
||||
|
||||
- name: Set dnsconfig.
|
||||
ipadnsconfig:
|
||||
forwarders:
|
||||
- ip_address: 8.8.8.8
|
||||
- ip_address: 8.8.4.4
|
||||
- ip_address: 2001:4860:4860::8888
|
||||
port: 53
|
||||
forward_policy: only
|
||||
allow_sync_ptr: yes
|
||||
register: result
|
||||
failed_when: not result.changed
|
||||
|
||||
- name: Set dnsconfig, with the same values.
|
||||
ipadnsconfig:
|
||||
forwarders:
|
||||
- ip_address: 8.8.8.8
|
||||
- ip_address: 8.8.4.4
|
||||
- ip_address: 2001:4860:4860::8888
|
||||
port: 53
|
||||
forward_policy: only
|
||||
allow_sync_ptr: yes
|
||||
register: result
|
||||
failed_when: result.changed
|
||||
|
||||
- name: Ensure forwarder is absent.
|
||||
ipadnsconfig:
|
||||
forwarders:
|
||||
- ip_address: 8.8.8.8
|
||||
state: absent
|
||||
register: result
|
||||
failed_when: not result.changed
|
||||
|
||||
- name: Ensure forwarder is absent, again.
|
||||
ipadnsconfig:
|
||||
forwarders:
|
||||
- ip_address: 8.8.8.8
|
||||
state: absent
|
||||
register: result
|
||||
failed_when: result.changed
|
||||
|
||||
- name: Disable global forwarders.
|
||||
ipadnsconfig:
|
||||
forward_policy: none
|
||||
register: result
|
||||
failed_when: not result.changed
|
||||
|
||||
- name: Disable global forwarders, again.
|
||||
ipadnsconfig:
|
||||
forward_policy: none
|
||||
register: result
|
||||
failed_when: result.changed
|
||||
|
||||
- name: Re-enable global forwarders.
|
||||
ipadnsconfig:
|
||||
forward_policy: first
|
||||
register: result
|
||||
failed_when: not result.changed
|
||||
|
||||
- name: Re-enable global forwarders, again.
|
||||
ipadnsconfig:
|
||||
forward_policy: first
|
||||
register: result
|
||||
failed_when: result.changed
|
||||
|
||||
- name: Disable PTR record synchronization.
|
||||
ipadnsconfig:
|
||||
allow_sync_ptr: no
|
||||
register: result
|
||||
failed_when: not result.changed
|
||||
|
||||
- name: Disable PTR record synchronization, again.
|
||||
ipadnsconfig:
|
||||
allow_sync_ptr: no
|
||||
register: result
|
||||
failed_when: result.changed
|
||||
|
||||
- name: Re-enable PTR record synchronization.
|
||||
ipadnsconfig:
|
||||
allow_sync_ptr: yes
|
||||
register: result
|
||||
failed_when: not result.changed
|
||||
|
||||
- name: Re-enable PTR record synchronization, again.
|
||||
ipadnsconfig:
|
||||
allow_sync_ptr: yes
|
||||
register: result
|
||||
failed_when: result.changed
|
||||
|
||||
- name: Ensure all forwarders are absent.
|
||||
ipadnsconfig:
|
||||
forwarders:
|
||||
- ip_address: 8.8.8.8
|
||||
- ip_address: 8.8.4.4
|
||||
- ip_address: 2001:4860:4860::8888
|
||||
port: 53
|
||||
state: absent
|
||||
register: result
|
||||
failed_when: not result.changed
|
||||
|
||||
|
||||
- name: Ensure all forwarders are absent, again.
|
||||
ipadnsconfig:
|
||||
forwarders:
|
||||
- ip_address: 8.8.8.8
|
||||
- ip_address: 8.8.4.4
|
||||
- ip_address: 2001:4860:4860::8888
|
||||
port: 53
|
||||
state: absent
|
||||
register: result
|
||||
failed_when: result.changed
|
||||
|
||||
# Cleanup.
|
||||
- name: Ensure forwarders are absent.
|
||||
ipadnsconfig:
|
||||
forwarders:
|
||||
- ip_address: 8.8.8.8
|
||||
- ip_address: 8.8.4.4
|
||||
- ip_address: 2001:4860:4860::8888
|
||||
- ip_address: 2001:4860:4860::8888
|
||||
port: 53
|
||||
state: absent
|
||||
Reference in New Issue
Block a user