This Choria Playbook will automate the steps to do a simple version upgrade on a nomad cluster.
- Upgrades servers first
 - Then upgrades clients
 - Sleeps in between each upgrade to allow things to settle
 - Aborts on any error
 
| { | |
| u'parameters': { | |
| u'ensure': u'present', | |
| u'path': u'/data/test', | |
| # Missing are job_name, server_name, backup_schedule | |
| }, | |
| u'title': u'test', | |
| u'tags': [u'node', u'backup', u'testnode.localdomain', u'class', u'backup::job', u'job'], | |
| u'exported': True, | |
| u'file': u'/home/puppet/production/modules/backup/manifests/init.pp', | 
| Storage { | |
| Name = <%= @hostname %>-sd | |
| SDPort = 9103 | |
| WorkingDirectory = <%= scope.lookupvar('bacula::real_working_dir') %> | |
| Pid Directory = "/var/run" | |
| } | |
| Director { | |
| Name = <%= scope.lookupvar('bacula::director_name') %> | |
| Password = "<%= scope.lookupvar('bacula::sd_password') %>" | 
| require 'spec_helper' | |
| require 'puppet/type/entropy_mask' | |
| require 'puppet/type/entropy_unmask' | |
| require 'puppet/type/entropy_splitdebug' | |
| require 'puppet/type/entropy_splitdebug_mask' | |
| types = { | |
| :entropy_mask => Puppet::Type::Entropy_mask, | |
| :entropy_unmask => Puppet::Type::Entropy_unmask, | |
| :entropy_splitdebug => Puppet::Type::Entropy_splitdebug, | 
| Puppet::Type.newtype(:entropy_mask) do | |
| @desc = "Mask packages in Entropy" | |
| ensurable | |
| newparam(:name) do | |
| desc "Unique name for this mask" | |
| end | |
| newproperty(:operator) do | 
| # == Class: site::letsencrypt | |
| # | |
| class site::letsencrypt ( | |
| $tsig_name, | |
| ) { | |
| if hiera('letsencrypt::letsencrypt_host') == $::fqdn { | |
| class { | |
| '::letsencrypt': | |
| hook_content => template('site/etc/dehydrated/dehydrated_nsupdate.sh.erb'), | |
| letsencrypt_contact_email => '[email protected]', | 
| #!/bin/sh | |
| # | |
| # A script which does everything bacula bpipe needs ie: | |
| # - create a snapshot with the current date / time | |
| # - do a zfs send out of that snapshot | |
| # - clean up snapshot when complete | |
| # | |
| FILESYSTEM=$1 | 
| metadata :name => "puppet_env", | |
| :description => "Triggers updates of puppetserver environments using puppet-env-manager library", | |
| :author => "Ben Roberts", | |
| :license => "Apache-2.0", | |
| :version => "0.1", | |
| :url => "https://github.com/optiz0r/puppet-env-manager-agent", | |
| :provider => "external", | |
| :timeout => 900 | |
| # == Class: sihnon::nomad | |
| # | |
| # Deploys nomad in docker | |
| # | |
| class sihnon::nomad ( | |
| String $image_name = 'optiz0r/nomad', | |
| String $image_tag = '0.11.0-beta2', | |
| String $root_dir = '/srv/nomad', | |
| String $cert_name = $::fqdn, | |
| Array[Stdlib::Host] $servers = [ | 
| _choria_bash_autocomplete() { | |
| local cur prev opts base | |
| COMPREPLY=() | |
| cur="${COMP_WORDS[COMP_CWORD]}" | |
| if ( _array_contains COMP_WORDS "req" || _array_contains COMP_WORDS "rpc" ) && [[ ${COMP_WORDS[$COMP_CWORD]} != "-"* ]] ; then | |
| _choria_req_bash_autocomplete | |
| else | |
| opts=$( ${COMP_WORDS[0]} --completion-bash ${COMP_WORDS[@]:1:$COMP_CWORD} ) | |
| COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) |