mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-25 00:44:42 +00:00
dnszone: Add support for check_mode.
This patch adds support for check_mode to the dnszone management module, and provides tests to verify the behavior.
This commit is contained in:
@@ -570,6 +570,7 @@ def main():
|
|||||||
argument_spec=get_argument_spec(),
|
argument_spec=get_argument_spec(),
|
||||||
mutually_exclusive=[["name", "name_from_ip"]],
|
mutually_exclusive=[["name", "name_from_ip"]],
|
||||||
required_one_of=[["name", "name_from_ip"]],
|
required_one_of=[["name", "name_from_ip"]],
|
||||||
|
supports_check_mode=True,
|
||||||
).ipa_run()
|
).ipa_run()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,24 @@
|
|||||||
include_tasks: env_setup.yml
|
include_tasks: env_setup.yml
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
|
- name: Check if zone is present, when in shouldn't be.
|
||||||
|
ipadnszone:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: testzone.local
|
||||||
|
state: present
|
||||||
|
check_mode: yes
|
||||||
|
register: result
|
||||||
|
failed_when: not result.changed or result.failed
|
||||||
|
|
||||||
|
- name: Check if zone is present again, when in shouldn't be.
|
||||||
|
ipadnszone:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: testzone.local
|
||||||
|
state: present
|
||||||
|
check_mode: yes
|
||||||
|
register: result
|
||||||
|
failed_when: not result.changed or result.failed
|
||||||
|
|
||||||
- name: Ensure zone is present.
|
- name: Ensure zone is present.
|
||||||
ipadnszone:
|
ipadnszone:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
@@ -19,6 +37,15 @@
|
|||||||
register: result
|
register: result
|
||||||
failed_when: not result.changed or result.failed
|
failed_when: not result.changed or result.failed
|
||||||
|
|
||||||
|
- name: Check if zone is present, when in should be.
|
||||||
|
ipadnszone:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
name: testzone.local
|
||||||
|
state: present
|
||||||
|
check_mode: yes
|
||||||
|
register: result
|
||||||
|
failed_when: result.changed or result.failed
|
||||||
|
|
||||||
- name: Ensure zone is present, again.
|
- name: Ensure zone is present, again.
|
||||||
ipadnszone:
|
ipadnszone:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
|||||||
Reference in New Issue
Block a user