Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added replication_source_dc options #164

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelogs/fragments/replication-dc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
minor_changes:
- >-
domain - Added ``replication_source_dc`` to specify the domain controller to use as the replication source for the
new domain - https://github.com/ansible-collections/microsoft.ad/issues/159
- >-
domain_controller - Added ``replication_source_dc`` to specify the domain controller to use as the replication
source for the new domain controller - https://github.com/ansible-collections/microsoft.ad/issues/159
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace: microsoft
name: ad
version: 1.7.1
version: 1.8.0
readme: README.md
authors:
- Jordan Borean @jborean93
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/domain_child.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ $spec = @{
default = 600
type = 'int'
}
replication_source_dc = @{
type = 'str'
}
safe_mode_password = @{
type = 'str'
required = $true
Expand Down Expand Up @@ -83,6 +86,7 @@ $domainType = $module.Params.domain_type
$installDns = $module.Params.install_dns
$logPath = $module.Params.log_path
$parentDomainName = $module.Params.parent_domain_name
$replicationSourceDC = $module.Params.replication_source_dc
$safeModePassword = $module.Params.safe_mode_password
$siteName = $module.Params.site_name
$sysvolPath = $module.Params.sysvol_path
Expand Down Expand Up @@ -169,6 +173,9 @@ if ($null -ne $installDns) {
if ($logPath) {
$installParams.LogPath = $logPath
}
if ($replicationSourceDC) {
$installParams.ReplicationSourceDC = $replicationSourceDC
}
if ($siteName) {
$installParams.SiteName = $siteName
}
Expand Down
6 changes: 6 additions & 0 deletions plugins/modules/domain_child.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ DOCUMENTATION:
create a new domain tree in.
- This can only be set when I(domain_type=tree).
type: str
replication_source_dc:
description:
- Specifies the name of an existing domain controller in the forest that
will be used as the replication source for the new domain.
type: str
version_added: 1.8.0
safe_mode_password:
description:
- Safe mode password for the domain controller.
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/domain_controller.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ $spec = @{
default = 600
type = 'int'
}
replication_source_dc = @{
type = 'str'
}
safe_mode_password = @{
no_log = $true
type = 'str'
Expand Down Expand Up @@ -81,6 +84,7 @@ $installDns = $module.Params.install_dns
$installMediaPath = $module.Params.install_media_path
$logPath = $module.Params.domain_log_path
$readOnly = $module.Params.read_only
$replicationSourceDC = $module.Params.replication_source_dc
$siteName = $module.Params.site_name
$state = $module.Params.state
$sysvolPath = $module.Params.sysvol_path
Expand Down Expand Up @@ -172,6 +176,9 @@ if ($state -eq 'domain_controller') {
# https://github.com/ansible/ansible/issues/35858
$installParams.ReadOnlyReplica = $true
}
if ($replicationSourceDC) {
$installParams.ReplicationSourceDC = $replicationSourceDC
}
if ($siteName) {
$installParams.SiteName = $siteName
}
Expand Down
6 changes: 6 additions & 0 deletions plugins/modules/domain_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ DOCUMENTATION:
existing domain.
type: bool
default: false
replication_source_dc:
description:
- Specifies the name of an existing domain controller in the forest that
will be used as the replication source for the new domain controller.
type: str
version_added: 1.8.0
safe_mode_password:
description:
- Safe mode password for the domain controller (required when
Expand Down