Managing windows with Puppet and Chocolatey

Post on 15-Jan-2015

739 views 0 download

Tags:

description

Workshop slides for NYC DIIT School Technology Summit 2014 presentation about managing Windows packages with Chocolatey and Puppet

transcript

Managing Windowswith

Puppet and Chocolatey

Seth McBeanSchool Aide | FLAGS High SchoolNYC DIIT School Technology Summit – 2014/07/30

Who am I?

School Aide at FLAGS High School (07X520) serving as Tech Coordinator since 2008.

Seth McBean

Let’s start with “Why?”

Why manage?Why automate?

Why care?Why stay awake?

Why manage/automate?

SpeedConsistencyTo get rid of those problems that nag me

What is management?

Management is simply the process of getting the good stuff that we want into computers and removing the bad stuff that we dont want.

How do we typically get stuff onto computers?

Imaging – bake everything in and when it grows stale and unwieldy, reimage (re-bake) it

It’s how we do it. It’s how we’ve done it

….but can we do it better?

How do we typically get stuff onto computers?

Deploy packages:→ Store installer packages somewhere

(external drive, file server, etc.) → Use some method to push the packages to

the computers and install them (scripts, AD Group Policy, PDQ Deploy, etc.)

Better….but is there yet a better way?

Get Chocolatey

It’s way better… why?

Chocolatey is aware of what it installs

It’s also aware when there’s a new version

Get Chocolatey – The Install

from CMD.exe as Administrator:@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

– OR – via Powershell as Administrator:iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

Reads like Dickens, doesnt it?!

Run Chocolatey

Install the current java vmc:\> cinst javaruntime

Uninstall an old versionc:\> cuninst javaruntime -Version 6.0.31.1

Upgrade to the latest versionc:\> cup javaruntime

It even does Windows Features

List all available Windows Featuresc:\> clist -source windowsfeatures

Install TFTP Clientc:\> cinst -source windowsfeatures TFTP

(Generally more useful for Windows server)

Why Puppet?

Because we’re humans...

Humans are inventive and resourceful and...

Humans are HORRIBLE at repetitive tasks

Computers and software are way better at repeated tasks… once they’re told what to do

What is Puppet?

A configuration management/reporting system

Ookay...what’s that?

Puppet provides a way of telling Windows how it should run and what it should do

How does Puppet interact with Windows?

Puppet uses a Master which is simply a linux hosted program that interacts with an Agent process running on the client machine.

The Master collects Facts from the client and uses that information to compile a catalog of instructions that declare the ultimate state of how Resources should look on the client.

How does Puppet interact with Windows?

The client runs the instructions and reports its activity as well as any errors back to the Master

Client: “Hey Master, I did what you said and here’s how it went...”Master: “Atta boy! That’s a good Puppet!”

What are Resources?

Resources are the things that Puppet manages

Resources can be: Files, Services, Packages, Users, Groups, Scheduled Tasks...

Puppet uses instructions contained in simple text files called Manifests to declare the end state of Resources

What is a Manifest?

A Manifest is a plain text file containing instructions written in a declarative language that Puppet uses to define how Resources should be

package { 'javaruntime': ensure => 'latest’, provider => ‘chocolatey’,}

“Tell Chocolatey, he had better make sure my java is fresh in the morning!!”

So what’s this Provider thing?

...and what does Chocolatey have to do with all this?

Chocolatey is a Provider for Puppet, which means it’s a method used to install programs which are represented as a type of resource referred to as Packages

Okay… you’d better you show me

DEMO TIME!!!

Everybody needs somebodyWhere to get help?

Docs: http://docs.puppetlabs.com/Training: https://puppetlabs.com/learnYoutube: http://j.mp/puppetlabs-youtubePuppet Group: http://j.mp/puppet-users-groupChocolatey Group: http://j.mp/chocolatey-groupPuppetNYC Meetup: http://j.mp/puppet-nyc-meetupPodcast: http://j.mp/puppetlabs-podcastIRC: #puppet and #chocolatey on Freenode

Useful things to watch

What is Puppet?http://youtu.be/j8ImF23jZAg

Getting Started with the Learning Puppet VMhttp://youtu.be/8wTiFUZDVfo

Getting Started with Puppethttp://youtu.be/TdAmAj3eaFI

Keep in touch

Google+: http://google.com/+SethMcBeanLinkedIn: http://www.linkedin.

com/SethMcBean

Email:seth@sethmcbean.com

seth@flagshs.org