New in version 2.3.
password for the specified
username of a domain admin for the target domain (necessary to promote or demote a domain controller)
password to be assigned to the local
safe mode password for the domain controller (required when
whether the target host should be a domain controller or a member server
# ensure a server is a domain controller - hosts: winclient gather_facts: no tasks: - win_domain_controller: dns_domain_name: ansible.vagrant domain_admin_user: [email protected] domain_admin_password: password123! safe_mode_password: password123! state: domain_controller log_path: c:\ansible_win_domain_controller.txt # ensure a server is not a domain controller # note that without an action wrapper, in the case where a DC is demoted, # the task will fail with a 401 Unauthorized, because the domain credential # becomes invalid to fetch the final output over WinRM. This requires win_async # with credential switching (or other clever credential-switching # mechanism to get the output and trigger the required reboot) - hosts: winclient gather_facts: no tasks: - win_domain_controller: domain_admin_user: [email protected] domain_admin_password: password123! local_admin_password: password123! state: member_server log_path: c:\ansible_win_domain_controller.txt
Common return values are documented here Return Values, the following are the fields unique to this module:
|reboot_required||True if changes were made that require a reboot.||always||boolean||True|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.