mco puppet runonce --batch 5 --batch-sleep 30 --nodes ./nodelist.txt
This file contains hidden or 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
call plug#begin() | |
Plug 'elzr/vim-json' " For metadata.json | |
Plug 'mrk21/yaml-vim' " For hieradata | |
"Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}} " Language Server support | |
Plug 'rodjek/vim-puppet' " For Puppet syntax highlighting | |
Plug 'vim-ruby/vim-ruby' " For Facts, Ruby functions, and custom providers | |
Plug 'vimwiki/vimwiki' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'ryanoasis/vim-devicons' |
This file contains hidden or 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
plan profile::auto_patch_run ( | |
String $patch_group, | |
Boolean $security_only = false, | |
Enum['always', 'never', 'patched', 'smart'] $reboot = 'patched', | |
){ | |
# Query PuppetDB to find nodes that have the patch group, | |
# are not blocked and have patches to apply | |
$all_nodes = puppetdb_query("inventory[certname] { facts.pe_patch.patch_group = '${patch_group}'}") | |
$filtered_nodes = puppetdb_query("inventory[certname] { facts.pe_patch.patch_group = '${patch_group}' and facts.pe_patch.blocked = false and facts.pe_patch.package_update_count > 0}") |
This file contains hidden or 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
require "json" | |
Facter.add('vra') do | |
setcode do | |
data = {} | |
if Facter.value(:kernel) == 'windows' | |
json_file = 'C:\ProgramData\PuppetLabs\facter\facts.d\puppet_vra_facts.json' | |
else |
This file contains hidden or 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
This is a gist |
This file contains hidden or 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
--- | |
profile::soe::monitoring::nagios::rules: | |
nagios_command: | |
process-service-perfdata: | |
ensure: present | |
command_line: '/usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /var/log/nagios/service-perfdata.out' | |
target: '/etc/nagios/objects/nagios_command.cfg' | |
profile::soe::monitoring::nagios::plugins: | |
- nagios-plugins-pgsql | |
- nagios-plugins-check-updates |
I hereby claim:
- I am albatrossflavour on github.
- I am greeno (https://keybase.io/greeno) on keybase.
- I have a public key whose fingerprint is 662B 5F77 3441 7754 E9AB 0F35 2033 7997 7D27 189A
To claim this, I am signing this object:
This file contains hidden or 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
#!/bin/sh | |
human_readable() | |
{ | |
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } ' | |
} | |
human_readable $1 |