win_domain_controller: Added domain_log_path (#67448)

This commit is contained in:
Jordan Borean 2020-02-17 07:25:22 +10:00 committed by GitHub
parent 4733af3376
commit e3d5dc0ed0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- win_domain_controller - Added the ``domain_log_path`` to control the directory for the new AD log files location - https://github.com/ansible/ansible/issues/59348

View file

@ -103,6 +103,7 @@ $domain_admin_password= Get-AnsibleParam -obj $params -name "domain_admin_passwo
$local_admin_password= Get-AnsibleParam -obj $params -name "local_admin_password"
$database_path = Get-AnsibleParam -obj $params -name "database_path" -type "path"
$sysvol_path = Get-AnsibleParam -obj $params -name "sysvol_path" -type "path"
$domain_log_path = Get-AnsibleParam -obj $params -name "domain_log_path" -type "path" # TODO: Use log_path and alias domain_log_path once the log_path for debug logging option has been removed.
$read_only = Get-AnsibleParam -obj $params -name "read_only" -type "bool" -default $false
$site_name = Get-AnsibleParam -obj $params -name "site_name" -type "str" -failifempty $read_only
$install_dns = Get-AnsibleParam -obj $params -name "install_dns" -type "bool"
@ -206,6 +207,9 @@ Try {
if ($database_path) {
$install_params.DatabasePath = $database_path
}
if ($domain_log_path) {
$install_params.LogPath = $domain_log_path
}
if ($sysvol_path) {
$install_params.SysvolPath = $sysvol_path
}

View file

@ -63,6 +63,12 @@ options:
- If not set then the default path is C(%SYSTEMROOT%\NTDS).
type: path
version_added: '2.5'
domain_log_path:
description:
- Specified the fully qualified, non-UNC path to a directory on a fixed disk of the local computer that will
contain the domain log files.
type: path
version_added: '2.10'
sysvol_path:
description:
- The path to a directory on a fixed disk of the Windows host where the
@ -131,4 +137,20 @@ EXAMPLES = r'''
state: domain_controller
read_only: yes
site_name: London
- name: Promote server with custom paths
win_domain_controller:
dns_domain_name: ansible.vagrant
domain_admin_user: testguy@ansible.vagrant
domain_admin_password: password123!
safe_mode_password: password123!
state: domain_controller
sysvol_path: D:\SYSVOL
database_path: D:\NTDS
domain_log_path: D:\NTDS
register: dc_promotion
- name: Reboot after promotion
win_reboot:
when: dc_promotion.reboot_required
'''