PowerShell Desired State Configuration for Linux By: Kolby - - PowerPoint PPT Presentation

powershell desired state configuration for linux
SMART_READER_LITE
LIVE PREVIEW

PowerShell Desired State Configuration for Linux By: Kolby - - PowerPoint PPT Presentation

PowerShell Desired State Configuration for Linux By: Kolby Allen August 19, 2015 LINUXCON North America Outline - What is PowerShell and Desired State Configuration?


slide-1
SLIDE 1

PowerShell ¡Desired ¡State ¡ Configuration ¡for ¡Linux

By: ¡Kolby ¡Allen

August ¡19, ¡2015 LINUXCON ¡North ¡America

slide-2
SLIDE 2

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 2

Outline

  • ­‑ What ¡is ¡PowerShell ¡and ¡Desired ¡State ¡Configuration?
  • ­‑ Why ¡would ¡I ¡use ¡PowerShell ¡for ¡Linux?
  • ­‑ Review ¡of ¡Desired ¡State ¡Configuration
  • ­‑ Server ¡Setup
  • ­‑ Client ¡Setup
  • ­‑ Examples
  • ­‑ Webserver ¡Configuration
  • ­‑ End ¡to ¡End ¡Provisioning ¡(Hyper-­‑V ¡to ¡Webserver)
  • ­‑ Q/A
slide-3
SLIDE 3

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 3

What ¡is ¡PowerShell?

  • ­‑ PowerShell ¡– task ¡automation ¡and ¡management ¡tool
  • ­‑ Allow ¡for ¡both ¡local ¡and ¡remote ¡management
  • ­‑ Scripting ¡language
  • ­‑ V1 ¡shipped ¡in ¡2006 ¡as ¡optional
  • ­‑ V2 ¡shipped ¡with ¡Win7 ¡and ¡Server ¡2008
  • ­‑ V5 ¡currently ¡in ¡preview ¡(unless ¡your ¡on ¡Win10?)

Reboot ¡Local ¡Machine: Restart-Computer Reboot ¡Remote ¡Machine: Restart-Computer -ComputerName Server01 Reboot ¡Remote ¡Machines ¡(multiple):

Restart-Computer -ComputerName Server01, Server02, localhost

slide-4
SLIDE 4

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 4

What ¡is ¡Desired ¡State ¡Configuration?

  • ­‑ PowerShell ¡Desired ¡State ¡Configuration ¡was ¡released ¡to ¡allow ¡for ¡

deployment ¡and ¡management ¡of ¡configuration ¡data

  • ­‑ Follows ¡DMTF ¡management ¡standards ¡and ¡WS-­‑Management ¡Protocol
  • ­‑ Applications:
  • ­‑ Server ¡role/feature ¡management
  • ­‑ Setting/Changing ¡registry ¡items
  • ­‑ Process/service ¡management
  • ­‑ User/Group ¡Management
  • ­‑ Software ¡Deployment ¡and ¡setup
  • ­‑ Remote ¡script ¡execution
  • ­‑ Managing ¡configuration ¡drift
  • ­‑ Actual ¡configuration ¡reporting
slide-5
SLIDE 5

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 5

Why ¡use ¡DSC? WHY ¡NOT ¡ONE ¡OF ¡THESE?

slide-6
SLIDE 6

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 6

Why ¡use ¡DSC? Because ¡of ¡this…

slide-7
SLIDE 7

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 7

Review ¡of ¡DSC ¡– Server ¡Setup ¡-­‑ PUSH

Push ¡Server

Start-DscConfiguration Local Target Configurations Local Configuration Manager (LCM) Remote Machine LCM Remote Machine LCM configuration configuration

http://blogs.msdn.com/b/powershell/archive/2013/11/26/push-­‑and-­‑pull-­‑configuration-­‑modes.aspx

slide-8
SLIDE 8

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 8

Review ¡of ¡DSC ¡– Server ¡Setup ¡-­‑ PUSH

http://blogs.msdn.com/b/powershell/archive/2013/11/26/push-­‑and-­‑pull-­‑configuration-­‑modes.aspx

Author Configuration Generate MOF Push Configuration

slide-9
SLIDE 9

DSC OData Endpoint IIS Service Configurations Remote Machine LCM Remote Machine LCM Resources get send get send

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 9

Review ¡of ¡DSC ¡– Server ¡Setup ¡-­‑ PULL

Pull ¡Server

http://blogs.msdn.com/b/powershell/archive/2013/11/26/push-­‑and-­‑pull-­‑configuration-­‑modes.aspx

slide-10
SLIDE 10

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 10

Review ¡of ¡DSC ¡– Server ¡Setup ¡-­‑ PULL

http://blogs.msdn.com/b/powershell/archive/2013/11/26/push-­‑and-­‑pull-­‑configuration-­‑modes.aspx

Author Configuration for Target Setup Pull Server Setup DSC

  • n target
slide-11
SLIDE 11

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 11

Review ¡of ¡DSC ¡– Client ¡Setup Support ¡Operating ¡Systems

  • CentOS5, ¡6, ¡& ¡7
  • Debian GNU/Linux ¡6 ¡& ¡7
  • Oracle ¡Linux ¡5, ¡6, ¡& ¡7
  • RHEL ¡5, ¡6, ¡& ¡7
  • SUSE ¡10, ¡11, ¡& ¡12
  • Ubuntu ¡12.04 ¡LTS ¡& ¡14.04 ¡LTS

Required ¡Packages:

  • ­‑

glibc

  • ­‑

python

  • ­‑
  • mniserver -­‑ Open ¡Management ¡

Infrastructure

  • ­‑
  • penssl
  • ­‑

ctypes

  • ­‑

libcurl DSC ¡for ¡Linux ¡Binaries https://github.com/MSFTOSSMgmt/WPSDSCLinux

slide-12
SLIDE 12

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 12

Review ¡of ¡DSC ¡– Client ¡Setup ¡– LINUX ¡Resources DSC ¡Resources ¡– building ¡blocks ¡to ¡DSC ¡Configurations Linux ¡Resources

  • nxFile – manages ¡files ¡and ¡directory ¡state
  • nxScript – run ¡script ¡blocks ¡on ¡target ¡nodes
  • nxUser – manages ¡linuxusers
  • nxGroup – manages ¡linuxgroups
  • nxService – manages ¡linux services ¡(System-­‑V, ¡upstart, ¡systemd)

Currently ¡in ¡beta ¡but ¡growing.

slide-13
SLIDE 13

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 13

DSC ¡Examples ¡– DSC ¡Configuration Force ¡feature ¡to ¡be ¡installed Servers ¡installed ¡on Adds ¡file ¡to ¡OS

slide-14
SLIDE 14

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 14

DSC ¡Examples ¡– DSC ¡Configuration ¡– Windows ¡WebServer

slide-15
SLIDE 15

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 15

DSC ¡Examples ¡– Demo

DEMO

slide-16
SLIDE 16

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 16

DSC ¡Examples ¡– End ¡to ¡End ¡Provisioning

  • Most ¡corporate ¡environments ¡use ¡Hyper-­‑V ¡or ¡VMWare
  • Hyper-­‑V ¡has ¡DSC ¡Resources ¡(form ¡MS)
  • VMWare ¡Powershell tools ¡(requires ¡custom ¡DSC ¡Resource)
  • Just ¡requires ¡that ¡you ¡have ¡built ¡a ¡VM ¡with ¡all ¡pre-­‑reqs
  • Hyper-­‑V ¡and ¡PS ¡DSC ¡for ¡Linux ¡support ¡the ¡same ¡operating ¡services
  • Once ¡VM ¡is ¡deployed ¡you ¡can ¡use ¡DSC ¡push ¡server ¡to ¡do ¡initial ¡setup
slide-17
SLIDE 17

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 17

DSC ¡Examples ¡– End ¡to ¡End ¡Provisioning ¡– Hyper-­‑V

http://mikefrobbins.com/2015/01/22/creating-­‑hyper-­‑v-­‑vms-­‑with-­‑desired-­‑state-­‑configuration/

slide-18
SLIDE 18

8/19/2015 PowerShell ¡DSC ¡for ¡Linux 18

Review ¡of ¡DSC ¡– Conclusion

  • DSC ¡Provides ¡a ¡new ¡set ¡of ¡tools ¡for ¡machine ¡configuration
  • Allows ¡integration ¡with ¡current ¡Windows ¡SysAdmintoolset
  • Hyper-­‑V ¡and ¡VMWare ¡end ¡to ¡end ¡provision ¡capabilities
  • A ¡new ¡tool ¡to ¡manage ¡servers