-
Notifications
You must be signed in to change notification settings - Fork 0
/
SampleConfig.ps1
27 lines (23 loc) · 1016 Bytes
/
SampleConfig.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
configuration SampleConfig {
Import-DscResource -Module PackageManagement -ModuleVersion 1.0.0.1
Import-DscResource -Module CertificateDsc -ModuleVersion 5.1.0
$environment = if ($env:USERDOMAIN -ieq "prod.example.com") {"production"} else {"staging"}
Node $AllNodes.NodeName {
$DNSName = "example.com"
CertReq SSLCert {
Subject = $DNSName; SubjectAltName = "dns=$DNSName&dns=www.$DNSName"
FriendlyName = $DNSName
Exportable = $true
ProviderName = 'Microsoft RSA SChannel Cryptographic Provider'; KeyUsage = '0xa0'; OID = '1.3.6.1.5.5.7.3.1' #serverAuth
KeyLength = '2048'
CertificateTemplate = 'WebServer'
KeyType = 'RSA'
RequestType = 'CMC'
}
if ($environment -eq "production") {
#Call some resources
} else {
#Call other resources
}
}
}