The Puppet Show Managing Servers with Puppet



Similar documents
Secure Linux Administration Conference Bernd Strößenreuther

developing sysadmin - sysadmining developers

OS Installation: CentOS 5.8

Building Hosts with Puppet

How to extend Puppet using Ruby

CHEF IN THE CLOUD AND ON THE GROUND

TF-NOC Dublin. Alexandros Kosiaris GRNET NOC Use puppet and network inventory to populate nagios/icinga configuration

Making System Administration Easier by Letting the Machines Do the Hard Work, Or, Becoming an Agile Sysadmin

VDCF - Virtual Datacenter Control Framework for the Solaris TM Operating System

Ansible. Configuration management tool and ad hoc solution. Marcel Nijenhof

Kickstart & Booking. Kristian Köhntopp, booking.com

VMware vcenter Log Insight Security Guide

Syncplicity On-Premise Storage Connector

Cloud Homework instructions for AWS default instance (Red Hat based)

Higher National Unit specification: general information

How To Install An Org Vm Server On A Virtual Box On An Ubuntu (Orchestra) On A Windows Box On A Microsoft Zephyrus (Orroster) 2.5 (Orner)

CDH installation & Application Test Report

Implementing a secure high visited web site by using of Open Source softwares. S.Dawood Sajjadi Maryam Tanha. University Putra Malaysia (UPM)

SETTING UP A LAMP SERVER REMOTELY

Pro Puppet. Jeffrey McCune. James TurnbuII. Apress* m in

Contents Set up Cassandra Cluster using Datastax Community Edition on Amazon EC2 Installing OpsCenter on Amazon AMI References Contact

Developing IT Infrastructure: Automated and Centralized System Configuration Management with Puppet. Armen Igitian

Integrating SAP BusinessObjects with Hadoop. Using a multi-node Hadoop Cluster

W H I T E P A P E R. Best Practices for Building Virtual Appliances

Newton Linux User Group Graphing SNMP with Cacti and RRDtool

Deployment - post Xserve

Continuous Integration using Docker & Jenkins

Cloud.com CloudStack Community Edition 2.1 Beta Installation Guide

Advantages and Disadvantages of Application Network Marketing Systems

Laboration 3 - Administration

TPAf KTl Pen source. System Monitoring. Zenoss Core 3.x Network and

VMware vcenter Log Insight Security Guide

The road to lazy monitoring with Icinga2 & Puppet. Tom De

SolarWinds Log & Event Manager

VPS Hosting User Guide

GPFS and Remote Shell

Red Hat JBoss Core Services Apache HTTP Server 2.4 Apache HTTP Server Installation Guide

Rally Installation Guide

Web Server using Apache. Heng Sovannarith

Installing Booked scheduler on CentOS 6.5

Monitoring Clearswift Gateways with SCOM

Upgrading a Single Node Cisco UCS Director Express, page 2. Supported Upgrade Paths to Cisco UCS Director Express for Big Data, Release 2.

Monitoring a Linux Mail Server

AGENDA: INTRODUCTION: 1. How is our cloud monitoring setup? 2. Which are the tools used? 3. How do we access monitoring dashboard?

Prepared for: How to Become Cloud Backup Provider

Network Monitoring & Management Log Management

ABRAHAM ARCHITECTURE OF A CLOUD SERVICE USING PYTHON TECHNOLOGIES

Unix Infrastructure Management From Scratch

How to Deploy a Secure, Highly-Available Hadoop Platform

OMU350 Operations Manager 9.x on UNIX/Linux Advanced Administration

NRPE Documentation CONTENTS. 1. Introduction... a) Purpose... b) Design Overview Example Uses... a) Direct Checks... b) Indirect Checks...

How To Install Eucalyptus (Cont'D) On A Cloud) On An Ubuntu Or Linux (Contd) Or A Windows 7 (Cont') (Cont'T) (Bsd) (Dll) (Amd)

Fermilab Central Web Service Site Owner User Manual. DocDB: CS-doc-5372

Railo Installation on CentOS Linux 6 Best Practices

GlassFish Security. open source community experience distilled. security measures. Secure your GlassFish installation, Web applications,

Network Monitoring & Management Log Management

installation administration and monitoring of beowulf clusters using open source tools

Linux VPS with cpanel. Getting Started Guide

Application Discovery Manager User s Guide vcenter Application Discovery Manager 6.2.1

Deployment and Monitoring. Pascal Robert MacTI

Tonido Cloud Admin Guide

Backup and Restore MySQL Databases

Server Installation/Upgrade Guide

CN=Monitor Installation and Configuration v2.0

Icinga and Puppet Dominik Schulz Head of Datacenter and Operations Magic Internet / MyVideo

Installation documentation for Ulteo Open Virtual Desktop

1. What is this? Why would I want it?

Automatic Configuration of Slave Nameservers (BIND only)

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP LTM with Apache Tomcat and Apache HTTP Server

How To Monitor Mysql With Zabbix

PostgreSQL administration using Puppet. Miguel Di Ciurcio Filho

Preparing for the Installation

Secure File Transfer Installation. Sender Recipient Attached FIles Pages Date. Development Internal/External None 11 6/23/08

virtualization.info Review Center SWsoft Virtuozzo (for Windows) //

Migrating LAMP stack from x86 to Power using the Server Consolidation Tool

OnCommand Performance Manager 1.1


Availability Management Nagios overview. TEIN2 training Bangkok September 2005

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

Infrastructure as data with Ansible for easier Continuous Delivery

CatDV Pro Workgroup Serve r

REQUIREMENTS AND INSTALLATION OF THE NEFSIS DEDICATED SERVER

Tue Apr 19 11:03:19 PDT 2005 by Andrew Gristina thanks to Luca Deri and the ntop team

JMETER - MONITOR TEST PLAN

Host your websites. The process to host a single website is different from having multiple sites.

Lecture 2 (08/31, 09/02, 09/09): Hadoop. Decisions, Operations & Information Technologies Robert H. Smith School of Business Fall, 2015

GroundWork Monitor Open Source Installation Guide

Ulteo Open Virtual Desktop Installation

Monitoring Drupal with Sensu. John VanDyk Iowa State University DrupalCorn Iowa City August 10, 2013

Installing a Symantec Backup Exec Agent on a SnapScale Cluster X2 Node or SnapServer DX1 or DX2. Summary

Install Cacti Network Monitoring Tool on CentOS 6.4 / RHEL 6.4 / Scientific Linux 6.4

Maintaining Non-Stop Services with Multi Layer Monitoring

COURCE TITLE DURATION LPI-202 Advanced Linux Professional Institute 40 H.

Transcription:

The Puppet Show Managing Servers with Puppet A gentle introduction to Puppet; How it works, What its benefits are And how to use it Robert Harker harker@harker.com

whoami UNIX/Linux sysadmin for over 25 years Known for sendmail classes My puppet experience I used puppet to migrate a gaming social site 1up.com to new hardware in a lights-out data center. Three types of servers: Apache/Tomcat front end servers Tomcat search servers Terracotta caching servers Two infrastructure servers: Puppetmaster, named master, sendmail relay Nagios, MRTG, cacti

Puppet is a configuration management tool Written by Luke Kanies Supported by Puppet Labs (formerly Reductive Labs) Written in Ruby but Ruby skills not needed Client/Server model: puppetmasterd is the central management daemon puppetd runs on each managed system (node) Why this is better than homebrew scripts/ssh loops Much more testing than a single site can do Very active user/developer community Companies are able to hire people that already understand the system

Puppet, Make It So The goal of Puppet is to define the end state of the managed system (node) This end state is defined by a set of related class data that build up a node specific manifest Puppetd running on each node inspects itself with factor which defines: OS, network interfaces, IP addresses, file systems, architecture, hostname The node uploads this information to the puppetmaster The puppetmaster then uses the factor information to: Define which resources (classes) need to be applied to the node Evaluate the resources to make it specific to a node Build up a node specific manifest and download it to the client This may include files and templates that are available on the puppetmaster

Puppet, Make It So (cont.) The node then uses this manifest to compare its current configuration to the configuration defined in the manifest Any differences are logged and corrected: Download a file Change owner or permissions Install or deinstall an application Enable or start a service Because puppet strives to make the current state of the client be the same as the state defined in the manifest, puppetd can be run multiple times without corruption Puppet is idempotent

Puppet Security Infrastructure Puppetmasterd listens to port 8140 Puppet uses SSL for security The puppetmaster includes a SSL certificate server When a node starts up that does not have a certificate, it sends a certificate request to the puppetmaster The puppetmaster generates an SSL certificate and signs it The puppetmaster returns the signed certificate to the node The puppetmaster's public certificate is also returned Certificates can be viewed and manipulated with puppetca

Puppet Architecture

Puppet Language Puppet decouples the syntax of the configuration management tool from the syntax of the underlying OS and applications This is done with Puppet s Resource Abstraction Layer (RAL) The decoupling allows Puppet to define a high level idea like user, application, or service The Puppet RAL will translate that in to the commands required by the client OS Resources describe some aspect of a system Each resource has a type, a title, and a list of attributes

Puppet Is A Declarative Language Resource Types - Each resource is modeled as a type Resources include services, packages, files, users, permissions, run state Resource Types are independent of the underlying OS semantics Providers how to implement a resource Providers hide the underlying differences between OSes Providers for the type 'package' include apt, yum, pkgadd Resource providers actually perform the management functions

Puppet Language Structure Puppet creates a graph based structure to define the relationships between resources: What resources depend on another What order the resources should be evaluated Whether a change in one resource requires an action by another resource I.e. restarting a service if a config file changes Puppet has a tool to print out these dependency graphs

Puppet Syntax Resources are made up of a type, title and a series of attributes: file { 'sshd_config': owner => 'root', group => 'root', Type is file Title is sshd_config Attributes define the owner and group as root Puppet allows you to specify a local name in addition to the title: file { 'sshd_config':... name => $operatingsystem? {, solaris => '/usr/local/etc/ssh/sshd_config', default => '/etc/ssh/sshd_config',

Puppet Syntax, Type[title] The title of a resource can be used to refer to file resource The resource will include its attributes and OS specific logic You use the syntax: Type[title] For example to define a service that depends on the file: service { 'sshd': subscribe -> File[sshd_config], subscribe tells Puppet to restart the service if its dependent resource is changed

Puppet Syntax, Type[title] (cont.) This syntax can also refer to several related resources of the same type service { 'sshd': require -> File['sshd_config', authorized_keys'], Require defines the dependency order: Nothing can happen to the service sshd until the sshd_config and authorized_keys files are correct

Puppet Can Manage Users And Groups group { "harker": ensure => present, gid => 1318 user { "harker": ensure => present, gid => "harker", groups => ["adm", "staff", "root"], membership => minimum, shell => "/bin/bash", require => Group["harker"]

Puppet Nagios Types Puppet can generate nagios configuration files based on node configuration Nagios types supported: nagios_servicedependency nagios_hostescalation nagios_serviceextinfo nagios_hostgroup nagios_hostextinfo nagios_hostdependency nagios_service nagios_contactgroup nagios_contact nagios_command nagios_timeperiod nagios_servicegroup nagios_host nagios_serviceescalation

Resource Collections Aggregation combines multiple resources into a new resource Two ways to do this: Classes and definitions. Classes model fundamental aspects of nodes Classes define the resources that define an aspect of a node Classes are are singletons are only evaluated once per node Definitions can be reused many times on the same node They work as custom created Puppet types They can be evaluated multiple times with different inputs each time You pass variable values into the defines.

Puppet Classes Puppet classes define how to install and configure files, applications, services, etc... A class is defined with: class Title { Resources are then added to the class

A class can have multiple resources: Puppet Classes (cont.) class sshd { package { openssh-server: ensure => present Installs the package file { 'sshd_config': Installs a configuration file name => $operatingsystem? { solaris => '/usr/local/etc/ssh/sshd_config', default => '/etc/ssh/sshd_config',, owner => root, group => root, mode => 444, backup => false, source => "puppet:///files/etc/ssh/sshd_config", require => Package["openssh-server"], service { "sshd": Starts the service enable => true, ensure => running, subscribe => [Package[openssh-server], File["sshd_config"],],

Puppet Modules A Puppet Module is a reusable collection of resources, classes, files, definitions and templates A module by nature should be self-contained A Puppet module has a specific directory structure: MODULE_PATH/ downcased_module_name/ files/ manifests/ init.pp lib/ puppet/ parser/ functions provider/ type/ facter/ templates/

README

Puppet Modules (cont.) Each module must contain a init.pp manifest file class ntpd { package { ntp: ensure => latest service { ntp: ensure => running file { "/etc/ntp/ntpservers": source => "puppet:// $servername/modules/ntp/ntpservers" file { "/etc/ntp.conf": content => template("ntp/ntp.conf.erb")

Module Structure For ntpd MODULE_PATH/ ntp/ manifests/ init.pp files/ ntpservers templates/ ntp.conf.erb

Puppet Templates Modules can also edit files on the fly In ntpd/templates/ntp.conf.erb: # /etc/ntp.conf, configuration for ntpd... fudge 127.127.1.0 stratum <%= local_stratum %>... The ntpd module's init.pp recipe file:... $local_stratum = $ntp_local_stratum? { '' => 13, default => $ntp_local_stratum,...

Puppet Manifests Puppet has three types of manifests files: Nodes: define which classes each managed node should use Classes: action files that define what to do Modules: reusable classes Nodes define what packages, files and services should be installed Classes and modules define what need to be done to install it Classes and modules are added to a node with an include statement include sshd.pp

Nodes Have Inheritance A complex node can be configured by inheriting a simpler node I start with a basenode that all hosts inherit This includes things I want done on all nodes: Applications installed or removed Services enabled or disabled Site wide configuration files You can then make a more complex node based on this inheritance Webserver = basenode + apache MySQLserver = basenode + MySQL You can then make a specific node or host: foomysql = MySQLserver + foo specific additions barmysql = MySQLserver + bar specific additions

/etc/puppet/manifests/nodes.pp node 'basenode' { # nodefiles contain host specific files such as host ssh keys include nodefiles # Custom puppet configuration for puppetd nodes, not on puppetmaster include puppet-configs # Only download rpms from our private repos include yumrepos # Install and remove packages from the core OS install include baseapps # Enable and disable system services include basesrvcs # Classes that have custom configurations include iptables include hosts include nrpe include ntp include snmp include subversion include dell include sysfiles include sshd include rootfiles include java

####################################################### # Foo Domain and role nodes ####################################################### node 'foodomain' inherits basenode { # Things that should be in all Foo servers that do not provide # datacenter infrstructure services like named, sendmail, etc # set the local servers we point to # Lets use FQDNs $my_puppet_server = "opssrv.bil.foo.com" $my_syslog_server = "nagios.bil.foo.com" $my_ntp_server = "opssrv.bil.foo.com" $my_local_network = "10.212.62.0/24" # These include statements are including classes # Order can be important, so be careful include named include sudo include passwd include homedirs include sendmail

# Roles for different types of servers node 'web-role' inherits foodomain { # Things that are specific to the apache servers include appsrv-role include appsrv-apache2 node 'tomcat-role' inherits foodomain { # Things that are specific to the tomcat servers include appsrv-tomcat node 'web-tomcat-role' inherits foodomain { # A role that inherits apache # It needs the tomcat stuff repeated here as well include appsrv-role include appsrv-apache2 include appsrv-tomcat include terracotta node 'terracotta-role' inherits foodomain { # Things that are specific to the terracotta servers include terracotta

####################################################### # nodes that are actually hosts ####################################################### node 'opssrv.bil.foo.com', 'mgmt.bil.foo.com' inherits basenode { # Things that are specific to the management server include opssrv include puppet-master-configs node 'nagios-01.bil.foo.com' inherits basenode { # Things that are specific to the montoring server include httpd include nagios-server node 'appsrv-01.bil.foo.com', 'appsrv-02.bil.foo.com', 'appsrv-03.bil.foo.com', 'appsrv-04.bil.foo.com', 'appsrv-05.bil.foo.com', 'appsrv-06.bil.foo.com', 'appsrv-07.bil.foo.com', 'appsrv-08.bil.foo.com' inherits web-tomcat-role { # Things specific to the apache/tomcat applications servers

node 'tcsrv-01.bil.foo.com', 'tcsrv-02.bil.foo.com' inherits terracotta-role { # Things specific to the terracotta servers include tcsrv-role node 'search-01.bil.foo.com' inherits tomcat-role { # Things specific to the tomcat search servers include search-role include search-tomcat node 'download-01.bil.foo.com', 'download-02.bil.foo.com' inherits web-role { # Things specific to the apache download servers include download-role include download-apache2

Pros and Cons of Puppet Pros: Buzz in the Linux systems management community OpenSource Active development community New features and modules added weekly Cons: Scalability Factor running on the client is expensive Manifest generation on the puppetmaster is expensive Many desirable features missing Dashboard is alpha, likely to be commercial product Many systems administration tasks missing