Last active
May 4, 2017 23:34
-
-
Save joeljacobs/b3be619b1f9068f6d4c52787456a7409 to your computer and use it in GitHub Desktop.
Puppet Zero Padding sprintf each split match
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#$pp_num_raw = split($::hostname, 'pp')[1] | |
#$pp_num = sprintf("%0#2i", $pp_num_raw) | |
#$pp_num = split($::hostname, 'pp')[1].sprintf"%0#2i" | |
#$pp_num = sprintf("%0#2i", "${::hostname}".split('pp')[1]) | |
$pp_num = sprintf("%0#2i", "${::hostname}".match(/(pp)([0-9]+)([^[0-9]]*)/)[2]) | |
["api", "live", "upload"].each|$local_suffix|{ | |
file { "/etc/nginx/conf.d/ppcc.local.$local_suffix": | |
content => template("pp_nginx_manager/conf.d/ppcc.local.${local_suffix}.erb"), | |
ensure => present, | |
} | |
} | |
[ "dbdocker1", "dbdocker2", "dbdocker3", "dbdocker4" ].each|$dbserver|{ | |
exec { "hup_haproxy_on_$dbserver": | |
command => "/usr/bin/ssh ${dbserver} \"/usr/bin/docker kill -s HUP haproxy\"", | |
} | |
} | |
Look at pp_gluster for current zfs stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment