Skip to content

Instantly share code, notes, and snippets.

@ajroetker
ajroetker / pe_migrate.clj
Created July 7, 2015 02:37
Example PE migrations
(def pe-migrations
{35 {:pre bring-up-historical-resources-tables
:post add-key-constraints-for-those-tables}
36 {:pre tear-down-contraints-so-foss-can-upgrade-normally}
40 {:post reinstantiate-those-constraints})
q_all_in_one_install=y
q_enable_future_parser=y
q_upgrade_with_unknown_disk_space=y
q_puppet_symlinks_install=y
q_backup_and_purge_old_configuration=n
q_backup_and_purge_old_database_directory=n
q_database_host=monolithic.vm
q_database_install=y
q_database_port=5432
q_database_root_password=0DLykKg1Leqcrwl2cNTp
@ajroetker
ajroetker / bootstrap.sh
Last active August 29, 2015 14:18
PuppetDB smoke-testing bootstraping script
#! /usr/bin/env bash
cat <<PUPPETDBCONF > /etc/puppet/puppetdb.conf
[main]
server=$(facter fqdn)
port=8081
PUPPETDBCONF
cat <<ROUTESYAML > /etc/puppet/routes.yaml
---
@ajroetker
ajroetker / blah
Created January 29, 2015 19:15
resources
SELECT paged_results.* FROM (SELECT reports.certname, reports.configuration_version, reports.containment_path, reports.end_time, reports.environment, reports.event_status, reports.file, reports.hash, reports.line, reports.message, reports.new_value, reports.old_value, reports.property, reports.puppet_version, reports.receive_time, reports.report_format, reports.resource_title, reports.resource_type, reports.start_time, reports.status, reports.timestamp, reports.transaction_uuid FROM ( select reports.hash,
reports.certname,
reports.puppet_version,
reports.report_format,
reports.configuration_version,
reports.start_time,
reports.end_time,
reports.receive_time,
reports.transaction_uuid,
environments.name as environment,
@ajroetker
ajroetker / error
Created December 8, 2014 21:14
error
#<RuntimeError: PuppetAcceptance::DSL::Helpers.with_puppet_running_on failed (check backtrace for location) because: Host 'debian-7-amd64.vm' exited with 1 running:
env PATH="/usr/bin:/opt/puppet-git-repos/hiera/bin:${PATH}" RUBYLIB="/opt/puppet-git-repos/hiera/lib:/opt/puppet-git-repos/hiera-puppet/lib:${RUBYLIB}" puppet agent --test
Last 10 lines of output were:
Server hostname 'debian-7-amd64.vm' did not match server certificate; expected one of debian-7-amd64.hsd1.or.comcast.net, DNS:debian-7-amd64, DNS:debian-7-amd64.hsd1.or.comcast.net, DNS:puppet
Info: Retrieving plugin
Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'eval_generate': Server hostname 'debian-7-amd64.vm' did not match server certificate; expected one of debian-7-amd64.hsd1.or.comcast.net, DNS:debian-7-amd64, DNS:debian-7-amd64.hsd1.or.comcast.net, DNS:puppet
Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve file metadata for puppet://debian-7-amd64.vm/plugins: Server hostnam
@ajroetker
ajroetker / gist:ea494d8518a93fa31728
Created June 11, 2014 19:58
bounce_service from installer
# 1. Name of service .
bounce_service() {
prepare_platform
# If all three of these are true it is using upstart, so we need to grep the results of service rather than trusting the return code, which will probably just be 0 in all cases.
if ([ -h /etc/init.d/${1?} ] && [ $(readlink -f /etc/init.d/${1?}) = "/lib/init/upstart-job" ]) || [ -f /etc/init/${1?}.conf ]; then
if (service "${1?}" status | ${PLATFORM_EGREP?} -q "stop/waiting") > /dev/null 2>&1; then
run_suppress_output "service ${1?} start | ${PLATFORM_EGREP?} -q 'start/running'"
else
run_suppress_output "service ${1?} restart | ${PLATFORM_EGREP?} -q 'start/running'"
@ajroetker
ajroetker / .vimrc
Created September 24, 2013 16:48
This is my vim configuration!
"-----------------------------------------------------------------------
"Andrew's vimrc based on Hunner, BaSS & ciaran
"-----------------------------------------------------------------------
"-----------------------------------------------------------------------
" terminal setup
"-----------------------------------------------------------------------
" {{{1
" Add path for windows