Skip to content

Instantly share code, notes, and snippets.

@mrzarquon
mrzarquon / No provider needed
Created May 3, 2019 02:48
puppet hash to yaml file
$config_hash = {
'hosts' => $hosts.sort(),
'metrics_type' => $metrics_type,
'metrics_port' => $metrics_port,
'additional_metrics' => $additional_metrics,
'clientcert' => $::clientcert,
'pe_version' => $facts['pe_server_version'],
'ssl' => $ssl,
}
get the puppet ca
curl -k https://puppetserver:8140/puppet-ca/v1/certificate/ca

Keybase proof

I hereby claim:

  • I am mrzarquon on github.
  • I am mrzarquon (https://keybase.io/mrzarquon) on keybase.
  • I have a public key whose fingerprint is 96A4 CE6F 1697 213B 1E32 1556 2E3F 88DD 8BA8 D892

To claim this, I am signing this object:

#!/bin/bash
# lazily modified from here: http://unix.stackexchange.com/questions/204069/all-possible-combinations-of-characters-and-numbers
for c1 in {A..Z} {a..z} {0..9}
do
for c2 in {A..Z} {a..z} {0..9}
do
for c3 in {A..Z} {a..z} {0..9}
do
for c4 in {A..Z} {a..z} {0..9}

Keybase proof

I hereby claim:

  • I am mrzarquon on github.
  • I am mrzarquon (https://keybase.io/mrzarquon) on keybase.
  • I have a public key whose fingerprint is 7761 9BB7 53DF E567 66DF 11AE 9AD2 FACB 10C3 8462

To claim this, I am signing this object:

@mrzarquon
mrzarquon / gist:be2860937d729c2c74de
Created December 16, 2014 19:24
Make a service restart more graceful
class classroom::master::wait_for_startup {
Service <| title == 'pe-puppetserver' |> {
hasrestart => true,
restart => "service pe-puppetserver restart && while true; do puppet status ${clientcert} --terminus rest && break; sleep 5; done"
}
Service <| title == 'pe-console-services' |> {
hasrestart => true,
restart => "service pe-console-services restart && while true; do curl http://localhost:4432/classifier-api/v1/last-class-update && break; sleep 5; done",
}
@mrzarquon
mrzarquon / gist:0d2e198f26960c4ffb14
Created November 2, 2014 17:44
show_classification.sh "PE Master" - to see the full json rule / configuration for the "PE Master" classification group in the console
#!/bin/bash
# simple 3.7 NC classifier commands
declare -x PE_CERT=$(/opt/puppet/bin/puppet agent --configprint hostcert)
declare -x PE_KEY=$(/opt/puppet/bin/puppet agent --configprint hostprivkey)
declare -x PE_CA=$(/opt/puppet/bin/puppet agent --configprint localcacert)
declare -x NC_CURL_OPT="-s --cacert $PE_CA --cert $PE_CERT --key $PE_KEY --insecure"
@mrzarquon
mrzarquon / gist:7330341
Created November 6, 2013 03:19
Simple Site.pp
## site.pp ##
## Active Configurations ##
# PRIMARY FILEBUCKET
# This configures puppet agent and puppet inspect to back up file contents when
# they run. The Puppet Enterprise console needs this to display file contents
# and differences.
# Define filebucket 'main':
@mrzarquon
mrzarquon / gist:6020701
Created July 17, 2013 13:48
puppet is nice.
#!/bin/bash
agent_certname=$1
/opt/puppet/bin/puppet resource ini_setting certname \
path="/etc/puppetlabs/puppet/puppet.conf" \
section="main" \
setting="certname" \
value="${agent_certname}" \
ensure="present"
@mrzarquon
mrzarquon / top 10
Created July 12, 2013 21:09
Sorted_list
['rtyler/puppet', 9]
['wcooley/fail_unconfigured', 18]
['bobsh/puppetdb', 30]
['cloudsmith/demoapp', 51]
['gioppoluca/wso2am', 55]
['gioppoluca/wso2bam', 59]
['ngiger/elexis_cockpit', 60]
['gioppoluca/moodle', 60]
['reidmv/mcollective', 61]
['viirya/storm', 61]