2. AL VAGANTE
• Founder and CTO at example42 GmbH
• Puppet user / trainer since 2007
• Author of the book "Extending Puppet"
• Author of ## Puppet modules, Puppi,Tiny Puppet
• github.com/alvagante
3. AGENDA
• Evolution of configuration management tools
• Puppet 4 and the evolution of the language
4. CFGMGMTTOOLS EVOLVE
• System resources (packages, services, files, users... )
• Applications (app specific resources)
What did we manage yesterday?
5. CFGMGMTTODAY
• Network devices
• Storage
• Cloud resources
• Containers
• Systems and applications, still
Managing whole IT infrastructures
6. MANAGING NETWORKS
• Proxy mode via puppet device
(Puppet code executed on a remote node)
• Native client (Cisco, Huawei,Arista, Cumulus
networks)
(Puppet code executed on the network device)
Alternative management modes
9. MANAGING CLOUDS
• Public cloud resources management (AWS,Azure,
Google Cloud, Digital Ocean...)
• Private cloud infrastructure management
(VMWare, OpenStack)
Several cloud related modules
15. PUPPET 4 (R)EVOLUTION
• All In One packages
• Puppet Server , Puppet Agent , Facter 3
• NewType System
• Language improvements
• Deprecations
Better language, new foundations
16. ALL IN ONE PACKAGES
• Dedicated repositories (Software Collections)
• File paths changed (a lot!)
• Client: puppet-agent
Installs Puppet, Hiera, Mcollective and the full Ruby stack
• Server: puppetserver
Clojure application, running inside a JVM (JRuby for ruby code)
Full Stack packaging
17. FACTER EVOLUTIONS
• Structured facts (can be array, hashes, booleans...)
(Since Facter 2)
• Aggregated resolution
(Facts values can be resolved in multiple steps. Since Facter 2)
• CFacter (or native facter: way faster, written in C)
(Facter 3. Enabled by default from Puppet 4.2)
Facter reloaded
18. TYPE SYSTEM
• A new powerful type system
• Can be used for parameters evaluation
class myclass (
Integer[22-1024] $port,
Variant[Boolean,String] $ensure = present,
Hash $options_hash = { },
Boolean $test_enable = false,
Variant[Undef,String] $test_template = undef,
String[1] $debug_dir = '/tmp',
Everything has a type
19. ITERATIONS
• Iterations over resources are based on lambdas
• Dedicated functions: each, slice, filter, map, reduce
We can iterate inside our code, finally
# Iteration over arrays
$pkg = [ php,php-mysql,apa]
each($pkg) | $value | {
package { $value:
ensure => present,
}
}
# Iteration over hashes
$h = { '1' => ['a','b','c'], '2' => 'foo' }
each($h) | $key, $value | {
notice "$key = $value"
}
20. EPPTEMPLATES
• Alternative to Ruby Erb templates (still valid)
• Epp function accepts an hash of parameters
• Parameters have to be specified in the header (and can be
validated via theType system)
Templates using Puppet DSL
Declaration of parameters is part of the epp function and specified within a hash:
content = epp('<path to template>', {
'header' => 'Copyright example42',
'informations' => ['Puppet 4', 'EPP']
}),
Parameters need to be specified as a header:
<%- | String $header = '',
Array $informations = [] | -%>
<%= $header %>
List of informations:
<% $informations.each | String $info | { -%>
- <%= $info %>
<% } -%>
21. PUPPET DSL FUNCTIONS
• Ruby no more needed for Puppet functions
• Autoloaded from a module's function directory
cat tp/functions/is_empty.pp
function tp::is_empty (
Any $input,
) {
$output = $input ? {
false => true,
'' => true,
undef => true,
default => false,
}
}
Functions written in Puppet DSL
cat tp/functions/ensure2bool.pp
function tp::ensure2bool (
Variant[Boolean,String] $input =
present,
$default = undef,
) {
$output = $input ? {
'absent' => false,
false => false,
'present' => true,
true => true,
default => $default,
}
}
22. A LOT MORE...
• Directory environments
• Heredoc support
• New functions API (for ruby functions)
• A lot of code cleanups (and deprecations)
Other notable changes in Puppet 4
23. AND MORETO COME
• Puppet lookup function (Data in Modules)
• Puppet Communication / Execution protocol
• Application Orchestration
Experimental or more recent additions
24. DEPRECATIONS
• Goodbye nodes inheritance
• Empty strings evaluate are true in P4
• Goodbye classes and defines in ruby
• Variables can't start with capital letters or underscore
• Reference deprecations: Class ['Ssh'] must be Class['ssh']
• No more hyphens in classes, defines and modules names
• import statement
• Variables dynamic scoping in erb templates
Stuff no more supported or changed in Puppet 4
25. FUTURE DEPRECATIONS
• Webrick and rack Puppet Master (only Puppet Server)
• Support for Windows 2003
• Non-Strict variables (error when accessing undefined
variables)
• Automatic symlinks in file resources for ensure => /path
• APIs: Puppet.newtype (Use Puppet::Type.newtype instead)
• Puppet faces becomes a private API (custom faces in modules
won't be supported)
• Config settings: cfacter, configtimeout, ignorecache
What won't work in Puppet 5
26. – Louis D. Brandeis
“There are no shortcuts in evolution”