C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

18
CONFIGURATION MANAGEMENT ON WINDOWS SERVER Desired State Configuration

Transcript of C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

Page 1: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

CONFIGURATION MANAGEMENT ON WINDOWS SERVERDesired State Configuration

Page 2: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

DECLARATIVE CONFIGURATION MANAGEMENT

Provisioning Verification Iterative Development

Page 3: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

DESIRED STATE CONFIGURATION

Platform Feature – Not a product API over Open Standards

So why do you need to know this stuff? DSC can run standalone Be able to build composite configurations Be able to build custom resources

Page 4: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

DESIRED STATE CONFIGURATION

Local Configuration Manager Configurations Resources

Page 5: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

LOCAL CONFIGURATION MANAGER

AllowModuleOverwrite CertificateID ConfigurationID ConfigurationMode ConfigurationModeFrequencyMins Credential DownloadManagerCustomData DownloadManagerName RebootNodeIfNeeded RefreshFrequencyMins RefreshMode

Page 6: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

CONFIGURATIONS

Declarative-ish New keywords – configuration and node Dynamic keywords (from resources) Plus all the richness of PowerShell when you

need it

Page 7: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

LAB DETAILS

User – localhost\administrator Password – Cascadia!

Wireless network – DoinDSC Wireless password – Cascadia2014

Available machines 172.18.20.12 172.18.20.13 172.18.20.14 172.18.20.15 172.18.20.16 172.18.20.17

Page 8: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

CONFIGURATIONS

Configuration MyLocalConfig {

Node localhost {

File SomeConfigFile {…}}

}

Page 9: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

CONFIGURATIONS

Separate your environment from your data

How? With ConfigurationData

Page 10: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

COMPOSITE CONFIGURATIONS

Configurations can use other configurations like resources.

Configurations are just like functions... They can have parameters.

Composite configurations are a way to logically group resources.

Page 11: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

APPLYING CONFIGURATIONS

Send-DscConfiguration

Page 12: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

TROUBLESHOOTING CONFIGURATIONS

cDscDiagnostics module

Page 13: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

RESOURCES

WMI - based PowerShell - based

Page 14: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

RESOURCES

WMI - Three methods GetTargetResource SetTargetResource TestTargetResource

Page 15: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

RESOURCES

Powershell-based resources They reside in a module under a subfolder

DscResources They are modules themselves with three

functions Get-TargetResource Set-TargetResource Test-TargetResource

Page 16: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

RESOURCES

Resources reside in modules on PSModulePath

Defaults are $pshome/modules $env:programfiles/windowspowershell/modules

Page 17: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

OTHER STUFF

Pull Server SMB vs REST Workflow Source Control

Page 18: C ONFIGURATION M ANAGEMENT ON W INDOWS S ERVER Desired State Configuration.

DOCS AND RESOURCES

Github.com/powershellorg/ebooks Blogs.msdn.com/b/powershell Github.com/powershellorg/dsc Version Control By Example – ebook by Eric

Sink