Die Präsentation wird geladen. Bitte warten

Die Präsentation wird geladen. Bitte warten

Für was, wen, wann und überhaupt? DEVOP PART IV: DSC – DESIRED STATE CONFIGURATION.

Ähnliche Präsentationen


Präsentation zum Thema: "Für was, wen, wann und überhaupt? DEVOP PART IV: DSC – DESIRED STATE CONFIGURATION."—  Präsentation transkript:

1 für was, wen, wann und überhaupt? DEVOP PART IV: DSC – DESIRED STATE CONFIGURATION

2 Dank DSC werden viele Administratoren nicht einmal mehr Powershell lernen müssen…

3 DSC ist komplett Textfile basierend – jeder kann es lesen, indexieren, anpassen und generieren.

4 DSC Architektur

5 Evolution des DevOps Basic Admin Scripter Programmierer

6 Configuration Scripts Configuration MonitoringSoftware { param( [string[]]$ComputerName="localhost" ) Node $ComputerName { File MonitoringInstallationFiles { Ensure = "Present" SourcePath = "\\dc01\Software\Monitoring" DestinationPath = "C:\Temp\Monitoring" Type = "Directory" Recurse = $true } MonitoringSoftware

7 Configuration Examples…

8 Registry Registry RegistryExample { Ensure = "Present" # You can also set Ensure to "Absent" Key = "HKEY_LOCAL_MACHINE\SOFTWARE\ExampleKey" ValueName ="TestValue" ValueData ="TestData" }

9 Package Resource Package PackageExample { Ensure = "Present" # You can also set Ensure to "Absent" Path = "$Env:SystemDrive\TestFolder\TestProject.msi" Name = "TestPackage" ProductId = "663A8209-89E0-4C48-898B-53D73CA2C14B" }

10 Umgebungsvariablen Environment EnvironmentExample { Ensure = "Present" # You can also set Ensure to "Absent" Name = "TestEnvironmentVariable" Value = "TestValue" }

11 Archiv Ressource Archive ArchiveExample { Ensure = "Present" Path = "C:\Users\Public\Documents\Test.zip" Destination = "C:\Users\Public\Documents\ExtractionPath" }

12 Windows Feature WindowsFeature IIS { Ensure = "Present" # To uninstall, set Ensure to "Absent" Name = "Web-Server“ # Name property from Get-WindowsFeature }

13 Gruppen Group GroupExample { # This will remove TestGroup, if present # To create a new group, set Ensure to "Present" Ensure = "Absent" GroupName = "TestGroup" }

14 Dienste Service ServiceExample { Name = "TermService" StartupType = "Manual" }

15 Script Ressource Script ScriptExample { SetScript = { $sw = New-Object System.IO.StreamWriter("C:\TempFolder\TestFile.txt") $sw.WriteLine("Some sample string") $sw.Close() } TestScript = { Test-Path "C:\TempFolder\TestFile.txt" } GetScript = { } }

16 Fehlt noch was…? Programmierer Scripter Basic Admin

17 DSC Resource Design

18 Resource Prototype

19 …da gibts noch was…  Riesige Sammlung von Ressourcen von Microsoft:  https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d

20 Fehlt ein CMDlet…? Programmierer Scripter Basic Admin

21 Abgrenzung zu GPO’s?  Über Domänengrenzen hinweg anwendbar  Erweiterbarkeit durch eigene PS-Scripts  Standardisiertes Format

22 DSC vs. GPO FeatureGroup PolicyDSC Configuration stored inGPO fileConfiguration script / MOF file Target nodes by means ofAD links to OUs, sites, etc.Configuration specifies node names Configuration implemented byClient-side OS componentsClient-side shell scripts (resources) Extensible by means ofComplex native programmingWindows PowerShell scripts Primary configuration targetWindows registry Anything Windows PowerShell can “touch” PersistenceSettings reapply each timeSettings are persistent Number of configurations per nodeAs many GPOs as you want to linkOne

23 Was passiert, wenn GPOs und DSC gleichzeitig im Einsatz sind…?

24 …eine Anleitung… Ich habe die Configurations gemacht – und jetzt?

25 Jetzt benötigen wir zuerst ein MOF! MOF = Managed Object Format

26 Weshalb ein MOF?  Generisches File Format  Wird auch von Unix und NW-Komponenten unterstützt  Kann auch durch andere Tools (nicht PS) generiert werden

27 Wie mache ich ein MOF?  …indem einfach der Name der CONFIGURATION aufgerufen wird…

28 Wie sieht ein MOF aus? /* @TargetNode='GM15-SRV07' @GeneratedBy=Administrator @GenerationDate=11/24/2015 15:56:05 @GenerationHost=GM15-SRV01 */ instance of MSFT_RoleResource as $MSFT_RoleResource1ref { ResourceID = "[WindowsFeature]IIS"; Ensure = "Present"; SourceInfo = "::7::1::WindowsFeature"; Name = "Web-Server"; ModuleName = "PsDesiredStateConfiguration"; ModuleVersion = "1.0"; ConfigurationName = "ContosoWebsite"; }; instance of OMI_ConfigurationDocument { Version="2.0.0"; MinimumCompatibleVersion = "1.0.0"; CompatibleVersionAdditionalProperties={"Omi_BaseResource:ConfigurationName"}; Author="Administrator"; GenerationDate="11/24/2015 15:56:05"; GenerationHost="GM15-SRV01"; Name="ContosoWebsite"; }; Configuration ContosoWebsite { Node GM15-SRV07 { WindowsFeature BasicWebServerComponents { Ensure = "Present" Name = "Web-Server" } CONFIGURATIONMOF

29 Wie kommt das MOF nun auf die Rechner?

30 PUSH oder PULL?

31 PUSH  Zentral auf die Rechner verteilen:  Start-DSCConfiguration –path.\ContosoWebsite –computername GM15-SRV07

32 PULL  Praktikabler in produktiven Umgebungen  Über…:  HTTP/HTTPS (!!!)  SMB

33 It’s all about…

34 DEMO: DSC


Herunterladen ppt "Für was, wen, wann und überhaupt? DEVOP PART IV: DSC – DESIRED STATE CONFIGURATION."

Ähnliche Präsentationen


Google-Anzeigen