Puppet Class: active_directory::child_domain_controller
- Defined in:
- manifests/child_domain_controller.pp
Summary
Manages domain controllers in a current domainOverview
Manages domain controllers in a current domain
active_directory::child_domain_controller { ‘my_child’:
domain_name => 'puppet.local',
domain_credential_user => 'Administrator',
domain_credential_passwd => 'THis_should_be_nbetter',
}
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'manifests/child_domain_controller.pp', line 27
class active_directory::child_domain_controller (
String[1] $domain_name,
String[1] $domain_credential_user,
Sensitive[String[1]] $domain_credential_passwd,
# Use hiera for defaults
Stdlib::AbsolutePath $ad_db_path,
Stdlib::AbsolutePath $ad_log_path,
Stdlib::AbsolutePath $sysvol_path,
String[1] $ad_wait_retry_attempts,
String[1] $ad_wait_retry_interval,
Optional[String[1]] $site_name,
Optional[Stdlib::AbsolutePath] $install_media_path,
){
if !($facts['os']['family'] == 'windows' and $facts['os']['release']['major'] =~ /2012 R2|2016|2019/) {
fail("This class is for Windows 2012 R2, 2016 and 2019, not ${facts['os']['family']} and ${facts['os']['release']['major']}")
}
require active_directory::rsat_ad
$_domain_credentials = {
'user' => $domain_credential_user,
'password' => $domain_credential_passwd,
}
dsc_xwaitforaddomain { $domain_name:
dsc_domainname => $domain_name,
dsc_domainusercredential => $_domain_credentials,
dsc_retryintervalsec => $ad_wait_retry_attempts,
dsc_retrycount => $ad_wait_retry_interval,
}
dsc_windowsfeature { 'ADDSInstall':
dsc_ensure => present,
dsc_name => 'AD-Domain-Services',
}
dsc_xaddomaincontroller { 'child_comain':
dsc_databasepath => $ad_db_path,
dsc_domainadministratorcredential => $_domain_credentials,
dsc_domainname => $domain_name,
dsc_installationmediapath => $install_media_path,
dsc_logpath => $ad_log_path,
dsc_sitename => $site_name,
dsc_sysvolpath => $sysvol_path,
require => [Dsc_xwaitforaddomain[$domain_name], Dsc_windowsfeature['ADDSInstall']]
}
}
|