Configuration Management with Puppet

Rachel Andrew
Rachel AndrewWriter, speaker, co-founder of Perch CMS. Google Developer Expert for Web Technologies at A List Apart
Configuration Management
with Puppet
Rachel Andrew, Future Insights Live! 2015
Photo credit: https://www.flickr.com/photos/andreakirkby/5450450019
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Rachel Andrew
http://rachelandrew.co.uk
@rachelandrew
http://grabaperch.com
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Many issues coming into support stem from
poor development and deployment processes.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
The Big Problems
• Developing directly on live sites or in subfolders of live sites
• Developing in subfolders locally
• Setting up local development environments that are so
different to the eventual live server that there is no
confidence when going live
• Working in teams where everyone has a slightly different
setup
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Improving workflow is the best way to give
yourself more hours in the day.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Today we’re going to take a look at
• A really simple way to get started with Vagrant and Puppet
for those of you who haven’t used these tools before.
• Vagrant and Puppet fundamentals, how to start writing your
own manifests.
• How you can take this knowledge into production, even if you
manage just one or two servers.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
First Steps
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
We need …
• to develop multiple websites on our own computer.
• to know that our live server and local server support the
same things.
• to deploy our site and have confidence that what is on the live
server is identical to our local version.
• to have everyone who works on a site using the same
development environment so we aren’t creating problems for
each other.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Q. How do you develop sites locally that require a
web server?
A. MAMP, WAMP, XAMPP or similar
63%
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
In an ideal world your local development
environment is identical to the live server.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
http://php.net/manual/en/function.strftime.php
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
PHP Versions can be different. PHP modules
may not be available on the live server.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Virtual Machines
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
virtualbox.org
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
vagrantup.com
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
https://puphpet.com
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
http://rachelandrew.co.uk/presentations/deploy/puphpet
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Upload a PHP file with
this function to find out
what is available on your
live server.
<?php phpinfo();?>
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Things to check on your live server
• PHP Version
• Installed modules such as gd for image processing
• post_max_size and upload_max_filesize determine the size
of files that can be uploaded
• max_input_vars is the number of form fields allowed in a
post
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Shared Folders
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Basic commands for
Vagrant.
// start the VM
> vagrant up
// shut down the VM
> vagrant halt
//destroy the VM
> vagrant destroy
//ssh access
> vagrant ssh
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
http://vagrantmanager.com/
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Share your package with anyone else working
on the site. The whole team can then have the
exact same development setup.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Using PuPHPet should get you up and running
in a few hours. This will pay dividends in time
saved in the long run.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Getting Under the Hood
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
https://github.com/PerchCMS/perch-vagrant
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
In the Vagrantfile we tell
Vagrant we will be
provisioning with Puppet.
# Enable the Puppet provisioner, point it to
our files
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "site.pp"
puppet.module_path = "puppet/modules"
puppet.hiera_config_path = "puppet/hiera.yaml"
end
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
What is Puppet?
• A Configuration Management solution
• Allows you to define in code the state of a server including
• Packages that should be installed
• Services that should be running
• Files and folders
• Permissions
• Cron jobs
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
You could set up a VM and
then install everything by
hand using the package
manager for your
distribution.
> sudo apt-get install apache2
> sudo apt-get install mysql-server
> sudo apt-get install php5 php5-mysql
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Puppet Terminology
• Manifest: a file that contains Puppet code
• Resource: a thing that needs configuring, Apache is a
resource, and so is a virtual-host. Resources have types - for
example file, package, cron.
• Module: a collection of manifests, templates and other files
organised around a particular purpose.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Inside the Apache module
is a manifests folder. This
contains the manifests:
- init.pp
- vhost.pp puppet
modules
apache
manifests
- init.pp
- vhost.pp
templates
- vhost-default-conf.erb
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
All modules need an
init.pp manifest. It is used
when the module is
included.
In the apache init.pp
- install the apache
package
- make sure apache is
running
- install the rewrite
module
class apache {
package { "apache2":
ensure => present,
}
service { "apache2":
ensure => running,
require => Package["apache2"],
}
file { "/etc/apache2/mods-enabled/rewrite.load":
ensure => link,
target => "/etc/apache2/mods-available/rewrite.load",
require => Package["apache2"]
}
}
http://garylarizza.com/blog/2014/10/19/on-dependencies-and-order/
On dependencies and order - why Puppet
doesn’t care about execution order (until it
does).
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
The manifest file vhost.pp
sets up a VirtualHost by
creating a file in sites-
available and symlinking it
into sites-enabled.
We notify the apache2
service, which will then
reload to pick up the new
config.
define apache::vhost(
$vhost_docroot = false,
$vhost_name = false,
$vhost_options =['Indexes','FollowSymLinks','MultiViews'],
) {
file {"/etc/apache2/sites-available/${vhost_name}":
content => template("apache/vhost-default.conf.erb"),
owner => 'root',
group => 'root',
mode => '755',
require => Package['apache2'],
notify => Service['apache2'];
"/etc/apache2/sites-enabled/${vhost_name}":
ensure => link,
target => "/etc/apache2/sites-available/${vhost_name}",
notify => Service['apache2'];
}
}
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
The template file for a
VirtualHost includes
variables which will be
replaced out by the
details for each host.
# ************************************
# Default template for vhosts
# Managed by Puppet
# ************************************
<VirtualHost *:80>
ServerName <%= @vhost_name %>
DocumentRoot <%= @vhost_docroot %>
<Directory <%= @vhost_docroot %>>
Options <%= @vhost_options %>
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/<%= @vhost_name %>_error.log
LogLevel warn
CustomLog /var/log/apache2/<%= @vhost_name %>_access.log
combined
ServerSignature Off
</VirtualHost>
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
In the Vagrantfile we tell
Vagrant we will be
provisioning with Puppet.
# Enable the Puppet provisioner, point it to
our files
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "site.pp"
puppet.module_path = "puppet/modules"
puppet.hiera_config_path = "puppet/hiera.yaml"
end
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
The site.pp file is special
and kicks off the whole
process.
In my case it includes the
modules we want to run.
stage { 'setup':
before => Stage['main']
}
class { 'base':
stage => 'setup'
}
include base, apache, mysql, php,
bootstrap
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
In the Vagrantfile we tell
Vagrant we will be
provisioning with Puppet.
# Enable the Puppet provisioner, point it to
our files
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "site.pp"
puppet.module_path = "puppet/modules"
puppet.hiera_config_path = "puppet/hiera.yaml"
end
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
The Hiera config file
defines a YAML backend
and gives the location of
the configuration data.
In my project that is in the
manifest directory, in a
folder named hiera.
---
:backends: yaml
:yaml:
:datadir: "%{settings::manifestdir}/
hiera"
:hierarchy:
- "%{::clientcert}"
- "%{::environment}"
- config
:logger: console
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
In my YAML file I have
added a setting for
mysql_root_password.
File: 

manifests/hiera/config.yaml
mysql_root_password: 'vagrant'
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
I set the parameter
$root_pw with the value
using a hiera() function.
I can then use $root_pw
within the manifests.
File: 

modules/mysql/manifests/
init.pp
class mysql(
$root_pw = hiera('mysql_root_password'),
) {
package { "mysql-server":
ensure => present,
}
service { "mysql":
enable => true,
ensure => running,
require => Package["mysql-server"],
}
exec { "set-mysql-password":
unless => "/usr/bin/mysqladmin -uroot -p$root_pw status",
command => "/usr/bin/mysqladmin -uroot password $root_pw",
require => Service["mysql"],
}
}
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
In my YAML file I have a
list of PHP Modules.
File: 

manifests/hiera/config.yaml
php_modules:
- "php5"
- "php5-cli"
- "php5-mysql"
- "php5-gd"
- "php5-imagick"
- "php5-curl"
- "libapache2-mod-php5"
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
I get the php_modules
with the hiera function
and then pass the list to
the package resource
type.
File: 

modules/php/manifests/
init.pp
class php(
$packages = hiera('php_modules'),
$php_upload_max_filesize = hiera('php_upload_max_filesize'),
$php_max_file_uploads = hiera('php_max_file_uploads'),
$php_memory_limit = hiera('php_memory_limit'),
$php_error_reporting = hiera('php_error_reporting'),
$php_post_max_size = hiera('php_post_max_size'),
) {
package { $packages:
ensure => present,
}
file {'/etc/php5/apache2/php.ini':
ensure => file,
content => template("php/php.ini.erb"),
notify => Service["apache2"],
require => Package["php5"],
}
}
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
The template file for a
VirtualHost includes
variables which will be
replaced out by the
details for each host.
# ************************************
# Default template for vhosts
# Managed by Puppet
# ************************************
<VirtualHost *:80>
ServerName <%= @vhost_name %>
DocumentRoot <%= @vhost_docroot %>
<Directory <%= @vhost_docroot %>>
Options <%= @vhost_options %>
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/<%= @vhost_name %>_error.log
LogLevel warn
CustomLog /var/log/apache2/<%= @vhost_name %>_access.log
combined
ServerSignature Off
</VirtualHost>
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
In my YAML file I have
configures two sites.
apache_vhosts:
site1:
vhost_docroot: '/var/www/test_site1'
vhost_name: 'site1.dev'
vhost_options: 'All'
site2:
vhost_docroot: '/var/www/test_site2'
vhost_name: 'site2.dev'
vhost_options: 'All'
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Use the hiera_hash
function to get my site
information and pass it to
create_resources.
The create_resources
function then calls my
host manifest with that
hash as the data.
class bootstrap {
# Make sure everything is installed
$sites = hiera_hash('apache_vhosts')
create_resources('apache::vhost',$sites)
$databases = hiera_hash('mysql_db')
create_resources('mysql::db',$databases)
}
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
This is the manifest that
creates the databases I
need. define mysql::db(
$db_name = false,
$db_user = false,
$db_password = false,
$root_pw = hiera('mysql_root_password'),
) {
exec { "create-${db_name}":
unless => "/usr/bin/mysql -u${db_user} -p$
{db_password} ${db_name}",
command => "/usr/bin/mysql -uroot -p$
{root_pw} -e "create database ${db_name}; grant
all on ${db_name}.* to ${db_user}@localhost
identified by '$db_password';"",
require => Exec["set-mysql-password"],
}
}
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
To set up a new VM
• git clone
• edit the Vagrantfile for IP address, project name
• edit the config.yaml to create sites and databases
• vagrant up
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Your entire development environment
can now be described in text files.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Share your environment with your
team - they just edit the config.yaml.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Provisioning files and data
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
https://github.com/PerchCMS/perch-vagrant
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
The challenge
• Take latest files and database dump from Github
• Deploy the three sites with the current Perch version and
add-ons
• Run the upgrade and change any templates as needed
• Produce the db dump with placeholders for Github and a Ruby
db template with placeholders for the demo server
• Produce zipped archives for use by the demo server
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
https://forge.puppetlabs.com/puppetlabs/vcsrepo
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Using the Puppetlabs
vcsrepo module to clone a
repository.
vcsrepo { '/path/to/repo':
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
}
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
The YAML definition for
one of our three demos. It
includes the Git repo,
local path, database
details and Perch license
key.
I also detail the Perch
Add-ons that need to be
installed along with Perch
Core.
demo2:
repo_uri: 'https://github.com/PerchCMS/
perchdemo-swift'
vhost_path: '/var/www/perchdemos/demo-swift'
db_name: 'db_demo_swift'
db_user: 'vagrant'
db_password: 'vagrant'
key: ‘xxxx-xxxx-xxxx-xxxx‘
sql_path: '/sql/swift_demo.sql'
install_addons:
demo2_blog:
addon_name: 'perch_blog'
addon_type: 'apps'
demo2_forms:
addon_name: 'perch_forms'
addon_type: 'apps'
demo2_questions:
addon_name: 'perch_questions'
addon_type: 'apps'
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
I deploy my databases
and sites but also set off
a build of the demos.
class bootstrap {
$databases = hiera_hash('mysql_db')
create_resources(‘mysql::db',$databases)
$demos = hiera_hash('demo_deploy')
create_resources(‘perchdemo::deploy',$demos)
$sites = hiera_hash('apache_vhosts')
create_resources('apache::vhost',$sites)
}
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
In deploy.pp we get the
files from git, each site
has a database dump
which I do some string
replacement on - then
import it.
vcsrepo { "${vhost_path}":
ensure => present,
provider => git,
source => $repo_uri,
}
exec { "replace-${db_name}":
command => "/bin/sed -i 's/{firstname}/REPLACE_firstname/
g' ${vhost_path}${sql_path} ; /bin/sed -i 's/{lastname}/
REPLACE_lastname/g' ${vhost_path}${sql_path} ; /bin/sed -i
's/{email}/REPLACE_hello@grabaperch.com/g' ${vhost_path}$
{sql_path} ; /bin/sed -i 's/{username}/REPLACE_username/g'
${vhost_path}${sql_path} ; /bin/sed -i 's/{password}/
5f4dcc3b5aa765d61d8327deb882cf99/g' ${vhost_path}$
{sql_path}",
}
exec { "import-${db_name}":
command => "/usr/bin/mysql -uroot -p${root_pw} $
{db_name} < ${vhost_path}${sql_path}",
}
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Up to date Perch Core
and add-ons are in a local
file store.
I use a Ruby .erb template
for the Perch Config so I
can add the database
details and license key.
I use create_resources to
add the add-ons specified
in the YAML for this site.
file { "${vhost_path}/public_html/perch/core":
ensure => present,
source => "${file_store}/core",
recurse => true,
}
file { "${vhost_path}/public_html/perch/config/
config.private.php":
ensure => present,
content => template('perchdemo/config.private.php.erb'),
}
create_resources('perchdemo::copy_addons',$install_addons,
{'vhost_path'=>$vhost_path,'file_store'=>$file_store})
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
At the command line you
can run puppet apply to
run a manifest.
In this case I am running
builder.pp which builds
me an archive to upload
for each site. > puppet apply --modulepath=/vagrant/
puppet/modules --hiera_config /vagrant/
puppet/hiera.yaml -e "include
perchdemo::builder"
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Taking Puppet to Production
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Puppet Masters
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Masterless Puppet
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
You don’t have to provision the entire server
using Puppet. Start with small tasks.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Use Puppet to create user accounts with the correct
privileges and ssh keys on each server you set up.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Use an inexpensive VPS for client staging
sites. Manage the VirtualHosts using Puppet.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
https://forge.puppetlabs.com/puppetlabs/apache
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Schedule regular Puppet runs to check that
services are running, and restart them if not
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Puppet can ensure files and directories exist
and they have the correct permissions set
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Using Puppet can allow people to edit
configs without needing privileges on
production servers.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Configuration can be edited, checked into Git
and reviewed before being deployed.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Modules you use on the server can
often be also used in development.
Ensuring the same environment.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Change one small thing.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Improve one thing about your
workflow. Build from there.
@rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
Thank you FILIVE!
Rachel Andrew
http://rachelandrew.co.uk/presentations/puppet-developers
me@rachelandrew.co.uk
@rachelandrew
1 of 84

Recommended

ZendCon 2015 - Laravel Forge: Hello World to Hello Production by
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionJoe Ferguson
1.4K views117 slides
Web Leaps Forward by
Web Leaps ForwardWeb Leaps Forward
Web Leaps ForwardMoh Haghighat
1.7K views50 slides
ZendCon 2015 - DevOps for Small Teams by
ZendCon 2015 - DevOps for Small TeamsZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsJoe Ferguson
949 views71 slides
php[world] 2015 Laravel 5.1: From Homestead to the Cloud by
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the CloudJoe Ferguson
1.4K views126 slides
Frontend SPOF by
Frontend SPOFFrontend SPOF
Frontend SPOFPatrick Meenan
4.2K views30 slides
WordPress automation and CI by
WordPress automation and CIWordPress automation and CI
WordPress automation and CIRan Bar-Zik
2K views29 slides

More Related Content

What's hot

Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ... by
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Matt Raible
619 views44 slides
Cache is King by
Cache is KingCache is King
Cache is KingSteve Souders
6.6K views70 slides
Rapidly scaffold your frontend with yeoman by
Rapidly scaffold your frontend with yeomanRapidly scaffold your frontend with yeoman
Rapidly scaffold your frontend with yeomanSimon Waibl
9.5K views33 slides
php[world] 2015 Training - Laravel from the Ground Up by
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground UpJoe Ferguson
980 views25 slides
Simple ways to add and work with a `.jar` file in your local maven setup by
Simple ways to add and work with a `.jar` file in your local maven setupSimple ways to add and work with a `.jar` file in your local maven setup
Simple ways to add and work with a `.jar` file in your local maven setupAlan Richardson
173 views18 slides
Continuous (Production) Integration: Ruby on Rails Application Monitoring wit... by
Continuous (Production) Integration: Ruby on Rails Application Monitoring wit...Continuous (Production) Integration: Ruby on Rails Application Monitoring wit...
Continuous (Production) Integration: Ruby on Rails Application Monitoring wit...jnewland
6.7K views81 slides

What's hot(20)

Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ... by Matt Raible
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Matt Raible619 views
Rapidly scaffold your frontend with yeoman by Simon Waibl
Rapidly scaffold your frontend with yeomanRapidly scaffold your frontend with yeoman
Rapidly scaffold your frontend with yeoman
Simon Waibl9.5K views
php[world] 2015 Training - Laravel from the Ground Up by Joe Ferguson
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Up
Joe Ferguson980 views
Simple ways to add and work with a `.jar` file in your local maven setup by Alan Richardson
Simple ways to add and work with a `.jar` file in your local maven setupSimple ways to add and work with a `.jar` file in your local maven setup
Simple ways to add and work with a `.jar` file in your local maven setup
Alan Richardson173 views
Continuous (Production) Integration: Ruby on Rails Application Monitoring wit... by jnewland
Continuous (Production) Integration: Ruby on Rails Application Monitoring wit...Continuous (Production) Integration: Ruby on Rails Application Monitoring wit...
Continuous (Production) Integration: Ruby on Rails Application Monitoring wit...
jnewland6.7K views
DevSpace Conf 2017 - Making sense of the provisioning circus by Joe Ferguson
DevSpace Conf 2017 - Making sense of the provisioning circusDevSpace Conf 2017 - Making sense of the provisioning circus
DevSpace Conf 2017 - Making sense of the provisioning circus
Joe Ferguson209 views
Your Script Just Killed My Site by Steve Souders
Your Script Just Killed My SiteYour Script Just Killed My Site
Your Script Just Killed My Site
Steve Souders10.5K views
Spring Boot 1.3 News #渋谷Java by Toshiaki Maki
Spring Boot 1.3 News #渋谷JavaSpring Boot 1.3 News #渋谷Java
Spring Boot 1.3 News #渋谷Java
Toshiaki Maki10.1K views
perlbrew yapcasia 2010 by Kang-min Liu
perlbrew yapcasia 2010perlbrew yapcasia 2010
perlbrew yapcasia 2010
Kang-min Liu1.4K views
Front end workflow with yeoman by hassan hafez
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeoman
hassan hafez922 views
JSUG - Maven by Michael Greifeneder by Christoph Pickl
JSUG - Maven by Michael GreifenederJSUG - Maven by Michael Greifeneder
JSUG - Maven by Michael Greifeneder
Christoph Pickl433 views
High Performance JavaScript (CapitolJS 2011) by Nicholas Zakas
High Performance JavaScript (CapitolJS 2011)High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)
Nicholas Zakas57.5K views
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli by Rebecca Eloise Hogg
Getting Started with Test Automation: Introduction to Cucumber with Lapis LazuliGetting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Rebecca Eloise Hogg1.3K views
Cleaning up a WordPress Mess by Jonny Shaw
Cleaning up a WordPress MessCleaning up a WordPress Mess
Cleaning up a WordPress Mess
Jonny Shaw116 views
Building a PWA - For Everyone Who Is Scared To by Raymond Camden
Building a PWA - For Everyone Who Is Scared ToBuilding a PWA - For Everyone Who Is Scared To
Building a PWA - For Everyone Who Is Scared To
Raymond Camden844 views
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps by Pablo Godel
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel4.9K views
appserver.io tutorial by appserver.io
appserver.io tutorialappserver.io tutorial
appserver.io tutorial
appserver.io1.3K views

Similar to Configuration Management with Puppet

ConFoo 2016: Development to Deployment by
ConFoo 2016: Development to DeploymentConFoo 2016: Development to Deployment
ConFoo 2016: Development to DeploymentRachel Andrew
703 views97 slides
Professional Workflow from Development to Deployment by
Professional Workflow from Development to DeploymentProfessional Workflow from Development to Deployment
Professional Workflow from Development to DeploymentRachel Andrew
1.8K views97 slides
WordCamp Belfast DevOps for Beginners by
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersStewart Ritchie
108 views53 slides
Madison PHP 2015 - DevOps For Small Teams by
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsJoe Ferguson
806 views71 slides
Puppet and Vagrant in development by
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
6.8K views29 slides
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle by
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattlegarrett honeycutt
1.6K views72 slides

Similar to Configuration Management with Puppet (20)

ConFoo 2016: Development to Deployment by Rachel Andrew
ConFoo 2016: Development to DeploymentConFoo 2016: Development to Deployment
ConFoo 2016: Development to Deployment
Rachel Andrew703 views
Professional Workflow from Development to Deployment by Rachel Andrew
Professional Workflow from Development to DeploymentProfessional Workflow from Development to Deployment
Professional Workflow from Development to Deployment
Rachel Andrew1.8K views
WordCamp Belfast DevOps for Beginners by Stewart Ritchie
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for Beginners
Stewart Ritchie108 views
Madison PHP 2015 - DevOps For Small Teams by Joe Ferguson
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small Teams
Joe Ferguson806 views
Puppet and Vagrant in development by Adam Culp
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
Adam Culp6.8K views
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle by garrett honeycutt
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
garrett honeycutt1.6K views
Vagrant and puppet: Deployment made easy by Geronimo Orozco
Vagrant and puppet: Deployment made easyVagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easy
Geronimo Orozco1.3K views
Making the Most of Plug-ins - WordCamp Toronto 2008 by Brendan Sera-Shriar
Making the Most of Plug-ins - WordCamp Toronto 2008Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008
Brendan Sera-Shriar1.9K views
Adventures in Laravel 5 SunshinePHP 2016 Tutorial by Joe Ferguson
Adventures in Laravel 5 SunshinePHP 2016 TutorialAdventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Joe Ferguson5.6K views
Creating Developer-Friendly Docker Containers with Chaperone by Gary Wisniewski
Creating Developer-Friendly Docker Containers with ChaperoneCreating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with Chaperone
Gary Wisniewski3.1K views
Puppet getting started by Dirk Götz by NETWAYS
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk Götz
NETWAYS1.6K views
Virtualize and automate your development environment for fun and profit by Andreas Heim
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
Andreas Heim2.3K views
Active Web Development by Divya Manian
Active Web DevelopmentActive Web Development
Active Web Development
Divya Manian2.4K views
DiUS Computing Lca Rails Final by Robert Postill
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails Final
Robert Postill587 views
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am... by Alexander Dean
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
Alexander Dean3.3K views
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa... by Edureka!
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Edureka!5.7K views
Midwest PHP 2017 DevOps For Small team by Joe Ferguson
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small team
Joe Ferguson540 views

More from Rachel Andrew

All Day Hey! Unlocking The Power of CSS Grid Layout by
All Day Hey! Unlocking The Power of CSS Grid LayoutAll Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid LayoutRachel Andrew
2.2K views113 slides
SmashingConf SF: Unlocking the Power of CSS Grid Layout by
SmashingConf SF: Unlocking the Power of CSS Grid LayoutSmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid LayoutRachel Andrew
2.3K views113 slides
Unlocking the Power of CSS Grid Layout by
Unlocking the Power of CSS Grid LayoutUnlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid LayoutRachel Andrew
2K views113 slides
The Creative New World of CSS by
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSSRachel Andrew
2K views144 slides
Into the Weeds of CSS Layout by
Into the Weeds of CSS LayoutInto the Weeds of CSS Layout
Into the Weeds of CSS LayoutRachel Andrew
1.5K views93 slides
Solving Layout Problems with CSS Grid & Friends - DevFest17 by
Solving Layout Problems with CSS Grid & Friends - DevFest17Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17Rachel Andrew
2.1K views96 slides

More from Rachel Andrew(20)

All Day Hey! Unlocking The Power of CSS Grid Layout by Rachel Andrew
All Day Hey! Unlocking The Power of CSS Grid LayoutAll Day Hey! Unlocking The Power of CSS Grid Layout
All Day Hey! Unlocking The Power of CSS Grid Layout
Rachel Andrew2.2K views
SmashingConf SF: Unlocking the Power of CSS Grid Layout by Rachel Andrew
SmashingConf SF: Unlocking the Power of CSS Grid LayoutSmashingConf SF: Unlocking the Power of CSS Grid Layout
SmashingConf SF: Unlocking the Power of CSS Grid Layout
Rachel Andrew2.3K views
Unlocking the Power of CSS Grid Layout by Rachel Andrew
Unlocking the Power of CSS Grid LayoutUnlocking the Power of CSS Grid Layout
Unlocking the Power of CSS Grid Layout
Rachel Andrew2K views
The Creative New World of CSS by Rachel Andrew
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSS
Rachel Andrew2K views
Into the Weeds of CSS Layout by Rachel Andrew
Into the Weeds of CSS LayoutInto the Weeds of CSS Layout
Into the Weeds of CSS Layout
Rachel Andrew1.5K views
Solving Layout Problems with CSS Grid & Friends - DevFest17 by Rachel Andrew
Solving Layout Problems with CSS Grid & Friends - DevFest17Solving Layout Problems with CSS Grid & Friends - DevFest17
Solving Layout Problems with CSS Grid & Friends - DevFest17
Rachel Andrew2.1K views
View Source London: Solving Layout Problems with CSS Grid & Friends by Rachel Andrew
View Source London: Solving Layout Problems with CSS Grid & FriendsView Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew1K views
DevFest Nantes - Start Using CSS Grid Layout today by Rachel Andrew
DevFest Nantes - Start Using CSS Grid Layout todayDevFest Nantes - Start Using CSS Grid Layout today
DevFest Nantes - Start Using CSS Grid Layout today
Rachel Andrew1.1K views
Start Using CSS Grid Layout Today - RuhrJS by Rachel Andrew
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJS
Rachel Andrew990 views
404.ie: Solving Layout Problems with CSS Grid & Friends by Rachel Andrew
404.ie: Solving Layout Problems with CSS Grid & Friends404.ie: Solving Layout Problems with CSS Grid & Friends
404.ie: Solving Layout Problems with CSS Grid & Friends
Rachel Andrew909 views
Solving Layout Problems with CSS Grid & Friends - WEBU17 by Rachel Andrew
Solving Layout Problems with CSS Grid & Friends - WEBU17Solving Layout Problems with CSS Grid & Friends - WEBU17
Solving Layout Problems with CSS Grid & Friends - WEBU17
Rachel Andrew902 views
Laying out the future with grid & flexbox - Smashing Conf Freiburg by Rachel Andrew
Laying out the future with grid & flexbox - Smashing Conf FreiburgLaying out the future with grid & flexbox - Smashing Conf Freiburg
Laying out the future with grid & flexbox - Smashing Conf Freiburg
Rachel Andrew2.4K views
Solving Layout Problems with CSS Grid & Friends - NordicJS by Rachel Andrew
Solving Layout Problems with CSS Grid & Friends - NordicJSSolving Layout Problems with CSS Grid & Friends - NordicJS
Solving Layout Problems with CSS Grid & Friends - NordicJS
Rachel Andrew2.7K views
Google Developers Experts Summit 2017 - CSS Layout by Rachel Andrew
Google Developers Experts Summit 2017 - CSS Layout Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout
Rachel Andrew1.4K views
Web Summer Camp Keynote by Rachel Andrew
Web Summer Camp KeynoteWeb Summer Camp Keynote
Web Summer Camp Keynote
Rachel Andrew1.9K views
New CSS Layout Meets the Real World by Rachel Andrew
New CSS Layout Meets the Real WorldNew CSS Layout Meets the Real World
New CSS Layout Meets the Real World
Rachel Andrew864 views
An Event Apart DC - New CSS Layout meets the Real World by Rachel Andrew
An Event Apart DC - New CSS Layout meets the Real WorldAn Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real World
Rachel Andrew408 views
Perch, Patterns and Old Browsers by Rachel Andrew
Perch, Patterns and Old BrowsersPerch, Patterns and Old Browsers
Perch, Patterns and Old Browsers
Rachel Andrew1.8K views
Evergreen websites for Evergreen browsers by Rachel Andrew
Evergreen websites for Evergreen browsersEvergreen websites for Evergreen browsers
Evergreen websites for Evergreen browsers
Rachel Andrew1.5K views

Recently uploaded

Transcript: The Details of Description Techniques tips and tangents on altern... by
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...BookNet Canada
136 views15 slides
Voice Logger - Telephony Integration Solution at Aegis by
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at AegisNirmal Sharma
39 views1 slide
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
263 views86 slides
virtual reality.pptx by
virtual reality.pptxvirtual reality.pptx
virtual reality.pptxG036GaikwadSnehal
11 views15 slides
SAP Automation Using Bar Code and FIORI.pdf by
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdfVirendra Rai, PMP
23 views38 slides
Attacking IoT Devices from a Web Perspective - Linux Day by
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day Simone Onofri
16 views68 slides

Recently uploaded(20)

Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada136 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software263 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
Attacking IoT Devices from a Web Perspective - Linux Day by Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri16 views
Serverless computing with Google Cloud (2023-24) by wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker37 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman33 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 views
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta26 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely21 views

Configuration Management with Puppet

  • 1. Configuration Management with Puppet Rachel Andrew, Future Insights Live! 2015 Photo credit: https://www.flickr.com/photos/andreakirkby/5450450019
  • 2. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Rachel Andrew http://rachelandrew.co.uk @rachelandrew http://grabaperch.com
  • 3. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Many issues coming into support stem from poor development and deployment processes.
  • 4. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers The Big Problems • Developing directly on live sites or in subfolders of live sites • Developing in subfolders locally • Setting up local development environments that are so different to the eventual live server that there is no confidence when going live • Working in teams where everyone has a slightly different setup
  • 5. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Improving workflow is the best way to give yourself more hours in the day.
  • 6. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Today we’re going to take a look at • A really simple way to get started with Vagrant and Puppet for those of you who haven’t used these tools before. • Vagrant and Puppet fundamentals, how to start writing your own manifests. • How you can take this knowledge into production, even if you manage just one or two servers.
  • 7. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers First Steps
  • 8. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers We need … • to develop multiple websites on our own computer. • to know that our live server and local server support the same things. • to deploy our site and have confidence that what is on the live server is identical to our local version. • to have everyone who works on a site using the same development environment so we aren’t creating problems for each other.
  • 9. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Q. How do you develop sites locally that require a web server? A. MAMP, WAMP, XAMPP or similar 63%
  • 10. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers In an ideal world your local development environment is identical to the live server.
  • 11. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers http://php.net/manual/en/function.strftime.php
  • 12. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers PHP Versions can be different. PHP modules may not be available on the live server.
  • 13. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Virtual Machines
  • 14. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers virtualbox.org
  • 15. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers vagrantup.com
  • 16. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers https://puphpet.com
  • 17. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 18. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers http://rachelandrew.co.uk/presentations/deploy/puphpet
  • 19. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Upload a PHP file with this function to find out what is available on your live server. <?php phpinfo();?>
  • 20. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Things to check on your live server • PHP Version • Installed modules such as gd for image processing • post_max_size and upload_max_filesize determine the size of files that can be uploaded • max_input_vars is the number of form fields allowed in a post
  • 21. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Shared Folders
  • 22. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 23. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 24. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 25. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 26. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Basic commands for Vagrant. // start the VM > vagrant up // shut down the VM > vagrant halt //destroy the VM > vagrant destroy //ssh access > vagrant ssh
  • 27. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers http://vagrantmanager.com/
  • 28. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Share your package with anyone else working on the site. The whole team can then have the exact same development setup.
  • 29. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Using PuPHPet should get you up and running in a few hours. This will pay dividends in time saved in the long run.
  • 30. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Getting Under the Hood
  • 31. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers https://github.com/PerchCMS/perch-vagrant
  • 32. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 33. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers In the Vagrantfile we tell Vagrant we will be provisioning with Puppet. # Enable the Puppet provisioner, point it to our files config.vm.provision :puppet do |puppet| puppet.manifests_path = "puppet/manifests" puppet.manifest_file = "site.pp" puppet.module_path = "puppet/modules" puppet.hiera_config_path = "puppet/hiera.yaml" end
  • 34. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers What is Puppet? • A Configuration Management solution • Allows you to define in code the state of a server including • Packages that should be installed • Services that should be running • Files and folders • Permissions • Cron jobs
  • 35. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers You could set up a VM and then install everything by hand using the package manager for your distribution. > sudo apt-get install apache2 > sudo apt-get install mysql-server > sudo apt-get install php5 php5-mysql
  • 36. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 37. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Puppet Terminology • Manifest: a file that contains Puppet code • Resource: a thing that needs configuring, Apache is a resource, and so is a virtual-host. Resources have types - for example file, package, cron. • Module: a collection of manifests, templates and other files organised around a particular purpose.
  • 38. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Inside the Apache module is a manifests folder. This contains the manifests: - init.pp - vhost.pp puppet modules apache manifests - init.pp - vhost.pp templates - vhost-default-conf.erb
  • 39. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers All modules need an init.pp manifest. It is used when the module is included. In the apache init.pp - install the apache package - make sure apache is running - install the rewrite module class apache { package { "apache2": ensure => present, } service { "apache2": ensure => running, require => Package["apache2"], } file { "/etc/apache2/mods-enabled/rewrite.load": ensure => link, target => "/etc/apache2/mods-available/rewrite.load", require => Package["apache2"] } }
  • 40. http://garylarizza.com/blog/2014/10/19/on-dependencies-and-order/ On dependencies and order - why Puppet doesn’t care about execution order (until it does). @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 41. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers The manifest file vhost.pp sets up a VirtualHost by creating a file in sites- available and symlinking it into sites-enabled. We notify the apache2 service, which will then reload to pick up the new config. define apache::vhost( $vhost_docroot = false, $vhost_name = false, $vhost_options =['Indexes','FollowSymLinks','MultiViews'], ) { file {"/etc/apache2/sites-available/${vhost_name}": content => template("apache/vhost-default.conf.erb"), owner => 'root', group => 'root', mode => '755', require => Package['apache2'], notify => Service['apache2']; "/etc/apache2/sites-enabled/${vhost_name}": ensure => link, target => "/etc/apache2/sites-available/${vhost_name}", notify => Service['apache2']; } }
  • 42. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers The template file for a VirtualHost includes variables which will be replaced out by the details for each host. # ************************************ # Default template for vhosts # Managed by Puppet # ************************************ <VirtualHost *:80> ServerName <%= @vhost_name %> DocumentRoot <%= @vhost_docroot %> <Directory <%= @vhost_docroot %>> Options <%= @vhost_options %> AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/<%= @vhost_name %>_error.log LogLevel warn CustomLog /var/log/apache2/<%= @vhost_name %>_access.log combined ServerSignature Off </VirtualHost>
  • 43. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers In the Vagrantfile we tell Vagrant we will be provisioning with Puppet. # Enable the Puppet provisioner, point it to our files config.vm.provision :puppet do |puppet| puppet.manifests_path = "puppet/manifests" puppet.manifest_file = "site.pp" puppet.module_path = "puppet/modules" puppet.hiera_config_path = "puppet/hiera.yaml" end
  • 44. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers The site.pp file is special and kicks off the whole process. In my case it includes the modules we want to run. stage { 'setup': before => Stage['main'] } class { 'base': stage => 'setup' } include base, apache, mysql, php, bootstrap
  • 45. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers In the Vagrantfile we tell Vagrant we will be provisioning with Puppet. # Enable the Puppet provisioner, point it to our files config.vm.provision :puppet do |puppet| puppet.manifests_path = "puppet/manifests" puppet.manifest_file = "site.pp" puppet.module_path = "puppet/modules" puppet.hiera_config_path = "puppet/hiera.yaml" end
  • 46. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers The Hiera config file defines a YAML backend and gives the location of the configuration data. In my project that is in the manifest directory, in a folder named hiera. --- :backends: yaml :yaml: :datadir: "%{settings::manifestdir}/ hiera" :hierarchy: - "%{::clientcert}" - "%{::environment}" - config :logger: console
  • 47. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 48. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers In my YAML file I have added a setting for mysql_root_password. File: 
 manifests/hiera/config.yaml mysql_root_password: 'vagrant'
  • 49. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers I set the parameter $root_pw with the value using a hiera() function. I can then use $root_pw within the manifests. File: 
 modules/mysql/manifests/ init.pp class mysql( $root_pw = hiera('mysql_root_password'), ) { package { "mysql-server": ensure => present, } service { "mysql": enable => true, ensure => running, require => Package["mysql-server"], } exec { "set-mysql-password": unless => "/usr/bin/mysqladmin -uroot -p$root_pw status", command => "/usr/bin/mysqladmin -uroot password $root_pw", require => Service["mysql"], } }
  • 50. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers In my YAML file I have a list of PHP Modules. File: 
 manifests/hiera/config.yaml php_modules: - "php5" - "php5-cli" - "php5-mysql" - "php5-gd" - "php5-imagick" - "php5-curl" - "libapache2-mod-php5"
  • 51. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers I get the php_modules with the hiera function and then pass the list to the package resource type. File: 
 modules/php/manifests/ init.pp class php( $packages = hiera('php_modules'), $php_upload_max_filesize = hiera('php_upload_max_filesize'), $php_max_file_uploads = hiera('php_max_file_uploads'), $php_memory_limit = hiera('php_memory_limit'), $php_error_reporting = hiera('php_error_reporting'), $php_post_max_size = hiera('php_post_max_size'), ) { package { $packages: ensure => present, } file {'/etc/php5/apache2/php.ini': ensure => file, content => template("php/php.ini.erb"), notify => Service["apache2"], require => Package["php5"], } }
  • 52. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers The template file for a VirtualHost includes variables which will be replaced out by the details for each host. # ************************************ # Default template for vhosts # Managed by Puppet # ************************************ <VirtualHost *:80> ServerName <%= @vhost_name %> DocumentRoot <%= @vhost_docroot %> <Directory <%= @vhost_docroot %>> Options <%= @vhost_options %> AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/<%= @vhost_name %>_error.log LogLevel warn CustomLog /var/log/apache2/<%= @vhost_name %>_access.log combined ServerSignature Off </VirtualHost>
  • 53. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers In my YAML file I have configures two sites. apache_vhosts: site1: vhost_docroot: '/var/www/test_site1' vhost_name: 'site1.dev' vhost_options: 'All' site2: vhost_docroot: '/var/www/test_site2' vhost_name: 'site2.dev' vhost_options: 'All'
  • 54. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Use the hiera_hash function to get my site information and pass it to create_resources. The create_resources function then calls my host manifest with that hash as the data. class bootstrap { # Make sure everything is installed $sites = hiera_hash('apache_vhosts') create_resources('apache::vhost',$sites) $databases = hiera_hash('mysql_db') create_resources('mysql::db',$databases) }
  • 55. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers This is the manifest that creates the databases I need. define mysql::db( $db_name = false, $db_user = false, $db_password = false, $root_pw = hiera('mysql_root_password'), ) { exec { "create-${db_name}": unless => "/usr/bin/mysql -u${db_user} -p$ {db_password} ${db_name}", command => "/usr/bin/mysql -uroot -p$ {root_pw} -e "create database ${db_name}; grant all on ${db_name}.* to ${db_user}@localhost identified by '$db_password';"", require => Exec["set-mysql-password"], } }
  • 56. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers To set up a new VM • git clone • edit the Vagrantfile for IP address, project name • edit the config.yaml to create sites and databases • vagrant up
  • 57. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Your entire development environment can now be described in text files.
  • 58. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Share your environment with your team - they just edit the config.yaml.
  • 59. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Provisioning files and data
  • 60. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers https://github.com/PerchCMS/perch-vagrant
  • 61. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers
  • 62. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers The challenge • Take latest files and database dump from Github • Deploy the three sites with the current Perch version and add-ons • Run the upgrade and change any templates as needed • Produce the db dump with placeholders for Github and a Ruby db template with placeholders for the demo server • Produce zipped archives for use by the demo server
  • 63. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers https://forge.puppetlabs.com/puppetlabs/vcsrepo
  • 64. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Using the Puppetlabs vcsrepo module to clone a repository. vcsrepo { '/path/to/repo': ensure => present, provider => git, source => 'git://example.com/repo.git', }
  • 65. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers The YAML definition for one of our three demos. It includes the Git repo, local path, database details and Perch license key. I also detail the Perch Add-ons that need to be installed along with Perch Core. demo2: repo_uri: 'https://github.com/PerchCMS/ perchdemo-swift' vhost_path: '/var/www/perchdemos/demo-swift' db_name: 'db_demo_swift' db_user: 'vagrant' db_password: 'vagrant' key: ‘xxxx-xxxx-xxxx-xxxx‘ sql_path: '/sql/swift_demo.sql' install_addons: demo2_blog: addon_name: 'perch_blog' addon_type: 'apps' demo2_forms: addon_name: 'perch_forms' addon_type: 'apps' demo2_questions: addon_name: 'perch_questions' addon_type: 'apps'
  • 66. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers I deploy my databases and sites but also set off a build of the demos. class bootstrap { $databases = hiera_hash('mysql_db') create_resources(‘mysql::db',$databases) $demos = hiera_hash('demo_deploy') create_resources(‘perchdemo::deploy',$demos) $sites = hiera_hash('apache_vhosts') create_resources('apache::vhost',$sites) }
  • 67. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers In deploy.pp we get the files from git, each site has a database dump which I do some string replacement on - then import it. vcsrepo { "${vhost_path}": ensure => present, provider => git, source => $repo_uri, } exec { "replace-${db_name}": command => "/bin/sed -i 's/{firstname}/REPLACE_firstname/ g' ${vhost_path}${sql_path} ; /bin/sed -i 's/{lastname}/ REPLACE_lastname/g' ${vhost_path}${sql_path} ; /bin/sed -i 's/{email}/REPLACE_hello@grabaperch.com/g' ${vhost_path}$ {sql_path} ; /bin/sed -i 's/{username}/REPLACE_username/g' ${vhost_path}${sql_path} ; /bin/sed -i 's/{password}/ 5f4dcc3b5aa765d61d8327deb882cf99/g' ${vhost_path}$ {sql_path}", } exec { "import-${db_name}": command => "/usr/bin/mysql -uroot -p${root_pw} $ {db_name} < ${vhost_path}${sql_path}", }
  • 68. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Up to date Perch Core and add-ons are in a local file store. I use a Ruby .erb template for the Perch Config so I can add the database details and license key. I use create_resources to add the add-ons specified in the YAML for this site. file { "${vhost_path}/public_html/perch/core": ensure => present, source => "${file_store}/core", recurse => true, } file { "${vhost_path}/public_html/perch/config/ config.private.php": ensure => present, content => template('perchdemo/config.private.php.erb'), } create_resources('perchdemo::copy_addons',$install_addons, {'vhost_path'=>$vhost_path,'file_store'=>$file_store})
  • 69. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers At the command line you can run puppet apply to run a manifest. In this case I am running builder.pp which builds me an archive to upload for each site. > puppet apply --modulepath=/vagrant/ puppet/modules --hiera_config /vagrant/ puppet/hiera.yaml -e "include perchdemo::builder"
  • 70. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Taking Puppet to Production
  • 71. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Puppet Masters
  • 72. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Masterless Puppet
  • 73. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers You don’t have to provision the entire server using Puppet. Start with small tasks.
  • 74. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Use Puppet to create user accounts with the correct privileges and ssh keys on each server you set up.
  • 75. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Use an inexpensive VPS for client staging sites. Manage the VirtualHosts using Puppet.
  • 76. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers https://forge.puppetlabs.com/puppetlabs/apache
  • 77. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Schedule regular Puppet runs to check that services are running, and restart them if not
  • 78. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Puppet can ensure files and directories exist and they have the correct permissions set
  • 79. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Using Puppet can allow people to edit configs without needing privileges on production servers.
  • 80. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Configuration can be edited, checked into Git and reviewed before being deployed.
  • 81. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Modules you use on the server can often be also used in development. Ensuring the same environment.
  • 82. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Change one small thing.
  • 83. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Improve one thing about your workflow. Build from there.
  • 84. @rachelandrew | Read more at http://rachelandrew.co.uk/presentations/puppet-developers Thank you FILIVE! Rachel Andrew http://rachelandrew.co.uk/presentations/puppet-developers me@rachelandrew.co.uk @rachelandrew