SlideShare a Scribd company logo
Nano Server
Puppet + DSC
Michael Smith, Developer @ Puppet
Nano Server: Puppet + DSC 2
What is Nano Server?

Why would we use it?

Limitations

How to start

How does Puppet fit in
Nano Server: Puppet + DSC 3
What is Nano Server?
Nano Server: Puppet + DSC 4
Nano Server: Puppet + DSC 5
A lightweight Windows Server
Source: http://windowsitpro.com/windows-server-2016/install-options-windows-server-2016
Nano Server: Puppet + DSC 6
A much faster virtual server
Source: http://www.techradar.com/news/software/operating-systems/why-nano-server-is-the-most-vital-change-to-windows-server-since-windows-nt-3-5-1295803
Nano Server: Puppet + DSC 7
Why Do I Care?
8
Nano Server: Puppet + DSC 9
Limitations
Nano Server: Puppet + DSC
No GUI, just PowerShell/cmd

64-bit only

No MSI, new Windows Server Apps (WSA)

Minimal configuration (no ADSI, no Group Policy)

.Net CoreCLR

Deprecated functions removed - https://goo.gl/48IZV6

Limited PowerShell support
10
Nano Server: Puppet + DSC 11
Getting Nano Server
Nano Server: Puppet + DSC 12
Hyper-V: Command-Line https://goo.gl/RDOUwA
$password = ConvertTo-SecureString -AsPlaintext -Force 'vagrant'
New-NanoServerImage 
-MediaPath 'E:' 
-Edition 'Datacenter' 
-DeploymentType Guest 
-AdministratorPassword 'vagrant' 
-TargetPath 'C:NanoVM.vhd' 
-MaxSize 8589934592 
-SetupUI ('NanoServer.Containers', 'NanoServer.DSC') 
-SetupCompleteCommand ('tzutil.exe /s "Pacific Standard Time"') 
-LogPath 'C:TempNanoServerImageBuilderLogs2016-10-16 12-29'
Nano Server: Puppet + DSC 13
Nano Server Image Builder https://goo.gl/IEFU9d
Nano Server: Puppet + DSC 14
Server Feature Packages
Nano Server: Puppet + DSC 15
Configuration SimpleVM {
param (
[string[]]$NodeName = 'localhost',
[string]$VhdPath
)
Import-DscResource -ModuleName xHyper-V
Node $NodeName {
xVMSwitch internal {
Ensure = 'Present'
Name = 'internal'
Type = 'Internal'
}
xVMHyperV SimpleVM {
Ensure = 'Present'
Name = 'SimpleVM'
VhdPath = $VhdPath
SwitchName = 'internal'
State = 'Running'
Generation = 1
StartupMemory = 512MB
ProcessorCount = 1
DependsOn = '[xVMSwitch]internal'
}
}
}
SimpleVM -VhdPath 'C:/VM/NanoServerDataCenter.vhd'
Desired State Configuration (DSC)
Nano Server: Puppet + DSC 16
puppetlabs-dsc
dsc_xVMHyperV { 'SimpleVM':
dsc_ensure => present,
dsc_name => 'SimpleVM',
dsc_vhdpath => 'C:/VM/
NanoServerDataCenter.vhd',
dsc_switchname => 'internal',
dsc_state => 'running',
dsc_generation => 1,
dsc_startupmemory => 536870912,
dsc_processorcount => 1,
require => Dsc_XVMSwitch['internal'],
}
dsc_xVMSwitch { 'internal':
dsc_ensure => 'present',
dsc_name => 'internal',
dsc_type => 'Internal',
}
Nano Server: Puppet + DSC 17
Demos
GitHub:MikaelSmith/puppetconf2016
Nano Server: Puppet + DSC 18
Hyper-V Demo
https://github.com/MikaelSmith/puppetconf2016#hyper-v-demo
Nano Server: Puppet + DSC 19
Hacks upon Hacks
https://github.com/PowerShell/xStorage/pull/60

https://tickets.puppetlabs.com/browse/MODULES-3690

https://tickets.puppetlabs.com/browse/MODULES-3831

Everything’s broken

… but getting fixed.
Nano Server: Puppet + DSC 20
Vagrant/Virtualbox
Enable-PSRemoting -Force
Set-Item wsman:localhostclienttrustedhosts -Value localhost -Force
$pw = ConvertTo-SecureString -asPlainText -Force "vagrant"
$c = New-Object System.Management.Automation.PSCredential("vagrant", $pw)
Enter-PSSession -ComputerName localhost -Port 55985 -Credential $c
Vagrant Boxes: https://goo.gl/RSGdHN

PowerShell Remoting
rwinrm vagrant@127.0.0.1:55985
https://github.com/WinRb/WinRM
Demo: https://github.com/MikaelSmith/puppetconf2016#build-vagrant-box
Nano Server: Puppet + DSC 21
Vagrant Demo
Nano Server: Puppet + DSC 22
Docker https://goo.gl/Vp5CQB
Source: http://windowsitpro.com/windows-server-2016/differences-between-windows-containers-and-hyper-v-containers-windows-server-201
Nano Server: Puppet + DSC
FROM microsoft/nanoserver
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
ENV NPM_CONFIG_LOGLEVEL info
ENV NODE_VERSION 4.6.1
ENV NODE_SHA256 f576f2dacc4262202ae21f7d64ab9a01b7e551795848dfa39ef39a2cd63fa42c
RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; 
[System.IO.Compression.ZipFile]::ExtractToDirectory('C:node.zip', 'C:') ; 
Rename-Item -Path $('C:node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:nodejs' ; 
New-Item $($env:APPDATA + 'npm') ; 
$env:PATH = 'C:nodejs;{0}npm;{1}' -f $env:APPDATA, $env:PATH ; 
Set-ItemProperty -Path 'HKLM:SYSTEMCurrentControlSetControlSession ManagerEnvironment' -Name Path -Value $env:PATH ; 
Remove-Item -Path node.zip
CMD [ "node.exe" ]
23
Dockerfiles https://goo.gl/kcTctx
Source: https://github.com/StefanScherer/dockerfiles-windows/blob/e7a938a9e32fe89e6d5aa232054971ad91e98ac7/node/4.6/nano/Dockerfile
Base Node Container
Nano Server: Puppet + DSC 24
FROM node:4.6.1-nano



RUN mkdir app 

WORKDIR /app



ONBUILD COPY package.json package.json 

ONBUILD RUN npm install 

ONBUILD COPY . .



CMD [ "npm.cmd", "start" ]
Dockerfiles, Cont.
Source: https://github.com/StefanScherer/dockerfiles-windows/blob/e7a938a9e32fe89e6d5aa232054971ad91e98ac7/node/4.6/nano/onbuild/Dockerfile
FROM nano:4.6.1-nano-onbuild
Node Onbuild Template
Application Builder
Nano Server: Puppet + DSC 25
Docker Demo
https://github.com/MikaelSmith/puppetconf2016#docker-demo
Nano Server: Puppet + DSC
https://github.com/MikaelSmith/puppet-agent/tree/nano-hacks

https://github.com/MikaelSmith/puppetconf2016#docker-demo

Track 5: Modern Infrastructure

Running Puppet Software in Docker Containers - Gareth Rushgrove

Kubernetes: Add Windows Containers Support

https://github.com/kubernetes/kubernetes/issues/22623
26
Containers
Nano Server: Puppet + DSC 27
Adding Puppet
Nano Server: Puppet + DSC 28
Things that work
Core Resources
file, host, exec

Modules
- puppetlabs-reboot

- Puppetlabs-acl

Maybe
- puppetlabs-powershell (after MODULES-3690, 3990)

- puppetlabs-dsc (after MODULES-3831)
Nano Server: Puppet + DSC 29
Registry + DSC
dsc_registry { 'enable long paths':
dsc_ensure => present,
dsc_key => 'HKEY_LOCAL_MACHINESystemCurrentControlSetPolicies',
dsc_valuename => 'LongPathsEnabled',
dsc_valuedata => '1',
Dsc_valuetype => 'DWORD',
}
Source: http://winaero.com/blog/how-to-enable-ntfs-long-paths-in-windows-10/
Nano Server: Puppet + DSC
Core Resources
- user (requires ADSI)

- group (requires ADSI)

- package (no appx support yet)

- scheduled_task (requires mstask.dll)

Modules
- puppet-iis (based on PowerShell WebAdministration)

- many others
30
Things that don’t (yet)
Nano Server: Puppet + DSC 31
$username = 'vagrant'
$password = 'vagrant'
$groupname = 'puppet'
Users & Groups
exec { 'puppet group':
command => "New-LocalGroup -Name ${groupname}",
unless => "Get-LocalGroup -Name ${groupname}",
provider => powershell,
}
Nano Server: Puppet + DSC 32
exec { 'vagrant user in puppet group':
command => "Add-LocalGroupMember -Group ${groupname} -Member ${username}",
unless => "Get-LocalGroupMember -Group ${groupname} -Member ${username}",
provider => powershell,
require => [Exec['puppet group'], Exec['vagrant user']],
}
Users & Groups, Cont.
exec { 'vagrant user':
command => "New-LocalUser -Name ${username} -Password 
(ConvertTo-SecureString -AsPlainText "${password}" -Force)",
unless => "Get-LocalUser -Name ${username}",
provider => powershell,
}
Nano Server: Puppet + DSC 33
Puppet Demo
https://github.com/MikaelSmith/puppetconf2016#puppet-demo
Nano Server: Puppet + DSC 34
Packaging
https://github.com/mikaelsmith/puppetconf2016#packaging-demo
Nano Server: Puppet + DSC 35
Debugging Problems
https://github.com/mikaelsmith/puppetconf2016#debugging-problems-demo
Nano Server: Puppet + DSC
Ways to get started
Hyper-V directly, Docker, Virtualbox/Vagrant

Tools to improve
PowerShell, DSC modules, Puppet modules, Puppet core
resources, applications, Vagrant, Packer, etc.
36
Nano Server: Puppet + DSC 37
http://www.hurryupandwait.io/
https://cloudbase.it/
Nano Server: Puppet + DSC 38
Thanks!
Questions?

More Related Content

PDF
PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...
PDF
PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...
PDF
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PDF
Iniciando com Docker
PDF
Dockerize Laravel Application
PDF
Deploy django apps using docker
PPT
Python virtualenv & pip in 90 minutes
PPTX
Docker orchestration
PuppetConf 2016: Getting to the Latest Puppet – Nate McCurdy & Elizabeth Witt...
PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
Iniciando com Docker
Dockerize Laravel Application
Deploy django apps using docker
Python virtualenv & pip in 90 minutes
Docker orchestration

What's hot (20)

PPTX
Zero to Continuous Delivery on Google Cloud
PDF
Использование Docker в CI / Александр Акбашев (HERE Technologies)
PDF
Capistrano deploy Magento project in an efficient way
PDF
Vagrant for real (codemotion rome 2016)
PDF
Containerizing a Web Application with Vue.js and Java
PDF
DevOps: Cooking Drupal Deployment
PDF
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
PDF
dkr_django_slides
PDF
Kubelet with no Kubernetes Masters | DevNation Tech Talk
PPTX
Hide your development environment and application in a container
PDF
Continuous Integration/Deployment with Docker and Jenkins
PDF
Using Docker to build and test in your laptop and Jenkins
ODP
It Works On My Machine: Vagrant for Software Development
PDF
Pragmatic Monolith-First, easy to decompose, clean architecture
PDF
Magento 2 Capistrano Deploy
PDF
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
PDF
Docker deploy
PDF
GlassFish Embedded API
PDF
Modern Infrastructure from Scratch with Puppet
PDF
Intro 2 docker
Zero to Continuous Delivery on Google Cloud
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Capistrano deploy Magento project in an efficient way
Vagrant for real (codemotion rome 2016)
Containerizing a Web Application with Vue.js and Java
DevOps: Cooking Drupal Deployment
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
dkr_django_slides
Kubelet with no Kubernetes Masters | DevNation Tech Talk
Hide your development environment and application in a container
Continuous Integration/Deployment with Docker and Jenkins
Using Docker to build and test in your laptop and Jenkins
It Works On My Machine: Vagrant for Software Development
Pragmatic Monolith-First, easy to decompose, clean architecture
Magento 2 Capistrano Deploy
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
Docker deploy
GlassFish Embedded API
Modern Infrastructure from Scratch with Puppet
Intro 2 docker
Ad

Similar to PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Smith, Puppet (20)

PDF
PuppetConf 2016: Nano Server, Puppet, and DSC
PPTX
Puppet + Windows Nano Server
PPTX
Server 2016 sneak peek
PPTX
Using Nano Server for Hyper-V Training 0
PDF
Nano Server (ATD 11)
PDF
PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...
PDF
Nano Server - the future of Windows Server - Thomas Maurer
PDF
Techorama 2017 - What's new in Windows Server 2016
PPTX
Morning Coffee - Windows Server 2016
PPTX
WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...
PPTX
Novidades do Windows Server 2016
PPTX
Techdays SE 2016 - Micros.. err Microcosmos
PDF
Install and manage windows nano server 2016 step by step
PPTX
B875.pptx
PDF
Spark Summit EU talk by Jorg Schad
PDF
No one puts java in the container
PDF
CIF16: Building the Superfluid Cloud with Unikernels (Simon Kuenzer, NEC Europe)
PDF
DockerDay2015: Microsoft and Docker
PDF
Xen Virtualization 2008
PDF
OSSEU18: From Handcraft to Unikraft: Simpler Unikernelization of Your Applica...
PuppetConf 2016: Nano Server, Puppet, and DSC
Puppet + Windows Nano Server
Server 2016 sneak peek
Using Nano Server for Hyper-V Training 0
Nano Server (ATD 11)
PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...
Nano Server - the future of Windows Server - Thomas Maurer
Techorama 2017 - What's new in Windows Server 2016
Morning Coffee - Windows Server 2016
WinOps Conf 2016 - Richard Siddaway - DevOps With Nano Server and Windows Con...
Novidades do Windows Server 2016
Techdays SE 2016 - Micros.. err Microcosmos
Install and manage windows nano server 2016 step by step
B875.pptx
Spark Summit EU talk by Jorg Schad
No one puts java in the container
CIF16: Building the Superfluid Cloud with Unikernels (Simon Kuenzer, NEC Europe)
DockerDay2015: Microsoft and Docker
Xen Virtualization 2008
OSSEU18: From Handcraft to Unikraft: Simpler Unikernelization of Your Applica...
Ad

More from Puppet (20)

PPTX
Puppet Community Day: Planning the Future Together
PPTX
The Evolution of Puppet: Key Changes and Modernization Tips
PPTX
Can You Help Me Upgrade to Puppet 8? Tips, Tools & Best Practices for Your Up...
PPTX
Bolt Dynamic Inventory: Making Puppet Easier
PPTX
Customizing Reporting with the Puppet Report Processor
PPTX
Puppet at ConfigMgmtCamp 2025 Sponsor Deck
PPTX
The State of Puppet in 2025: A Presentation from Developer Relations Lead Dav...
PPTX
Let Red be Red and Green be Green: The Automated Workflow Restarter in GitHub...
PDF
Puppet camp2021 testing modules and controlrepo
PPTX
Puppetcamp r10kyaml
PDF
2021 04-15 operational verification (with notes)
PPTX
Puppet camp vscode
PDF
Modules of the twenties
PDF
Applying Roles and Profiles method to compliance code
PPTX
KGI compliance as-code approach
PDF
Enforce compliance policy with model-driven automation
PDF
Keynote: Puppet camp compliance
PPTX
Automating it management with Puppet + ServiceNow
PPTX
Puppet: The best way to harden Windows
PPTX
Simplified Patch Management with Puppet - Oct. 2020
Puppet Community Day: Planning the Future Together
The Evolution of Puppet: Key Changes and Modernization Tips
Can You Help Me Upgrade to Puppet 8? Tips, Tools & Best Practices for Your Up...
Bolt Dynamic Inventory: Making Puppet Easier
Customizing Reporting with the Puppet Report Processor
Puppet at ConfigMgmtCamp 2025 Sponsor Deck
The State of Puppet in 2025: A Presentation from Developer Relations Lead Dav...
Let Red be Red and Green be Green: The Automated Workflow Restarter in GitHub...
Puppet camp2021 testing modules and controlrepo
Puppetcamp r10kyaml
2021 04-15 operational verification (with notes)
Puppet camp vscode
Modules of the twenties
Applying Roles and Profiles method to compliance code
KGI compliance as-code approach
Enforce compliance policy with model-driven automation
Keynote: Puppet camp compliance
Automating it management with Puppet + ServiceNow
Puppet: The best way to harden Windows
Simplified Patch Management with Puppet - Oct. 2020

Recently uploaded (20)

PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Mushroom cultivation and it's methods.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
TLE Review Electricity (Electricity).pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Machine Learning_overview_presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
August Patch Tuesday
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Getting Started with Data Integration: FME Form 101
SOPHOS-XG Firewall Administrator PPT.pptx
Mushroom cultivation and it's methods.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Group 1 Presentation -Planning and Decision Making .pptx
Heart disease approach using modified random forest and particle swarm optimi...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Network Security Unit 5.pdf for BCA BBA.
A comparative analysis of optical character recognition models for extracting...
Machine learning based COVID-19 study performance prediction
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Assigned Numbers - 2025 - Bluetooth® Document
TLE Review Electricity (Electricity).pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Machine Learning_overview_presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
OMC Textile Division Presentation 2021.pptx
A comparative study of natural language inference in Swahili using monolingua...
August Patch Tuesday
Encapsulation_ Review paper, used for researhc scholars
Getting Started with Data Integration: FME Form 101

PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Smith, Puppet

  • 1. Nano Server Puppet + DSC Michael Smith, Developer @ Puppet
  • 2. Nano Server: Puppet + DSC 2 What is Nano Server? Why would we use it? Limitations How to start How does Puppet fit in
  • 3. Nano Server: Puppet + DSC 3 What is Nano Server?
  • 5. Nano Server: Puppet + DSC 5 A lightweight Windows Server Source: http://windowsitpro.com/windows-server-2016/install-options-windows-server-2016
  • 6. Nano Server: Puppet + DSC 6 A much faster virtual server Source: http://www.techradar.com/news/software/operating-systems/why-nano-server-is-the-most-vital-change-to-windows-server-since-windows-nt-3-5-1295803
  • 7. Nano Server: Puppet + DSC 7 Why Do I Care?
  • 8. 8
  • 9. Nano Server: Puppet + DSC 9 Limitations
  • 10. Nano Server: Puppet + DSC No GUI, just PowerShell/cmd 64-bit only No MSI, new Windows Server Apps (WSA) Minimal configuration (no ADSI, no Group Policy) .Net CoreCLR Deprecated functions removed - https://goo.gl/48IZV6 Limited PowerShell support 10
  • 11. Nano Server: Puppet + DSC 11 Getting Nano Server
  • 12. Nano Server: Puppet + DSC 12 Hyper-V: Command-Line https://goo.gl/RDOUwA $password = ConvertTo-SecureString -AsPlaintext -Force 'vagrant' New-NanoServerImage -MediaPath 'E:' -Edition 'Datacenter' -DeploymentType Guest -AdministratorPassword 'vagrant' -TargetPath 'C:NanoVM.vhd' -MaxSize 8589934592 -SetupUI ('NanoServer.Containers', 'NanoServer.DSC') -SetupCompleteCommand ('tzutil.exe /s "Pacific Standard Time"') -LogPath 'C:TempNanoServerImageBuilderLogs2016-10-16 12-29'
  • 13. Nano Server: Puppet + DSC 13 Nano Server Image Builder https://goo.gl/IEFU9d
  • 14. Nano Server: Puppet + DSC 14 Server Feature Packages
  • 15. Nano Server: Puppet + DSC 15 Configuration SimpleVM { param ( [string[]]$NodeName = 'localhost', [string]$VhdPath ) Import-DscResource -ModuleName xHyper-V Node $NodeName { xVMSwitch internal { Ensure = 'Present' Name = 'internal' Type = 'Internal' } xVMHyperV SimpleVM { Ensure = 'Present' Name = 'SimpleVM' VhdPath = $VhdPath SwitchName = 'internal' State = 'Running' Generation = 1 StartupMemory = 512MB ProcessorCount = 1 DependsOn = '[xVMSwitch]internal' } } } SimpleVM -VhdPath 'C:/VM/NanoServerDataCenter.vhd' Desired State Configuration (DSC)
  • 16. Nano Server: Puppet + DSC 16 puppetlabs-dsc dsc_xVMHyperV { 'SimpleVM': dsc_ensure => present, dsc_name => 'SimpleVM', dsc_vhdpath => 'C:/VM/ NanoServerDataCenter.vhd', dsc_switchname => 'internal', dsc_state => 'running', dsc_generation => 1, dsc_startupmemory => 536870912, dsc_processorcount => 1, require => Dsc_XVMSwitch['internal'], } dsc_xVMSwitch { 'internal': dsc_ensure => 'present', dsc_name => 'internal', dsc_type => 'Internal', }
  • 17. Nano Server: Puppet + DSC 17 Demos GitHub:MikaelSmith/puppetconf2016
  • 18. Nano Server: Puppet + DSC 18 Hyper-V Demo https://github.com/MikaelSmith/puppetconf2016#hyper-v-demo
  • 19. Nano Server: Puppet + DSC 19 Hacks upon Hacks https://github.com/PowerShell/xStorage/pull/60 https://tickets.puppetlabs.com/browse/MODULES-3690 https://tickets.puppetlabs.com/browse/MODULES-3831 Everything’s broken … but getting fixed.
  • 20. Nano Server: Puppet + DSC 20 Vagrant/Virtualbox Enable-PSRemoting -Force Set-Item wsman:localhostclienttrustedhosts -Value localhost -Force $pw = ConvertTo-SecureString -asPlainText -Force "vagrant" $c = New-Object System.Management.Automation.PSCredential("vagrant", $pw) Enter-PSSession -ComputerName localhost -Port 55985 -Credential $c Vagrant Boxes: https://goo.gl/RSGdHN PowerShell Remoting rwinrm vagrant@127.0.0.1:55985 https://github.com/WinRb/WinRM Demo: https://github.com/MikaelSmith/puppetconf2016#build-vagrant-box
  • 21. Nano Server: Puppet + DSC 21 Vagrant Demo
  • 22. Nano Server: Puppet + DSC 22 Docker https://goo.gl/Vp5CQB Source: http://windowsitpro.com/windows-server-2016/differences-between-windows-containers-and-hyper-v-containers-windows-server-201
  • 23. Nano Server: Puppet + DSC FROM microsoft/nanoserver SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"] ENV NPM_CONFIG_LOGLEVEL info ENV NODE_VERSION 4.6.1 ENV NODE_SHA256 f576f2dacc4262202ae21f7d64ab9a01b7e551795848dfa39ef39a2cd63fa42c RUN Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-x64.zip' -f $env:NODE_VERSION) -OutFile 'node.zip' -UseBasicParsing ; [System.IO.Compression.ZipFile]::ExtractToDirectory('C:node.zip', 'C:') ; Rename-Item -Path $('C:node-v{0}-win-x64' -f $env:NODE_VERSION) -NewName 'C:nodejs' ; New-Item $($env:APPDATA + 'npm') ; $env:PATH = 'C:nodejs;{0}npm;{1}' -f $env:APPDATA, $env:PATH ; Set-ItemProperty -Path 'HKLM:SYSTEMCurrentControlSetControlSession ManagerEnvironment' -Name Path -Value $env:PATH ; Remove-Item -Path node.zip CMD [ "node.exe" ] 23 Dockerfiles https://goo.gl/kcTctx Source: https://github.com/StefanScherer/dockerfiles-windows/blob/e7a938a9e32fe89e6d5aa232054971ad91e98ac7/node/4.6/nano/Dockerfile Base Node Container
  • 24. Nano Server: Puppet + DSC 24 FROM node:4.6.1-nano
 
 RUN mkdir app 
 WORKDIR /app
 
 ONBUILD COPY package.json package.json 
 ONBUILD RUN npm install 
 ONBUILD COPY . .
 
 CMD [ "npm.cmd", "start" ] Dockerfiles, Cont. Source: https://github.com/StefanScherer/dockerfiles-windows/blob/e7a938a9e32fe89e6d5aa232054971ad91e98ac7/node/4.6/nano/onbuild/Dockerfile FROM nano:4.6.1-nano-onbuild Node Onbuild Template Application Builder
  • 25. Nano Server: Puppet + DSC 25 Docker Demo https://github.com/MikaelSmith/puppetconf2016#docker-demo
  • 26. Nano Server: Puppet + DSC https://github.com/MikaelSmith/puppet-agent/tree/nano-hacks https://github.com/MikaelSmith/puppetconf2016#docker-demo Track 5: Modern Infrastructure Running Puppet Software in Docker Containers - Gareth Rushgrove Kubernetes: Add Windows Containers Support https://github.com/kubernetes/kubernetes/issues/22623 26 Containers
  • 27. Nano Server: Puppet + DSC 27 Adding Puppet
  • 28. Nano Server: Puppet + DSC 28 Things that work Core Resources file, host, exec Modules - puppetlabs-reboot - Puppetlabs-acl Maybe - puppetlabs-powershell (after MODULES-3690, 3990) - puppetlabs-dsc (after MODULES-3831)
  • 29. Nano Server: Puppet + DSC 29 Registry + DSC dsc_registry { 'enable long paths': dsc_ensure => present, dsc_key => 'HKEY_LOCAL_MACHINESystemCurrentControlSetPolicies', dsc_valuename => 'LongPathsEnabled', dsc_valuedata => '1', Dsc_valuetype => 'DWORD', } Source: http://winaero.com/blog/how-to-enable-ntfs-long-paths-in-windows-10/
  • 30. Nano Server: Puppet + DSC Core Resources - user (requires ADSI) - group (requires ADSI) - package (no appx support yet) - scheduled_task (requires mstask.dll) Modules - puppet-iis (based on PowerShell WebAdministration) - many others 30 Things that don’t (yet)
  • 31. Nano Server: Puppet + DSC 31 $username = 'vagrant' $password = 'vagrant' $groupname = 'puppet' Users & Groups exec { 'puppet group': command => "New-LocalGroup -Name ${groupname}", unless => "Get-LocalGroup -Name ${groupname}", provider => powershell, }
  • 32. Nano Server: Puppet + DSC 32 exec { 'vagrant user in puppet group': command => "Add-LocalGroupMember -Group ${groupname} -Member ${username}", unless => "Get-LocalGroupMember -Group ${groupname} -Member ${username}", provider => powershell, require => [Exec['puppet group'], Exec['vagrant user']], } Users & Groups, Cont. exec { 'vagrant user': command => "New-LocalUser -Name ${username} -Password (ConvertTo-SecureString -AsPlainText "${password}" -Force)", unless => "Get-LocalUser -Name ${username}", provider => powershell, }
  • 33. Nano Server: Puppet + DSC 33 Puppet Demo https://github.com/MikaelSmith/puppetconf2016#puppet-demo
  • 34. Nano Server: Puppet + DSC 34 Packaging https://github.com/mikaelsmith/puppetconf2016#packaging-demo
  • 35. Nano Server: Puppet + DSC 35 Debugging Problems https://github.com/mikaelsmith/puppetconf2016#debugging-problems-demo
  • 36. Nano Server: Puppet + DSC Ways to get started Hyper-V directly, Docker, Virtualbox/Vagrant Tools to improve PowerShell, DSC modules, Puppet modules, Puppet core resources, applications, Vagrant, Packer, etc. 36
  • 37. Nano Server: Puppet + DSC 37 http://www.hurryupandwait.io/ https://cloudbase.it/
  • 38. Nano Server: Puppet + DSC 38 Thanks! Questions?