Skip to content

Instantly share code, notes, and snippets.

Nick Walker npwalker

Block or report user

Report or block npwalker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@npwalker
npwalker / implement_puppetdb_on_compile_masters.md
Last active Mar 15, 2019 — forked from tkishel/implement_puppetdb_on_compile_masters.md
Implement PuppetDB on Compile Masters (compatible with PE_XL)
View implement_puppetdb_on_compile_masters.md

Implement PuppetDB on Compile Masters

This procedure will implement a local PE PuppetDB on Compile Masters.

  1. Install and Configure the PE PuppetDB service on Compile Masters

Note: Replace all instances of MASTER.EXAMPLE.COM with the certname of your Primary Master.

Note: Replace all instances of DATABASE.EXAMPLE.COM with the certname of your PE Database host, by default, your Primary Master.

@npwalker
npwalker / slice_64cores.cfg
Last active Jul 11, 2017 — forked from mruzicka/slice_64cores.cfg
beaker host config file for a 64 CPU/GB SLICE environment
View slice_64cores.cfg
default_platform: &default_platform el-7-x86_64
default_image: &default_image centos_7_x86_64
default_user: &default_user centos
HOSTS:
mom:
roles:
- master
- database
- dashboard
@npwalker
npwalker / PDB_GC_Queries
Created Mar 1, 2016
PuppetDB GC Query Options For Bulk Deletion
View PDB_GC_Queries
-- report-ttl temp table implementation
SELECT id INTO TEMP TABLE report_ids_past_report_ttl
from reports r
where r.producer_timestamp < NOW() - INTERVAL '14 days';
ANALYZE report_ids_past_report_ttl;
DELETE from resource_events where report_id IN ( select id from report_ids_past_report_ttl );
UPDATE certnames SET latest_report_id = NULL where latest_report_id IN ( select id from report_ids_past_report_ttl );
DELETE FROM reports where id IN ( select id from report_ids_past_report_ttl );
DROP TABLE report_ids_past_report_ttl;
@npwalker
npwalker / gist:8741257
Last active Jan 26, 2018
How to regenerate a puppet agent certificate
View gist:8741257
  1. On the master: puppet cert clean <agent_certname>
  2. On the agent: mv /etc/puppetlabs/puppet/ssl/ /etc/puppetlabs/puppet/ssl_bak
  • Never do this if you are trying to regenerate the cert for the agent on the master. Instead you would need to delete specific certs
  1. On the agent: puppet agent -t
  2. On the master: puppet cert sign <agent_certname>
@npwalker
npwalker / puppet_cron
Last active Oct 7, 2016
A puppet manifest to disable the pe-puppet daemon and instead enable a cron job to run puppet with a random starting time. This will help avoid a thundering herd problem.
View puppet_cron
$runinterval = 30 #minutes
$first_run = fqdn_rand($runinterval)
$second_run = $first_run + $runinterval
cron { 'cron.puppet':
command => "/opt/puppetlabs/bin/puppet agent -t > /dev/null",
user => "root",
minute => [ $first_run, $second_run ],
}
You can’t perform that action at this time.