PostgreSQL administration using Puppet. Miguel Di Ciurcio Filho



Similar documents
How to extend Puppet using Ruby

Copyright by Parallels Holdings, Ltd. All rights reserved.

What s New in Centrify Server Suite 2013 Update 2

Net/FSE Installation Guide v1.0.1, 1/21/2008

Cloud on TIEN Part I: OpenStack Cloud Deployment. Vasinee Siripoonya Electronic Government Agency of Thailand Kasidit Chanchio Thammasat

depl Documentation Release depl contributors

IUCLID 5 Guidance and support. Installation Guide Distributed Version. Linux - Apache Tomcat - PostgreSQL

KonyOne Server Installer - Linux Release Notes

Postgres Enterprise Manager Installation Guide

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

Automated deployment of virtualization-based research models of distributed computer systems

This guide specifies the required and supported system elements for the application.

Nessus Agents. October 2015

Platform as a Service and Container Clouds

Cloud on TEIN Part I: OpenStack Cloud Deployment. Vasinee Siripoonya Electronic Government Agency of Thailand Kasidit Chanchio Thammasat University

Managing Hybrid deployments using Cloud Foundry on Azure

DocDokuPLM Innovative PLM solution

Solaris Run Cron Job Every 5 Minutes

Rudder. Sharing IT automation benefits in a team with Rudder. Benoît Peccatte bpe@normation.com. Normation Tous droits réservés normation.

Supported Platforms HPE Vertica Analytic Database. Software Version: 7.2.x

Guardium Change Auditing System (CAS)

Supported Platforms. HP Vertica Analytic Database. Software Version: 7.1.x

Space Shuttle Launch - Exploring other Galaxies with Operations Manager

CLOUD API DOCUMENTATION v2.0. Get list of cloud servers in account

NetSupport Manager v11

SNOW LICENSE MANAGER (7.X)... 3

Centrify Server Suite Management Tools

What s New in Centrify Server Suite 2015

OpenStack Manila Shared File Services for the Cloud

Measurably reducing risk through collaboration, consensus & practical security management CIS Security Benchmarks 1

Kaspersky Anti-Virus 8.0 for Linux File Server Installation Guide

Installation Runbook for F5 Networks BIG-IP LBaaS Plugin for OpenStack Kilo

Microsoft Windows Apple Mac OS X

McAfee Firewall for Linux 8.0.0

Deployment - post Xserve

Cloud n Service Presentation. NTT Communications Corporation Cloud Services

Diploma in Computer Science

Installation Guide. Copyright (c) 2015 The OpenNMS Group, Inc. OpenNMS SNAPSHOT Last updated :19:20 EDT

Kaspersky Endpoint Security 8 for Linux INSTALLATION GUIDE

What s New in Centrify Server Suite 2014

Microsoft Windows Apple Mac OS X

Content Distribution Management

Parallels Virtuozzo Containers 4.7 for Linux Readme

Server Monitoring. AppDynamics Pro Documentation. Version Page 1

SNOW LICENSE MANAGER (7.X)... 3

BF2CC Daemon Linux Installation Guide

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)

Expresso Quick Install

PRODUCT DOCUMENTATION. Greenplum Database. Version 4.2. Getting Started. Rev: A GoPivotal, Inc.

Managing Access Control in PresSTORE

VERSION 9.02 INSTALLATION GUIDE.

Other trademarks and Registered trademarks include: LONE-TAR. AIR-BAG. RESCUE-RANGER TAPE-TELL. CRONY. BUTTSAVER. SHELL-LOCK

NAS Storage needs to be purchased; Will not be offered IAAS - Utility SMTP Per SMTP account Per server

In order to upload a VM you need to have a VM image in one of the following formats:

CloudPassage Halo Technical Overview

IBM Endpoint Manager for Server Automation

How to Deploy a Secure, Highly-Available Hadoop Platform

McAfee Public Cloud Server Security Suite

Application Note 02 Advanced SMTP setup

Seamless integration Connect our solution to your business applications thanks to our open architecture

CloudPassage Halo Technical Overview

CTERA Agent for Linux

Supported Platforms. HP Vertica Analytic Database. Software Version: 7.0.x

SNOW LICENSE MANAGER (7.X)... 3

SNOW LICENSE MANAGER (8.X)... 4

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

PARALLELS SERVER 4 BARE METAL README

PrimeRail Installation Notes Version A June 9,

6422: Implementing and Managing Windows Server 2008 Hyper-V (3 Days)

Intelligent Power Protector User manual extension for Microsoft Virtual architectures: Hyper-V 6.0 Manager Hyper-V Server (R1&R2)

Features - SRM UNIX File System Agent

Dell UPS Local Node Manager USER'S GUIDE EXTENSION FOR MICROSOFT VIRTUAL ARCHITECTURES Dellups.com

CHEF IN THE CLOUD AND ON THE GROUND

Automated Process Center Installation and Configuration Guide for UNIX

การใช งานและต ดต งระบบ OpenStack ซอฟต แวร สาหร บบร หารจ ดการ Cloud Computing เบ องต น

Getting Started with Database Provisioning

1. Product Information

Introweb Remote Backup Client for Mac OS X User Manual. Version 3.20

OpenNebula Cloud Platform for Data Center Virtualization

ILLUMIO ADAPTIVE SECURITY PLATFORM TM

Online Backup Client User Manual Linux

TABLE OF CONTENTS OVERVIEW SYSTEM REQUIREMENTS - SAP FOR ORACLE IDATAAGENT GETTING STARTED - DEPLOYING ON WINDOWS

Deep Security 9.6 SP1 Supported Features by Platform

How To Install Storegrid Server On Linux On A Microsoft Ubuntu 7.5 (Amd64) Or Ubuntu (Amd86) (Amd77) (Orchestra) (For Ubuntu) (Permanent) (Powerpoint

FAQS. You can schedule a WebEx session ahead or start it instantly in your choice of ways:

Host Hardening. OS Vulnerability test. CERT Report on systems vulnerabilities. (March 21, 2011)

Secure Agent Quick Start for Windows

How To Write A Test Drive For Kaspersky Anti Virus 6.0 For Windows Server (For Windows)

2. Boot using the Debian Net Install cd and when prompted to continue type "linux26", this will load the 2.6 kernel

OS Installation: CentOS 5.8

Options in Open Source Virtualization and Cloud Computing. Andrew Hadinyoto Republic Polytechnic

nitrobit update server

vtiger CRM 4.2 Installation Guide for Linux OS

developing sysadmin - sysadmining developers

Transcription:

PostgreSQL administration using Puppet Miguel Di Ciurcio Filho miguel@instruct.com.br http://localhost:9090/onepage 1/25

What is Puppet? Puppet Architecture Managing PostgreSQL Installation Databases Roles and Grants Configuration Agenda http://localhost:9090/onepage 2/25

What is Puppet? Automation platform that defines and enforces the state of your infrastructure. Open Source since 2005 Used by projects and organizations like Debian, Wikipedia, Google, Mozilla, PayPal, GitHub, LHC and many others Frees SysAdmins from writing one off, fragile scripts and other manual tasks. Ensures consistency across your infrastructure. Puppet uses a declarative language for modeling your configuration, meaning you tell Puppet what results you want, rather than how to get there. http://localhost:9090/onepage 3/25

Declarative Modeling Language Model the desired state, Puppet figure out how to enforce it. Imperative Shell Code Comparison if [ 0 -ne $(getent passwd elmo > /dev/null)$? ] then useradd elmo --gid sysadmin -n fi Declarative Puppet C user { 'elmo': ensure => presen gid => 'sysadm } GID=`getent passwd elmo awk -F: '{print $4}'` GROUP=`getent group $GID awk -F: '{print $1}'` if [ "$GROUP"!= "$GID" ] && [ "$GROUP"!= "sysadmin" ] then usermod --gid $GROUP $USER fi if [ "`getent group sysadmin awk -F: '{print $1}'`" == "" ] then groupadd sysadmin fi group { 'sysadmin': ensure => presen } http://localhost:9090/onepage 4/25

How Puppet Works http://localhost:9090/onepage 5/25

Data Flow How Puppet manages data flow from Individual Nodes http://localhost:9090/onepage 6/25

Puppet enforces resources in an idempotent way. Idempotency It is our job as developers to teach Puppet how to do this for resource types we develop so that our users don't have to. # First Puppet Run notice: /Group[sysadmin]/ensure: created notice: /User[elmo]/ensure: created notice: Finished catalog run in 0.08 seconds # Second Puppet Run notice: Finished catalog run in 0.03 seconds Idempotence: The property of certain operations in mathematics or computer science in that they can be applied multiple times without further changing the result beyond the initial application. Notes: Idempotent able to be applied multiple times with the same outcome. Puppet resources are idempotent, since they describe a desired final state rather than a series of steps to follow. Source: Puppet Docs http://docs.puppetlabs.com/references/glossary.html#idempotent http://localhost:9090/onepage 7/25

Describe the desired state. Let Puppet maintain it. State Model http://localhost:9090/onepage 8/25

Puppet Resources Resources are building blocks. They can be combined to make larger components. Together they can model the expected state of your system. http://localhost:9090/onepage 9/25

Puppet Demo http://localhost:9090/onepage 10/25

Demo summary Modules: directories that contain your configuration. Encapsulates all of the components related to a given configuration in a single directory hierarchy that enables the following: Auto loading of classes File serving for templates and files Easy sharing with others Facts: key/value pairs generated by facterabout a given node. Classes: collection of resources that are managed together as a single unit. http://localhost:9090/onepage 11/25

Why use Puppet to manage a relational database? Avoid clumsy scripts. Guarantee consistency of configuration over time. Better visibility of current state. Easy integration with any source control management tool. http://localhost:9090/onepage 12/25

The puppetlabs/postgresql module Manages packages and services on several operating systems (server and client). Red Hat, Ubuntu, Debian, Scientific, CentOS, OracleLinux, SUSE Enterprise (!). Supports basic management of databases, users and permissions. Manages the firewall on some distros. https://forge.puppetlabs.com/puppetlabs/postgresql https://github.com/puppetlabs/puppet postgresql http://localhost:9090/onepage 13/25

puppetlabs/postgresql classes and resources postgresql::server postgresql::server::db postgresql::server::pg_hba_rule postgresql::server::role postgresql::server::database_grant postgresql::server::table_grant postgresql::server::config_entry http://localhost:9090/onepage 14/25

The class postgresql::server class { 'postgresql::server': manage_firewall => true, postgres_password => 'TPSrep0rt!', } Manages the installation and configuration of the server. Supports various parameters. Installs packages and enforces a restrictive configuration by default. Runs initdbif necessary. http://localhost:9090/onepage 15/25

The resource postgresql::server::db postgresql::server::db {'test1': user => 'test1', password => postgresql_password('test1', 'changeme!'), } Convenient resource to create databases. Creates an user and assign the necessary permissions in one go. http://localhost:9090/onepage 16/25

The resource postgresql::server::pg_hba_rule postgresql::server::pg_hba_rule { 'allowapptoaccessdatabase': type => 'host', database => 'app', user => 'app', address => '200.1.2.0/24', auth_method => 'md5', } Allows you to create an access rule for pg_hba.conf. http://localhost:9090/onepage 17/25

The resource postgresql::server::role postgresql::server::role { 'dba': superuser => true, password_hash => postgresql_password('dba', 'dba'), } Creates roles in PostgreSQL. Suports various parameters like: createdb, createrole, replicationand others. http://localhost:9090/onepage 18/25

The resource postgresql::server:: database_grant postgresql::server::database_grant { 'marmot_elvis': privilege => 'ALL', db => 'db01', role => 'elvis', } Manages grant based access privileges for databases. http://localhost:9090/onepage 19/25

The resource postgresql::server::table_grant postgresql::server::table_grant { 'table1ofdb01': privilege => 'ALL', table => 'table1', db => 'db01', role => 'elvis', } Manages grant based access privileges for tables. http://localhost:9090/onepage 20/25

The resource postgresql::server::config_entry postgresql::server::config_entry { 'check_function_bodies': value => 'off', } postgresql::server::config_entry { 'work_mem': value => '10MB', } Can be used to modify the postgresql.confconfiguration file. http://localhost:9090/onepage 21/25

Puppet + PostgreSQL Demo http://localhost:9090/onepage 22/25

About Puppet Labs Developer of IT automation software for system administrators 3,000+ Community members 50,000+ Nodes managed in the largest deployments Support for Red Hat, CentOS, Ubuntu, Debian, SUSE, Solaris, AIX, Mac OS X, Windows, etc. http://localhost:9090/onepage 23/25

Infraestructure administration and operation. Authorized Puppet Labs Partner since 2012 Puppet Open Source and Enterprise consulting. Offers all official training courses in Brazil: Puppet Fundamentals Puppet Practitioner Puppet Architect About Instruct http://localhost:9090/onepage 24/25

Next Steps & Questions Brazillian Community: http://puppet br.org Instruct: http://instruct.com.br Puppet training in Brazil http://instruct.com.br/calendario.html Learn more! Download Puppet Enterprise manage 10 nodes for free http://puppetlabs.com/download puppet enterprise Learning Puppet Tutorials http://docs.puppetlabs.com/learning/ Download the Learning Puppet VM http://info.puppetlabs.com/download learning puppet VM.html Puppet Docs http://docs.puppetlabs.com/ http://localhost:9090/onepage 25/25