diff --git a/plugins/modules/ipadnszone.py b/plugins/modules/ipadnszone.py index ae8ed93ad5..f8b119993a 100644 --- a/plugins/modules/ipadnszone.py +++ b/plugins/modules/ipadnszone.py @@ -570,6 +570,7 @@ def main(): argument_spec=get_argument_spec(), mutually_exclusive=[["name", "name_from_ip"]], required_one_of=[["name", "name_from_ip"]], + supports_check_mode=True, ).ipa_run() diff --git a/tests/dnszone/test_dnszone.yml b/tests/dnszone/test_dnszone.yml index d7860aae77..39f9cf3829 100644 --- a/tests/dnszone/test_dnszone.yml +++ b/tests/dnszone/test_dnszone.yml @@ -11,6 +11,24 @@ include_tasks: env_setup.yml # 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. ipadnszone: ipaadmin_password: SomeADMINpassword @@ -19,6 +37,15 @@ register: result 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. ipadnszone: ipaadmin_password: SomeADMINpassword