61
Foreman Basics

Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Embed Size (px)

Citation preview

Page 1: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

ForemanBasics

Page 2: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Besmart.Thinkopensource.

Page 3: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Foreman-BasicsLifecyclemanagementofphysicalandvirtualmachinesmadeeasy!

Page 4: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Agenda

IntroductiontoForeman

Architecture

Setup

Provisioning

Configuration

Monitoring

Advancedfeatures

Page 5: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

IntroductiontoForemanWhat'sitallabout?

Page 6: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Facts

Projectstartedin2009

LicensedundertheGPLv3

DevelopmentpushedbyRedHat

Veryactive&helpfulcommunity

Page 7: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Overview

ToolforprovisioningofVMs&baremetal

Providesconfigmanagement&monitoringintegration

Rails&JavaScriptapplication

Exposesawebinterface,RESTAPI&CLI

Page 8: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Ecosystem

Foreman

SmartProxy(foreman-proxy)

Katello

Tonsofplugins

Page 9: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Strongsuite

Veryflexible

Offerstonsoffeatures

Activedevelopment&opencommunity

Modularsetup,startsmallthenexpand

Page 10: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Strongsuite

Canserveasasourceoftruth(CMDB)

CanbeusedasanENC

ProperACLimplementation

EnterpriseSupportavailable(RedHatSatellite6)

Page 11: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Weakspots

Somewhatsteeplearningcurve

Canbequitetrickytodebuganissue

APIhasroomforimprovement

Offerssometimestoomanypossiblewaystoimplementatask

Page 12: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

ArchitectureOverviewofthedifferentcomponents

Page 13: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Bird's-eyeview

Page 14: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Foreman

Heartofthewholestack

Storesallresources&information

Railsstack,usePassenger+nginx/Apachetorunit

StoresmostdatainaDB(SQLite,MySQLorPostgreSQL)

LocalorLDAPusersforauthentication

Page 15: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

SmartProxy

SmallautonomousHTTPapplication

ExposesaRESTAPItoprovidedifferentservices

AllowsForemantocontrolcomponentsinisolatednetworks

Alsocalledforeman-proxy

Page 16: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

SmartProxy

DHCP

DNS

TFTP

BMC/IPMI

Puppet/Salt/Chef/Ansible

Realm/FreeIPA

Page 17: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

SmartProxy-DHCP

TakescareofreservingtherequiredIPs

ProvidesIPauto-assignment

SupportsISCDHCP,MSDHCP&libvirt

Moreproviderscanbeinstalledordeveloped(e.g.InfoBlox)

Page 18: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

SmartProxy-DNS

UpdateandremoveDNSrecordsautomatically

TakescareofA,AAAA&PTRrecords

SupportsBind,MSDNS&libvirt

Moreproviderscanbeinstalledordeveloped(e.g.AWS53)

Page 19: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

SmartProxy-TFTP

ProvideimagesduringPXEboot

Automagicallydownloadskernel+initrd(installer)

PreparesMACspecificconfigdependingonthebuildstate

Fallbackto default

Page 20: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Terminology

Host

Installationmedia

Partitiontables

Provisioningtemplates

Page 21: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Terminology

Environment

Computeresources

Computeprofiles

Page 22: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Hands-on::Basics01DiscoverthebasicsofForeman

Page 23: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

ForemanSetupGetForemanupandrunninginminutes

Page 24: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

RequirementsSupporteddistributions:

RHEL7,CentOS7&ScientificLinux7

Fedora24

Debian8

Ubuntu14.04&16.04

Page 25: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Requirements

StandardVMissufficientforthestart

Additionalrepositoriesdependingonthedistribution

Internetaccess

Firewallports

Page 26: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Installationpaths

foreman-installer(recommendedbytheproject)

Installfrompackage

Installfromsource

Alternatives(Ansibleplaybook,etc.)

Page 27: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

foreman-installerMakesuseofdifferentPuppetmodulestodeployacompleteForemanstack:

Foreman

Smartproxy

Passenger

TFTP,DNS&DHCP

Page 28: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

foreman-installer

CustomizablewithCLIparameters

Answersfile

Scenarios

Page 29: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

ProvisioningMakingdeploymentsaseasyaspie

Page 30: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Introduction

Provisioningincludesallthetasksrequiredtosetupanewmachine

Savingtimeisn'tthemaingoal

Enforceconsistencyacrossalldeploymentsiskey

Page 31: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Workflow

1. Boottheinstaller

2. Starttheinstallation

3. GetfurtherinstructionsfromForeman

Page 32: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Boottheinstaller

PXEBoot(TFTPprovidedbyForeman)

ISOimage

iPXEimage

Page 33: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Starttheinstallation

Telltheinstallerwherefurtherinstructionsarelocated

RedHatKickstart

ks=http://foreman.example.com/unattended/provision

DebianPreseed

url=http://foreman.example.com/unattended/provision

Definedaskernelparameterswhenloadingtheinstaller

Page 34: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Installerinstructions

Foremanprovidestemplatingfunctionality

ERBtemplatesarerenderedperhostContainvariables,loops,snippets,etc.

See provisioningtemplates & partitiontables

Page 35: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Templates

Foremanprovidescommunitytemplates

Vanillatemplatesarelockedbydefault

Canbedeletedbutsomearemandatory(e.g. PXELinuxglobaldefault )

Page 36: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Templates

Partitiontablesareusedtodefinethefilesystemlayout

Differentprovisioningtemplatetypesareavailable:

Provisioning

Finish

etc.

Page 37: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

RequirementsForacompleteprovisioningworkflowweneedsomeresources:

Architecture

Installationmedia(mirror)

OS

Templates

Page 38: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Example

x86_64

http://mirror.centos.org/centos/$version/os/$arch

CentOS7

DefaultFSLayout,Kickstart&Finishscript

Page 39: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Hands-on::Basics02AutomatingOSdeploymentsishardyou'vesaid?

Page 40: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

ConfigurationBringorderintoyourorganization

Page 41: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

StructureForemanprovidesdifferentresourcestoorganizehosts:

Hostgroup

Domains

Environments

Organizations&Locations

Page 42: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

StructureParameterinheritancelookslikethis:

Environment->Domains->Hostgroup->Host

Page 43: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

ConfigManagement„Definehowasystemshouldlooklikeinanabstractway.“

Page 44: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Integration

ForemanprovidesENCfunctionality

SupportsmainlyPuppetbutextendablewithplugins

Page 45: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Ansible

Ansiblepluginisstillthenewfaceintown

AnsibleprovidesdynamicForemaninventoryscript

Rolescanbeassignedtohostsandhostgroups

PlayrolesthroughtheGUI

ImportanddeleterolesthroughtheGUI

Page 46: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Hands-on::Basics03LookingintotheAnsibleintegration

Page 47: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

MonitoringCollectandaggregateeverything

Page 48: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Facts

Foremansavesfactsforeachhost

CollectfactsregularlyandstoretheminForeman

LeveragethemagaininyourConfigManagementTool

Page 49: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Reports

Collectandtrackconfigchanges

MainlysupportedforPuppet/Salt

Page 50: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Moredata

Auditlogkeepstrackofallchanges,veryhandy

Trendsgiveanoverviewofyourinfrastructure

Page 51: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

AdvancedfeaturesAddingevenmorefancystuff

Page 52: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Plugins

Cloudproviders(Azure,Digitalocean,etc.)

Docker

VMWare&libvirt

Katello

OpenSCAP

Page 53: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

ForemanAutomation

ForemanprovidesRESTAPI

Canbeeasilyusedtoautomateadditionaltasks

HammerisaCLItool

SomewhatlimitedbecauseinternalIDshavetobelookedupfirst

Othertools(foreman-yml,etc.)

Page 54: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

FieldreportWhathaveyoulearned?

Architecture

Setup

Provisioning

Configuration

Monitoring

Advancedfeatures

Page 55: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Quovadis?

ForemanAutomation

Externalservices(passwordstores,CMDB,etc.)

DevelopmentWorkflow(CI&CT)

Page 56: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

FeedbackThegood,thebadandtheugly

Page 57: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Thankyou!Besmart.Thinkopensource.

Page 59: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Attribution/License

TheForemanlogobyTheForemanprojectLicenseCCBY-SA3.0https://github.com/theforeman/foreman-graphics

ForemanArchitecturebyTheForemanprojectLicenseCCBY-SA3.0https://theforeman.org/static/images/foreman_architecture.png

ForemanProvisioningbyTheForemanprojectLicenseCCBY-SA3.0https://theforeman.org/static/images/provisioning.png

Page 60: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!

Attribution/License

ForemanConfigurationbyTheForemanprojectLicenseCCBY-SA3.0https://theforeman.org/static/images/configuration.png

ForemanMonitoringbyTheForemanprojectLicenseCCBY-SA3.0https://theforeman.org/static/images/monitoring.png

XKCD-TheGeneralProblembyxkcdhttps://xkcd.com/974/LicenseCC-BY-NChttps://xkcd.com/license.html

Page 61: Foreman Basics - docs.adfinis-sygroup.ch · Foreman - Basics Lifecycle management of physical and virtual machines made easy!