dev ops italia 2015 - per capire desired state configuration
TRANSCRIPT
CONTENUTI
Definizione
Windows demo
Modello architetturale
Due tipi di server
Linux demo
Conclusioni
Come si inquadra nella piattaforma
DEFINIZIONE
Microsoft’s declarative configuration technology, built on Windows PowerShell and introduced in Windows Management Framework 4.0.
Available for Windows 7, Windows Server 2008 R2, and later.
ESEMPIO
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
DI CHE SI TRATTA?
Bene
Presenza garantita
2012 R2
Azure
Tecnologia di Base
Powershell
WMI / WBEM
Server
Male
Assenza di repository
Orchestration*
Workflow approvativo*
Così così
Linux
Client
PERCHÉ NON CHEF (O PUPPET O ANSIBLE O…)
Se fosse così semplice Chef e Puppet sarebbero la norma per amministrare server Windows, non trovate?
MODELLO ARCHITETTURALE
Local Configuration Manager Su tutti i nodi da configurare
Configurazione del servizio stesso (meta) modalità pull, periodicità, …
Applica i file MOF, se abilitato
PowerShell RemotingPraticamente indisponsabile
Idempotenza
RESOURCE PROTOTYPE
Function Get-TargetResource {}
Function Set-TargetResource {}
Function Test-TargetResource {}
DUE TIPI DI SERVER (DEPLOYMENT MODES)
PushSi copia il MOF nel nodo con Start-DscConfiguration LCM del nodo valuta immediatamente la configurazione e a intervalli di 15 minuti
Ulteriori risorse DSC vanno copiate manualmente
PullSi usa la modalità push per registrare nei nodi il pull server I nodi interrogano il server ogni 30 minuti e riapplicano la configurazione I file MOF vanno copiati sul server con un file contenente il checksum Le risorse DSC vanno impacchettate in uno zip e poste nel server cosicché i nodi possano attingervi
DSC E CHEF
Configuration FourthCoffee{
# Install the IIS role WindowsFeature IIS{
Ensure = "Present"Name = "Web-Server"
}
# Install the ASP .NET 4.5 role WindowsFeature AspNet45{
Ensure = "Present"Name = "Web-Asp-Net45"
}...}
dsc_resource 'webserver' do
resource_name :windowsfeature
property :name, 'Web-Server'
property :ensure, 'Present'
end
dsc_resource 'dotnet45' do
resource_name :windowsfeature
property :name, 'Web-Asp-Net45'
property :ensure, 'Present'
end
COME SI INQUADRA NELLA PIATTAFORMA
System Center Virtual Machine Manager Spara i MOFs dentro a una macchina virtuale quando viene creata
Azure
Team Foundation Server Release Management Workflow approvativo
Coordinamento (orchestration) di più server
System Center Configuration Manager (vNext) Repository, Orchestration, …
Chef partnership
Community
RIFERIMENTI
e-Book gratuito “The DSC Book” http://powershell.org/wp/ebooks
Documentazione ufficiale e menohttps://technet.microsoft.com/en-us/library/dn249912.aspx
http://blogs.msdn.com/b/powershell/archive/tags/dsc/
DSC Resource Kithttps://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d