From 09d939fb00658b356957c1e14dd2cf7ca493ce13 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Thu, 15 Feb 2018 06:15:46 +1000 Subject: [PATCH] win_domain_controller: optionally add -ReadOnlyReplica if true (#36017) --- lib/ansible/modules/windows/win_domain_controller.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/windows/win_domain_controller.ps1 b/lib/ansible/modules/windows/win_domain_controller.ps1 index 29ec6763b7..280b154a2b 100644 --- a/lib/ansible/modules/windows/win_domain_controller.ps1 +++ b/lib/ansible/modules/windows/win_domain_controller.ps1 @@ -204,10 +204,15 @@ Try { if ($sysvol_path) { $install_params.SysvolPath = $sysvol_path } + if ($read_only) { + # while this is a switch value, if we set on $false site_name is required + # https://github.com/ansible/ansible/issues/35858 + $install_params.ReadOnlyReplica = $true + } if ($site_name) { $install_params.SiteName = $site_name } - $install_result = Install-ADDSDomainController -NoRebootOnCompletion -ReadOnlyReplica:$read_only -Force @install_params + $install_result = Install-ADDSDomainController -NoRebootOnCompletion -Force @install_params Write-DebugLog "Installation completed, needs reboot..." }