+ All Categories
Home > Technology > Foreman presentation

Foreman presentation

Date post: 10-May-2015
Category:
Upload: glen-ogilvie
View: 1,100 times
Download: 0 times
Share this document with a friend
Description:
How to keep track of puppet with Foreman.
Popular Tags:
70
How to keep track of puppet with Foreman Glen Ogilve - [email protected]
Transcript
Page 1: Foreman presentation

How to keep track of puppetwith Foreman

Glen Ogilve - [email protected]

Page 2: Foreman presentation
Page 3: Foreman presentation

do?

What does the

Page 4: Foreman presentation

Provisioning

"Provision on bare-metal & public or private clouds all from one place."

It does with a mix of:

hardware via network boot and automated install

virtual by connecting to the hypervisors

AMI customisation

Page 5: Foreman presentation

NetworkFor network installation, it signals the target server to network boot,by communicating with the BMC or hypervisor, and creates theappropraite network boot PXE setup via the foreman proxy to installthe OS.

The contents of the network boot file are built from templates andcustomised before starting the installation. It relies on a thrid partysource for the installation media, and has templates available forJumpstart, Kickstart, Preseed, AutoYast.

Page 6: Foreman presentation

Image based (AMI)For cloud based compute resources, new systems are provisionedusing images, rather than running an installation. These are thenfinished by Foreman logging into the instance via ssh.

Page 7: Foreman presentation
Page 8: Foreman presentation

Supported platformsEC2

Google compute engine

Libvirt

OpenStack Nova

oVirt / RHEV

Rackspace

VMware

Physical hardware via BMC

Page 9: Foreman presentation

InputsWhen creating a system via foreman, it requires a number of detailsabout the new system which then are used in the templates andfinish scripts. This includes things like, disk size, cpus, memory,networks, puppet classes, host groups, variables, owner, availbilityzone, vpc, os, architecture or AMI image

Page 10: Foreman presentation
Page 11: Foreman presentation

Managed systemsIf you have provisioning turned on for a system, in some cases, youwill have access to the system console, and the ability todelete/rebuild the machine from the foreman console.

Page 12: Foreman presentation

Turning off provisioningFor basic usage of foreman with puppet, as I am describing in thistalk, the provisioning component can be disabled. It is disabled asper below:

/etc/foreman/settings.yaml

# Disable foreman provisioning:unattended: true

Page 13: Foreman presentation

Configuration

"A complete configuration management solution including an ENCfor Puppet, built-in support for parameterized classes and

hierarchical parameter storage."

Page 14: Foreman presentation

ENCExternal Node Classifier

(replaces node definitions)

Page 15: Foreman presentation

Parameters and metainformation

Foreman stores variables, paramters, meta information, class andfacts.

Page 16: Foreman presentation

Paramerized classesControl how your classes behave, for one or many systems

Page 17: Foreman presentation

Host GroupsGroup systems togeather and apply parameters and classes to the

group. Group groups.

Page 18: Foreman presentation
Page 19: Foreman presentation
Page 20: Foreman presentation

Monitoring

"Collect Puppet reports and facts. Monitor host configuration.Report status, distribution and trends."

Page 21: Foreman presentation

What did puppet do?Reports

Page 22: Foreman presentation
Page 23: Foreman presentation
Page 24: Foreman presentation
Page 25: Foreman presentation

Factsyou can use them to find out stuff

Page 26: Foreman presentation
Page 27: Foreman presentation
Page 28: Foreman presentation

Are my hosts managed withpuppet?

Has puppet run recently?

Page 29: Foreman presentation
Page 30: Foreman presentation

Dashboard

Page 31: Foreman presentation
Page 32: Foreman presentation

Statistics

Page 33: Foreman presentation
Page 34: Foreman presentation

General featuresRobust API, restful. CLI as well

Management of DHCP, DNS, TFTP, PXE

PuppetCA

Roles, Users, LDAP

Packaged, managed with puppet

Auditing

Page 35: Foreman presentation

Extra cool featuresForeman data accessable from puppet manifests, removing the

need for puppetdb.

Facts for any host

Hosts matching x

Classes assigned to other hosts

Page 36: Foreman presentation

Review

Page 37: Foreman presentation

Puppet without foremansite.pp or nodes.pp

maybe hiera

read log files

Page 38: Foreman presentation

Agent runsSync pluginsSends factsPuppet master looks for node matching it's nameCompiles catalogNode applies catalogNode logs results to disk, and maybe back to themaster

Page 39: Foreman presentation

node 'common' { $ntpserver = 'time.example.com' include common}node "myhost.linuxbox.co.nz" inherits common { $owner_name = "Glen Ogilvie" include basicstuff class{"mysql": port => 3306, listen => 192.168.213.12, }}

Page 40: Foreman presentation

Or maybe your using hiera/etc/puppet/hieradata/myhost.linuxbox.co.nz.yaml

---"owner_name" : "Glen Ogilvie""classes" : ["mysql","basicstuff"],"mysql::port" : "3306","mysql::listen" : "192.168.213.12"

/etc/puppet/hieradata/common.yaml

---"classes" : [ "common" ],"ntpserver" : "time.example.com"

Page 41: Foreman presentation

Puppet with Foreman

Page 42: Foreman presentation

Agent runsSync pluginsSends factsPuppet master connects to foreman, sending nodenameForeman returns node classes and parameters tomasterCompiles catalogNode applies catalogNode logs results to disk, and to the masterMaster sends results and facts to foreman forstorage

Page 43: Foreman presentation

Foreman YAML---classes: common: mysql: port: 3306 listen: "192.168.213.12" basicstuff:parameters: puppetmaster: configmgmt.oss.co.nz root_pw: $1$xxxxxxxxxxxxxxxxxxx foreman_env: dev owner_name: Glen Ogilvie owner_email: [email protected] ntpserver: time.example.comenvironment: dev

Page 44: Foreman presentation

Foreman Architecture

Page 45: Foreman presentation

Using Foreman

Page 46: Foreman presentation

PuppetCA interfaceto sign new servers

Page 47: Foreman presentation
Page 48: Foreman presentation

Import your classes andenviroments

Page 49: Foreman presentation
Page 50: Foreman presentation

And check the rdoc basedclass docs

Page 51: Foreman presentation
Page 52: Foreman presentation

Setup an existing hostSet meta data like (enviroment, owner)

Attach classes and host groups

Set parameters, or overide parametrizedclasses

Page 53: Foreman presentation
Page 54: Foreman presentation
Page 55: Foreman presentation
Page 56: Foreman presentation
Page 57: Foreman presentation
Page 58: Foreman presentation

It keeps a record of changes

Page 59: Foreman presentation

Parameterized class

# Class: apt# This module manages the initial configuration of apt.## Parameters:# disable_keys - disables package signing check# always_apt_update - apt updated on every run (for dev)

class apt( $always_apt_update = false, $disable_keys = undef, $proxy_host = false, $proxy_port = '8080', $purge_sources_list = false, $purge_sources_list_d = false, $purge_preferences_d = false) {# implimentaton}

Page 60: Foreman presentation
Page 61: Foreman presentation
Page 62: Foreman presentation
Page 63: Foreman presentation
Page 64: Foreman presentation

Installing ForemanInstallation of foreman is actually rather straight forward. Theinstaller, based on your answers, it does some of the below.

Installs puppetSets up a puppet master and configures itInstalls postgresqlSets up tftp, pxe, binddhcpd (disabled by default)Sets up foreman, in apache passenger

Page 65: Foreman presentation

USE the Foreman-installerand

Read the instructions, theyhelp!

http://theforeman.org/manuals/1.3/index.html#3.InstallingForeman

Page 66: Foreman presentation

Installing notesMake sure apt / yum / ruby gem works before youstartThe foreman repo will be added by the installer, if it'snot availableRHEL: make sure EPEL, RHEL optional andpuppetlabs repos are availableMake sure your hostname is what you want. SSLcerts will be created with it.Foreman works with SELinux on, but check the auditlogs if you have troubleRuby versions can be a problem. I use Red Hat SCLto run on ruby 1.9.3

Page 67: Foreman presentation

PuppetUse a recent version of puppet. Your life will be easier! I recommend

using the community version supplied by puppetlabs.

http://yum.puppetlabs.com/

http://apt.puppetlabs.com/

unless all distro's you manage with puppet have version 3.3.x orabove of puppet already.

Page 68: Foreman presentation
Page 69: Foreman presentation

Questions?Track me down at LCA :)

or email me: [email protected]

google+: [email protected]

Page 70: Foreman presentation

Demo


Recommended