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

PuppetConf 2014 - Managing the File and Exposin...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

PuppetConf 2014 - Managing the File and Exposing the API

This talk was given at PuppetConf 2014. It is a discussion about APIs in code and the config files we manage.

Avatar for Christopher Webber

Christopher Webber

September 24, 2014

More Decks by Christopher Webber

Other Decks in Technology

Transcript

  1. It is just as much about what you exclude as

    what you include https://flic.kr/p/9jkkW5
  2. Days of Old source => ‘<modulename>/file.conf’ " or worse
 source

    => [
 ‘<modulename>/file.conf.$hostname’,
 ‘<modulename>/file.conf.$operatingsystem',
 ‘<modulename>/file.conf’
 ]
  3. Start with just a few config options class {‘::redis’:
 version

    => ‘2.7’,
 maxmemory => ‘12gb’, maxclients => 1000,
 }
  4. Well crap class redis {
 $version = ‘2.7’,
 $maxmemory =

    ‘12gb’, $maxclients = 1000, $daemonize = ‘yes’, $port = 6379, $tcp_backlog = 511, $bind = ‘127.0.0.1’, $timeout = 0, $syslog_enabled = undef, $repl_timeout = undef, …

  5. Enter the array of hashes class {‘::redis::slave’: version => ‘2.7’,

    master => ’10.0.10.100’, misc_config => { ‘zset-max-ziplist-entries’ => 128, ‘zset-max-ziplist-value’ => 64 } }
  6. <% if @master -%> slaveof <%= @master %> 6379 <%

    end -%> <% if @misc_config -%> <% @misc_config.each_key do |config| -%> <%= config %> <%= @misc_config[config] %> <% end -%> <% end -%>
  7. class {‘apache’: } " file {‘/etc/httpd/conf.d/an_site.conf’: ensure => present, content

    => template(‘myapp/an_site.conf.erb’), notify => Service[‘apache’] }