Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Types, speed and migration

Types, speed and migration

An introduction to Puppet 4 and how to upgrade given at Puppet Camp Amsterdam 2016.

Daniele Sluijters

February 05, 2016
Tweet

Other Decks in Technology

Transcript

  1. I am that guy ‣Daenney ‣Puppet for ~5 years ‣puppetlabs/apt

    ‣pypuppetdb & Puppetboard ‣“You broke the tests” ‣Vox Pupuli
  2. class a ( $maven_version = [] ) { notice($maven_version) }

    class { 'a': maven_version => '1.0.3', } Notice: Scope(Class[A]): 1.0.3
  3. class a ( Array $maven_version = [] ) { notice($maven_version)

    } class { 'a': maven_version => '1.0.3', } Error: Expected parameter 'maven_version' of 'Class[A]' to have type Array[Data], got String.
  4. class a { $var = {} case $var { Hash:

    { notice('a hash')} default: { notice('not a hash')} } } Notice: Scope(Class[A]): a hash
  5. case $magic_thingy { Undef: { $_magic_thingy = [] } Array:

    { $_magic_thingy = $_magic_thingy } Hash: { $_magic_thingy = [$_magic_thingy] } String: { $_magic_thingy = [$_magic_thingy] } default: { fail('magic_thingy can only be: String, Array, Hash or unset') } }
  6. $p_opts = { 'ensure' => 'latest', } package { 'fish':

    * => $p_opts, require => Apt::Source['fish'], }
  7. Pre-compile and compare catalogs Catalog Preview: http://is.gd/mod_catalog_preview Puppet Catalog differ:

    http://is.gd/catalog_diff Puppet Catalog diff viewer: http://is.gd/catalog_diff_viewer
  8. We did it in… 1 — 2 weeks of prep

    1 week of rollout 2 — 3 days of cleanup 0 production incidents