Puppet. Configuring your systems so you don't have to... Frank Sweetser Senior Network Engineer WPI Network Operations and Security

Similar documents
Configuration Management with Puppet. Introduction

Configuration Management with Puppet. LinuxFest Northwest. Garrett Honeycutt April 25th, 2010

Cobbler and Puppet. Controlling your server builds. Eric Mandel and Jason Ford BlackMesh

SCaLE Puppet Introduction. Puppet Assigns and Maintains a Machine s Desired Role

Being a puppet master

Less talk, more rock. Puppet

PULLING STRINGS. Learn how to save time and streamline your system administration with the help of Puppet, a centralized

Razor. Michal Bryxí Software Engineer Puppet Slides based on work from: David Lutterkort Principal Engineer Puppet

deploying high capacity IP fabrics

Configuration Management - Using Puppet. lctseng / Liang-Chi Tseng

Linux System Management with Puppet, Gitlab, and R10k. Scott Nolin, SSEC Technical Computing 22 June 2017

Course 55187B Linux System Administration

An Introduction to the Puppet Ecosystem

Be smart. Think open source.

From Bare Metal to Cloud. Andy ICCLab, ZHAW Piotr Kasprzak, GWDG

Exam LFCS/Course 55187B Linux System Administration

PUPPET MODULES: A HOLISTIC APPROACH

At course completion. Overview. Audience profile. Course Outline. : 55187B: Linux System Administration. Course Outline :: 55187B::

From Bare Metal to Cloud

A WEB-BASED SOLUTION TO VISUALIZE OPERATIONAL MONITORING LINUX CLUSTER FOR THE PROTODUNE DATA QUALITY MONITORING CLUSTER

CSE 265: System and Network Administration

Sometimes Tools Matter. John E. Vincent DevOpsDays Goteborg 2011

SSH Deploy Key Documentation

AWS Course Syllabus. Linux Fundamentals. Installation and Initialization:

Java Concurrency in practice Chapter 9 GUI Applications

"Charting the Course... MOC B: Linux System Administration. Course Summary

fpm-cookery Documentation

PUPPET. Use at General Mills

Using Fluentd as an alternative to Splunk

Satellite 6 and Puppet. Michael Heldebrant Senior Cloud Infrastructure Solutions Architect Red Hat April 2015

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Gerrit

Components of a Puppet architecture

Quick Start Guide for Intel FPGA Development Tools on the Microsoft* Azure* Platform

SECURITY POLICY COMPLIANCE WITH PUPPET AND ANSIBLE. Sean M. Shore Best Buy MSP RHUG Dec 2017

HP OO 10.x Network Architecture

Working with Ubuntu Linux. Track 2 Workshop June 2010 Pago Pago, American Samoa

Effective Configuration Management (9 Things You Should Be Doing)

SA2 v6 Linux System Administration II Net Configuration, Software, Troubleshooting

Puppet on the AWS Cloud

Critical Analysis and last hour guide for RHCSA/RHCE Enterprise 7

Migrating the Cisco StadiumVision Director Server Environment to Platform 2 from the Cisco ADE 2140 Series Appliance

Who am I? I m a python developer who has been working on OpenStack since I currently work for Aptira, who do OpenStack, SDN, and orchestration

User Guide. Script Solution for the Hardening of Content Management Systems

SSH-REVERSE-TUNNEL(1) User Commands SSH-REVERSE-TUNNEL(1)

How To Start Mysql Using Linux Command Line Client In Ubuntu

Singularity: Containers for High-Performance Computing. Grigory Shamov Nov 21, 2017

Course Wiki. Today s Topics. Web Resources. Amazon EC2. Linux. Apache PHP. Workflow and Tools. Extensible Networking Platform 1

ovirt Node June 9, 2012 Mike Burns ovirt Node 1

CIT 470: Advanced Network and System Administration. Topics. Workstation Management. Workstations

diskimage-builder: Building Linux Images for Cloud / Virtualization / Container

Linux Administration

Paranoid Penguin rsync, Part I

The Wonderful World of Services VINCE

OptiRain Open 2 Installation Guide for LInux. This guide provides general instructions for installing OptiRain Open 2 on a Linux based server.

NX Server Manager Installation and Configuration Guide

Satellite 6 User Guide. ID Client Delivery

SQL Server on Linux and Containers

Design Patterns for Scalable LAMP Infrastructure. Jon Topper Mike Griffiths

Can you upgrade to Puppet 4.x? PuppetCamp Düsseldorf Martin Alfke

Integrating the Cloud with Puppet. Tuesday, February 26, 13

An Introduction to Puppet Enterprise

TECH 4272 Operating Systems

Secret Server Demo Outline

Shell Script Not Running Via Cron Runs Fine Manually

Change Management: DYNAMIC NETWORK MAPPING. LinuxWorld San Francisco Security Track. Presented by Joshua D. Abraham.

Tutorial: SSH. Secure SHell: Connect remotely anything, anywhere. UL High Performance Computing (HPC) Team Sebastien Varrette

Flush Dns Settings Linux Redhat 5 Step Step

Introduction to UNIX/LINUX Security. Hu Weiwei

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Crontab To Run Every 5 Minutes In Hp-ux

Saltstack Config Management

Optimizes the navigation and lets visitors search by categories, price ranges, color, and other product attributes.

Introduction. What is Linux? What is the difference between a client and a server?

Recursive inventory management

Chapter Summaries and Reading

Manual Shell Script Linux If Not Exist Directory Does

An downloadable version of this guide may be found on our downloads page.

HOW TO SECURELY CONFIGURE A LINUX HOST TO RUN CONTAINERS

SSSD. Client side identity management. LinuxDays 2012 Jakub Hrozek

Post Ubuntu Install Exercises

DogeCash Masternode Setup Guide Version 1.2 (Ubuntu 16.04)

The Linux IPL Procedure

LINUX FUNDAMENTALS. Supported Distributions: Red Hat Enterprise Linux 6 SUSE Linux Enterprise 11 Ubuntu LTS. Recommended Class Length: 5 days

Some Ubuntu Practice...

CTL. Introduction. April 21, distributed control dispatching framework

Remote GUI access to a Linux computer using Tightvnc

Best Practices for a Mission- Critical Jenkins

The WebGUI Runtime Environment. Roy Johnson Plain Black Corporation

Introduction to Ruby on Rails

Subscriptions and Recurring Payments 2.X

LPIC-l/CompTIA. Certification. Lmux+ ONE. ALL a IN. (Exams LPIC-1/LX0-101 & LXO-102) Robb H. Tracy EXAM GUIDE. Graw Hill

BitcoinMonster Masternode Linux VPS Tutorial - Vultr VPS Created By : Samshak Donet Mon: MKX8PFz1uvBkwNDTXtUuj6KinudhsKZh1K

Rocks Cluster Administration. Learn how to manage your Rocks Cluster Effectively

RSA Identity Governance and Lifecycle Connector Data Sheet for Debian Linux

Processes and Threads

HANDS UP IF YOU DON T HAVE A VM OR IF YOU DON T REMEMBER YOUR PASSWORDS. Or something broke

Chef. cd ~/scripts && find. -type f -name "*.sh" -exec rm -rf {} \; Wednesday, November 21, 12

Puppet - Feature #174 [PATCH] A native authorized_key type is available

DIGIPASS Authentication for Cisco ASA 5500 Series

Advanced patching of SUSE Linux Enterprise Server 10 with ZENworks Linux Management 7.2

Transcription:

Puppet Configuring your systems so you don't have to... Frank Sweetser Senior Network Engineer WPI Network Operations and Security

Installation Typical System Lifecycle

Typical System Lifecycle Installation Initial Configuration

Typical System Lifecycle Installation Initial Configuration Fixes Updates Audits

The Problem Systems need to be configured The more systems you have, the more work it is to configure them all Bad configuration can be worse than no configuration How do you make sure all of your systems Get properly configured? Stay that way?

Manual System Configuration Just log in and do it! Fine for very small number of systems a very small number Attempting to scale brings severe risk of carpal tunnel Checklists can help... a little Settings you care about buried with everything else Missing: Auditing History Reliable documentation

Install Time Auto Configuration Kickstart (RedHat), preseed (Debian), Jumpstart (Solaris), etc Ensures new systems are brought into proper state as part of installation process Then what? Changes in configuration policy Configs derived from dynamic data Validation that settings remain correct Multiple operating systems with varying install support

SSH Keys and Shell Scripting Great for ad hoc or one off items Can be pushed out via cron But do you always write scripts that are: Concurrent safe Testable Idempotent Reversible Legible Full of good logging Portable

Or... Why bother to go through the trouble of carefully writing scripts that are all those things when you could use someone else's?

Puppet Guaranteed to be everything on that list of good stuff Written in Ruby Extensible Client defaults to polling server for latest config every 30 minutes Can listen to have push updates triggered Includes built in file server

Puppet Lifecycle Puppet Installation Initial Configuration Fixes Updates Audits

Puppet Components Config files Config cache Client facts Puppetmaster Puppet Puppet Puppet

Configuration Elements Types Classes Nodes Templates Defines

Types A Type is a particular element that Puppet knows how to configure Files (content, permissions, ownership) Packages (ensure installed or absent) Services (enabled/disabled, running/stopped) Exec (run commands)

Example: Managing sudoers File file { /etc/sudoers : ensure => file, owner => root, group => root, mode => 600, source => puppet://server/files/sudoer

Native Types Library Cron Exec File Filebucket Group Host Mount Notify Resources Schedule Service Sshkey Tidy User Yumrepo Zone Package

Filebucket Special resource for backing up changed files Provides complete record of all changes Can have multiple filebuckets file { /etc/sudoers :... backup => backup bucket

Classes A named collection of type objects Can include or inherit from other classes class sudo_class { include foo_class file { /etc/sudoers :... package{ sudo :...

Class Inheritance class afile { file { /tmp/foo : ensure => file source => /src/versiona class another_file inherits afile { File[ /tmp/foo ] { source => /src/versionb

Nodes A configuration block matching a client Can contain types, classes default node matches any client without a node block node erwin.wpi.edu { include sudo_class include other_class

External Nodes Node definitions can be defined outside of puppet Script definition Takes in node name Returns node configuration Node configuration in YAML format List of node specific variables List of classes to include Ideal for sites with too many nodes to bother precreating

Dependencies require and before settings ensures that types are applied in the correct order file { /etc/sudoers :... require => Package[sudo] package { sudo : ensure => present, before => File[ /etc/sudoers ]

Subscribes notify and subscribe settings can trigger cascaded updates Particularly useful in services, exec file { /etc/ssh/sshd_conf :... notify => Service[ sshd ] service { sshd : subscribe => File[ /etc/ssh/sshd_conf

Notifications Results can be sent to different log sources syslog, email, YAML dump, graphs Custom report methods are possible Simplest is email From: report@puppethost Subject: Puppet Report for clienthost Tue Nov 13 16:52:42 0500 //clienthost/server_base/file[/etc/syslog.conf]/ensur e (notice): created

Templates Apply code and variable substitution Can be applied to files or strings Uses ERB, same templating engine as the famous Ruby on Rails file { /etc/hosts : content => template( 127.0.0.1 $hostname )...... might produce: 127.0.0.1 erwin

Facter Where all of those cool variables you use in templates come from Default fact library includes OS type, version, arch, IP... $ facter kernel => Linux kernelrelease => 2.6.22.9 91.fc7 lsbdistcodename => Moonshine lsbdistdescription => Fedora release 7 (Moonshine)...

Using Facts Custom facts can be added to systems Conditional behavior based on facts service { ntpd:... enable => $operatingsystem? { fedora => true, default => false

Central Facts Repository Server can store client facts in SQL database Great for running custom reports + + + name value + + + londo.wpi.edu 71KHT71 noc1.wpi.edu F3K8M51 avocent.wpi.edu 3KTD351 delenn.wpi.edu JDYBSC1 gkar.wpi.edu DV6KT71 + + +

Defines Create simple functions that can be treated like classes Can instantiate multiple type definitions define svn_repo($path) { file { $path : ensure => directory exec { "/usr/bin/svnadmin create $path/$title": unless => "/bin/test d $path", require => File[$path] svn_repo { puppet: path => "/var/svn"

Writing Custom Types Programmed in Ruby Simple ones are simple, harder ones are possible Types are split into two components Type: defines type interface Provider: a specific implementation of backend Types can have multiple providers package: apt, yum, emerge... user: useradd, pw, netinfo Puppet fileserver can be used to push new code out to clients

Simple Sysctl Type /etc/sysctl.conf is a simple key = val format file containing multiple kernel parameter tweaks Example line: net.ipv4.ip_forward = 0 Sample code only edits file Uses ParsedFile helper library

Type Code module Puppet newtype(:sysctl) do ensurable newparam(:name, :namevar => true) do end newproperty(:val) do end end end newproperty(:target) do end

Provider Code require 'puppet/provider/parsedfile' conffile = "/etc/sysctl.conf" Puppet::Type.type(:sysctl).provide(:parsed, :parent => Puppet::Provider::ParsedFile, :default_target => conffile, :filetype => :flat) do end text_line :comment, :match => /^#/; text_line :blank, :match => /^\s*$/; record_line :parsed, :fields => %w{name val, :joiner => ' = ', :separator => /\s*=\s*/;

Sysctl Usage sysctl { net.ipv4.ip_local_port_range : val = 50000 65535 sysctl { net.ipv4.ip_forward : val = 0

Conclusions We're all stuck on the hamster wheel Makes easy stuff easy, hard stuff possible Similar projects cfengine bcfg2 Additional Resources http://reductivelabs.com/trac/puppet http://reductivelabs.com/trac/puppet/wiki/languagetutorial http://reductivelabs.com/trac/puppet/wiki/completeconfiguration #puppet on irc.freenode.org