- name: create domain - idempotent domain: dns_domain_name: '{{ domain_realm }}' safe_mode_password: '{{ domain_password }}' register: domain_again - name: assert create domain - idempotent assert: that: - not domain_again is changed - domain_again.reboot_required == False - name: fail when reboot and async is used domain: dns_domain_name: '{{ domain_realm }}' safe_mode_password: '{{ domain_password }}' reboot: true async: 60 register: fail_reboot_async failed_when: - fail_reboot_async.msg != "async is not supported for this task when reboot=true" - name: fail when domain_netbios_name is greater than 15 character domain: dns_domain_name: '{{ domain_realm }}' safe_mode_password: '{{ domain_password }}' domain_netbios_name: AReallyLongName1 register: fail_long_netbios_name failed_when: - fail_long_netbios_name.msg != "The parameter 'domain_netbios_name' should not exceed 15 characters in length" - name: fail when domain_mode is invalid domain: dns_domain_name: '{{ domain_realm }}' safe_mode_password: '{{ domain_password }}' domain_mode: fail register: fail_domain_mode failed_when: - 'not fail_domain_mode.msg is match("The parameter ''domain_mode'' does not accept ''fail'', please use one of: .*")' - name: fail when forest_mode is invalid domain: dns_domain_name: '{{ domain_realm }}' safe_mode_password: '{{ domain_password }}' forest_mode: fail register: fail_forest_mode failed_when: - 'not fail_forest_mode.msg is match("The parameter ''forest_mode'' does not accept ''fail'', please use one of: .*")'