Managing Windows
Systems with Puppet
James Sweeny
Professional Services | Puppet Labs
james.sweeny@puppetlabs.com
supercow...
puppetconf.com #puppetconf
Introduction
• Windows Agent overview
• Puppet resource model overview
• Managing Linux vs. man...
puppetconf.com #puppetconf
Supported Platforms
• Server 2003 and 2003 R2
• Server 2008
• Windows 7/Server 2008 R2
• Window...
puppetconf.com #puppetconf
Installation
Friday, August 23, 13
puppetconf.com #puppetconf
msiexec /qn /l*v install.log /i puppet-3.2.4.msi
INSTALLDIR="C:Program FilesPuppet LabsPuppet E...
puppetconf.com #puppetconf
Friday, August 23, 13
puppetconf.com #puppetconf
• C:Program Files (x86)Puppet LabsPuppet
– sys
– bin
Friday, August 23, 13
puppetconf.com #puppetconf
• C:ProgramDataPuppetLabs
- or -
• C:Documents and SettingsAll Users
Application DataPuppetLabs...
puppetconf.com #puppetconf
Anatomy of a Puppet run
Friday, August 23, 13
puppetconf.com #puppetconf
Resources
The fundamental building
block
Friday, August 23, 13
puppetconf.com #puppetconf
Resource Abstraction
Friday, August 23, 13
puppetconf.com #puppetconf
Providers
Friday, August 23, 13
puppetconf.com #puppetconf
Linux Resources
Friday, August 23, 13
puppetconf.com #puppetconf
So what makes Windows
special?
Friday, August 23, 13
puppetconf.com #puppetconf
Host Resource
Friday, August 23, 13
puppetconf.com #puppetconf
Service Resource
Friday, August 23, 13
puppetconf.com #puppetconf
Windows
Service
Friday, August 23, 13
puppetconf.com #puppetconf
Cron Resource
Friday, August 23, 13
puppetconf.com #puppetconf
Cron
Scheduled Task Resource
Friday, August 23, 13
puppetconf.com #puppetconf
Files
• Line Endings
• Paths
Always ask yourself: “Where is this
evaluated”?
Friday, August 23,...
puppetconf.com #puppetconf
Files - Paths
• 'C:WINDOWSsystem32'
• 'C:/WINDOWS/system32'
• "C:WINDOWSsystem32"
All are OK, b...
puppetconf.com #puppetconf
Files - Paths
... except when a Windows program will
read them.
Friday, August 23, 13
puppetconf.com #puppetconf
Files - Line Endings^M
^M
^M
• CRLF vs. LF^M
• Windows uses two characters for^M
newlines^M
• P...
puppetconf.com #puppetconf
Files - Line Endings
• File resources are written in binary
• source with Windows newlines will...
puppetconf.com #puppetconf
File Resource -
Permissions
• Still specified with Unix-style modes
• Mode must be specified if o...
puppetconf.com #puppetconf
Friday, August 23, 13
puppetconf.com #puppetconf
File Resource -
Permissions
• Be careful of case
• Can't set SID
Friday, August 23, 13
puppetconf.com #puppetconf
Exec Resource
Friday, August 23, 13
puppetconf.com #puppetconf
• Execs run without a shell
Friday, August 23, 13
puppetconf.com #puppetconf
32-bit Redirection
• %WINDIR%Sysnative
• %WINDIR%System32
Friday, August 23, 13
puppetconf.com #puppetconf
Powershell Exec
Friday, August 23, 13
puppetconf.com #puppetconf
Powershell Exec Provider
Friday, August 23, 13
puppetconf.com #puppetconf
Modules
Modules are the best way to organize your
code and extend core Puppet
forge.puppetlabs....
puppetconf.com #puppetconf
puppetlabs/registry
Friday, August 23, 13
puppetconf.com #puppetconf
puppetlabs/registry
Friday, August 23, 13
puppetconf.com #puppetconf
puppetlabs/registry
Friday, August 23, 13
puppetconf.com #puppetconf
adenning/winntp
Friday, August 23, 13
puppetconf.com #puppetconf
simondean/net_share
Friday, August 23, 13
puppetconf.com #puppetconf
trlinkin/
domain_membership
Friday, August 23, 13
puppetconf.com #puppetconf
More Windows Modules
• puppetlabs/mssql
• simondean/iis
• adenning/winfacts
• jonnyx/msuac
Sear...
puppetconf.com #puppetconf
MSI Package Provider
Friday, August 23, 13
puppetconf.com #puppetconf
MSI Package Provider
Friday, August 23, 13
puppetconf.com #puppetconf
Windows Package
Provider
• Deprecates msi provider
• Available in Puppet 3.0
• Backports availa...
puppetconf.com #puppetconf
Centralized Packages
• Versionable and Upgradable
• Linux has it easy
• yum
• apt-get
• zypper
...
puppetconf.com #puppetconf
Chocolately
• Third party Windows package manager
• http://chocolatey.org/
cinst my_package
See...
puppetconf.com #puppetconf
rismoney/chocolatey
Friday, August 23, 13
puppetconf.com #puppetconf
DISM
• Server 2008+ Roles and Features
• Install Windows server roles such as
• DNS Server
• DH...
puppetconf.com #puppetconf
puppetlabs/dism
Friday, August 23, 13
puppetconf.com #puppetconf
Rebooting
Friday, August 23, 13
puppetconf.com #puppetconf
Pending Reboots
Friday, August 23, 13
puppetconf.com #puppetconf
Pending Reboots
Friday, August 23, 13
puppetconf.com #puppetconf
Windows Reboot
Friday, August 23, 13
puppetconf.com #puppetconf
Additional Resources
• http://docs.puppetlabs.com/windows
• http://docs.puppetlabs.com/referenc...
Thank You - Questions?
James Sweeny
Professional Services | Puppet Labs
james.sweeny@puppetlabs.com
supercow on irc.freeno...
Follow us on Twitter @puppetlabs
youtube.com/puppetlabsinc
slideshare.net/puppetlabs
Collaborate. Automate. Ship.
Friday, ...
Upcoming SlideShare
Loading in...5
×

Managing Windows Systems with Puppet - PuppetConf 2013

32,119

Published on

"Managing Windows Systems with Puppet" by James Sweeny Professional Services Engineer, Puppet Labs.

Presentation Overview: Since Puppet grew up in the *nix world, there is a common misconception that it can't be used to effectively manage Windows. This talk hopes to dispel confusion on the matter and demonstrate that Windows can be managed effectively and easily with Puppet. Along with basic how-tos and tips on working with Windows systems using Puppet, Windows specific issues and caveats will be discussed with effective mitigations.

Speaker Bio: James is a recovering sysadmin currently working as a Professional Services Engineer at Puppet Labs. He performs training and advises on configuration and systems management best practices in his day job. Though his focus is primarily on Linux systems, he frequently is tasked to work on Solaris, OS/X, and Windows. He is unafraid to admit that he runs Windows 7 on his primary desktop.

Published in: Technology

Managing Windows Systems with Puppet - PuppetConf 2013

  1. 1. Managing Windows Systems with Puppet James Sweeny Professional Services | Puppet Labs james.sweeny@puppetlabs.com supercow on irc.freenode.net @jsween_y Friday, August 23, 13
  2. 2. puppetconf.com #puppetconf Introduction • Windows Agent overview • Puppet resource model overview • Managing Linux vs. managing Windows • Windows specific challenges and solutions • Windows oddities that will bite you Friday, August 23, 13
  3. 3. puppetconf.com #puppetconf Supported Platforms • Server 2003 and 2003 R2 • Server 2008 • Windows 7/Server 2008 R2 • Windows Server 2012 Friday, August 23, 13
  4. 4. puppetconf.com #puppetconf Installation Friday, August 23, 13
  5. 5. puppetconf.com #puppetconf msiexec /qn /l*v install.log /i puppet-3.2.4.msi INSTALLDIR="C:Program FilesPuppet LabsPuppet Enterprise" PUPPET_MASTER_SERVER="master.domain.com" PUPPET_AGENT_CERTNAME="agenthost.domain.com" Friday, August 23, 13
  6. 6. puppetconf.com #puppetconf Friday, August 23, 13
  7. 7. puppetconf.com #puppetconf • C:Program Files (x86)Puppet LabsPuppet – sys – bin Friday, August 23, 13
  8. 8. puppetconf.com #puppetconf • C:ProgramDataPuppetLabs - or - • C:Documents and SettingsAll Users Application DataPuppetLabs – puppetvar • cached data • plugins – puppetetc • puppet.conf • ssl data Friday, August 23, 13
  9. 9. puppetconf.com #puppetconf Anatomy of a Puppet run Friday, August 23, 13
  10. 10. puppetconf.com #puppetconf Resources The fundamental building block Friday, August 23, 13
  11. 11. puppetconf.com #puppetconf Resource Abstraction Friday, August 23, 13
  12. 12. puppetconf.com #puppetconf Providers Friday, August 23, 13
  13. 13. puppetconf.com #puppetconf Linux Resources Friday, August 23, 13
  14. 14. puppetconf.com #puppetconf So what makes Windows special? Friday, August 23, 13
  15. 15. puppetconf.com #puppetconf Host Resource Friday, August 23, 13
  16. 16. puppetconf.com #puppetconf Service Resource Friday, August 23, 13
  17. 17. puppetconf.com #puppetconf Windows Service Friday, August 23, 13
  18. 18. puppetconf.com #puppetconf Cron Resource Friday, August 23, 13
  19. 19. puppetconf.com #puppetconf Cron Scheduled Task Resource Friday, August 23, 13
  20. 20. puppetconf.com #puppetconf Files • Line Endings • Paths Always ask yourself: “Where is this evaluated”? Friday, August 23, 13
  21. 21. puppetconf.com #puppetconf Files - Paths • 'C:WINDOWSsystem32' • 'C:/WINDOWS/system32' • "C:WINDOWSsystem32" All are OK, but forward slashes are safer... Friday, August 23, 13
  22. 22. puppetconf.com #puppetconf Files - Paths ... except when a Windows program will read them. Friday, August 23, 13
  23. 23. puppetconf.com #puppetconf Files - Line Endings^M ^M ^M • CRLF vs. LF^M • Windows uses two characters for^M newlines^M • Puppet master always runs in Linux^M Friday, August 23, 13
  24. 24. puppetconf.com #puppetconf Files - Line Endings • File resources are written in binary • source with Windows newlines will be preserved • content will always generate Linux newlines, unless you add them Friday, August 23, 13
  25. 25. puppetconf.com #puppetconf File Resource - Permissions • Still specified with Unix-style modes • Mode must be specified if owner/group are Friday, August 23, 13
  26. 26. puppetconf.com #puppetconf Friday, August 23, 13
  27. 27. puppetconf.com #puppetconf File Resource - Permissions • Be careful of case • Can't set SID Friday, August 23, 13
  28. 28. puppetconf.com #puppetconf Exec Resource Friday, August 23, 13
  29. 29. puppetconf.com #puppetconf • Execs run without a shell Friday, August 23, 13
  30. 30. puppetconf.com #puppetconf 32-bit Redirection • %WINDIR%Sysnative • %WINDIR%System32 Friday, August 23, 13
  31. 31. puppetconf.com #puppetconf Powershell Exec Friday, August 23, 13
  32. 32. puppetconf.com #puppetconf Powershell Exec Provider Friday, August 23, 13
  33. 33. puppetconf.com #puppetconf Modules Modules are the best way to organize your code and extend core Puppet forge.puppetlabs.com puppet module search <keyword> puppet module install <author-module> Friday, August 23, 13
  34. 34. puppetconf.com #puppetconf puppetlabs/registry Friday, August 23, 13
  35. 35. puppetconf.com #puppetconf puppetlabs/registry Friday, August 23, 13
  36. 36. puppetconf.com #puppetconf puppetlabs/registry Friday, August 23, 13
  37. 37. puppetconf.com #puppetconf adenning/winntp Friday, August 23, 13
  38. 38. puppetconf.com #puppetconf simondean/net_share Friday, August 23, 13
  39. 39. puppetconf.com #puppetconf trlinkin/ domain_membership Friday, August 23, 13
  40. 40. puppetconf.com #puppetconf More Windows Modules • puppetlabs/mssql • simondean/iis • adenning/winfacts • jonnyx/msuac Search 'windows' on forge.puppetlabs.com Friday, August 23, 13
  41. 41. puppetconf.com #puppetconf MSI Package Provider Friday, August 23, 13
  42. 42. puppetconf.com #puppetconf MSI Package Provider Friday, August 23, 13
  43. 43. puppetconf.com #puppetconf Windows Package Provider • Deprecates msi provider • Available in Puppet 3.0 • Backports available for Puppet 2.7 • Supports .exe and .msi seamlessly Friday, August 23, 13
  44. 44. puppetconf.com #puppetconf Centralized Packages • Versionable and Upgradable • Linux has it easy • yum • apt-get • zypper Friday, August 23, 13
  45. 45. puppetconf.com #puppetconf Chocolately • Third party Windows package manager • http://chocolatey.org/ cinst my_package See Rob Reynolds tomorrow in the Fountain Room at 5:10PM! Friday, August 23, 13
  46. 46. puppetconf.com #puppetconf rismoney/chocolatey Friday, August 23, 13
  47. 47. puppetconf.com #puppetconf DISM • Server 2008+ Roles and Features • Install Windows server roles such as • DNS Server • DHCP Server • IIS Friday, August 23, 13
  48. 48. puppetconf.com #puppetconf puppetlabs/dism Friday, August 23, 13
  49. 49. puppetconf.com #puppetconf Rebooting Friday, August 23, 13
  50. 50. puppetconf.com #puppetconf Pending Reboots Friday, August 23, 13
  51. 51. puppetconf.com #puppetconf Pending Reboots Friday, August 23, 13
  52. 52. puppetconf.com #puppetconf Windows Reboot Friday, August 23, 13
  53. 53. puppetconf.com #puppetconf Additional Resources • http://docs.puppetlabs.com/windows • http://docs.puppetlabs.com/references/ latest/type.html • http://puppetlabs.com/blog/part-top- questions-on-puppet-and-windows/ • Puppet Types and Providers by Dan Bode and Nan Liu Friday, August 23, 13
  54. 54. Thank You - Questions? James Sweeny Professional Services | Puppet Labs james.sweeny@puppetlabs.com supercow on irc.freenode.net @jsween_y Collaborate. Automate. Ship. Friday, August 23, 13
  55. 55. Follow us on Twitter @puppetlabs youtube.com/puppetlabsinc slideshare.net/puppetlabs Collaborate. Automate. Ship. Friday, August 23, 13
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×