continuous integration for configuration management

12
Continuous Integration for Configuration Management Michael Solberg Principal Architect, Red Hat

Upload: michael-solberg

Post on 07-Feb-2017

35 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Continuous Integration for Configuration Management

Continuous Integrationfor Configuration Management

Michael SolbergPrincipal Architect, Red Hat

Page 2: Continuous Integration for Configuration Management

2

AGENDA

Continuous Integration

Configuration Management Testing

Implementing CI for Configuration Management

Page 3: Continuous Integration for Configuration Management

3

CONTINUOUS INTEGRATIONDid I just break something?

TEST BEFORE YOU PUSHSyntax, Unit Tests

TEST AFTER YOU PUSHReproducibility, Build Environments, Unit Tests

TEST BEFORE YOU DEPLOYIntegration Tests, Performance Tests, Merge Tests

Page 4: Continuous Integration for Configuration Management

4

EXAMPLE CI PIPELINEUsed by OpenStack Nova Project

Code moves through a set of manual and automated gates in a feature branch before being committed to the master branch.

Page 5: Continuous Integration for Configuration Management

5

HOW DO WE APPLY THIS TO PUPPET?Configuration Management Testing is a Unique Challenge

● Configuration management systems are distributed.● Configuration management often relies on external data.● Configuration management systems rely on lots of 3rd party

dependencies.● Configuration management can only be applied the first time once.

Page 6: Continuous Integration for Configuration Management

6

CI FOR CONFIGURATION MANAGEMENTDid I just break something?

DOES THE MANIFEST COMPILE?Syntax, Unit Tests

CAN I APPLY THE MANIFEST TO A SYSTEM?Reproducibility, Build Environments, Unit Tests

DID IT DO WHAT I EXPECTED IT TO DO?Integration Tests, Performance Tests, Merge Tests

Page 7: Continuous Integration for Configuration Management

7

PROCESSFrom code commit to tested configuration

● Code is committed to the repository.● Commit is validated by CI Server● CI Server updates the CF system with the new commit.● CI Server provisions a new VM.● The virtual machine applies the new configuration.● CI Server checks with config management server that the configuration

was applied without error.● CI Server runs functional tests against the configured VM.● CI Server records the results and (optionally) powers off the VM.

Page 8: Continuous Integration for Configuration Management

8

CONFIGURATION MANAGEMENT CI PIPELINEFor Puppet

Feedback is generated through interactions between the CI Server, CMS, and IaaS.

Configuration Management CI Workflow Virtual Infrastructure

1. commit to scm3. provisions new system

feedback to devs

CI Server

config management system

2. updates environment

configured system

IaaS layer

4. points system to new config

5. pulls latest config and sends report

6. runs tests

7. gather feedback and send to devs

Page 9: Continuous Integration for Configuration Management

9

WHAT INGREDIENTS DO I NEED?Essential Functionality

SOURCE CONTROL/CI SERVERGit, Jenkins

CONFIGURATION MANAGEMENT SERVERForeman/Puppet Master

INFRASTRUCTURE AS A SERVICEOpenStack, oVirt, VMWare

Page 10: Continuous Integration for Configuration Management

DEMO

Page 11: Continuous Integration for Configuration Management

11

CHALLENGES/SOLUTIONSQuestions we encountered while developing the process.

● How do I know that the Puppet run for a given “build” is the latest commit?● Custom Puppet Fact injection by Jenkins

● How do I test upgrades as well as new deployments?● Apply new changes to pre-provisioned VMs

● How do I manage the Puppet environments?● Katello/Satellite provides API, r10k

● How do I promote code through different lifecycle environments?● Katello/Satellite provides lifecycle management.

Page 12: Continuous Integration for Configuration Management

THANK YOU

plus.google.com/+RedHat

youtube.com/user/RedHatVideos

facebook.com/redhatinc

twitter.com/RedHatNewslinkedin.com/company/red-hat