Skip to content

Instantly share code, notes, and snippets.

AJ Roetker ajroetker

Block or report user

Report or block ajroetker

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
ajroetker / pubsub_example.go
Created Aug 21, 2018
Reproducing the pubsub code
View pubsub_example.go
// Copyright 2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
View code-manager.conf
code-manager : {
file-sync : {
repo-id : "puppet-code"
environmentdir : "/etc/puppetlabs/code-staging/environments"
datadir : "/opt/puppetlabs/server/data/code-manager/"
cachedir : "/opt/puppetlabs/server/data/code-manager/cache"
authenticate-webhook : true
deploy-pool-size : 2
timeouts : {
View code-manager.conf
code-manager : {
file-sync : {
repo-id : "puppet-code"
environmentdir : "/etc/puppetlabs/code-staging/environments"
datadir : "/opt/puppetlabs/server/data/code-manager/"
cachedir : "/opt/puppetlabs/server/data/code-manager/cache"
authenticate-webhook : true
deploy-pool-size : 2
timeouts : {
ajroetker / mine.txt
Created Apr 4, 2017
lock file for gems
View mine.txt
*[2016.4.x][~/Projects/code-manager/test]$ bundle update rvm:ruby-2.3.0
Fetching source index from
Resolving dependencies...
Using rake 12.0.0
Using CFPropertyList 2.3.5
Using addressable 2.4.0
Using json 1.8.6
Using mini_portile2 2.1.0
Using hocon 1.2.4
Using require_all 1.3.3
ajroetker /
Last active May 25, 2016
How to run and test PuppetDB as a dev

PuppetDB 101

  • Install Java 8
  • Install Brew
    • Install PostgreSQL
    • Install leiningen
  • To run tests:
    • Create test databases and users (follow doc in PuppetDB repo, grep for pdb_test_admin)
    • lein test
  • To run PuppetDB:
ajroetker / foo.clj
Created Sep 28, 2015
update the wire-format of example reports
View foo.clj
(ns foo
(:require [ :as io]
[puppetlabs.puppetdb.reports :as reports]
[puppetlabs.puppetdb.cheshire :as json]))
(defn update-file-contents [file]
[(.getName file)
ajroetker / ur.clj
Created Jul 17, 2015
unchanged resources test-data loader
View ur.clj
(ns ur
(:require [puppetlabs.puppetdb.examples.reports :as example-reports]
[puppetlabs.kitchensink.core :as kitchensink]
[ :as scf-utils]
[ :as jdbc]
[puppetlabs.puppetdb.cheshire :as json]))
(def skeleton-unchanged-resource
{:title "/etc/sysconfig/iptables"
:file "/etc/puppetlabs/code/environments/production/modules/firewall/manifests/linux/redhat.pp"
ajroetker / state_overview_single_query.sql
Last active Aug 29, 2015 — forked from wkalt/gist:856c87c322f1ef75d43c
single query for state-overview example from Wyatt, touched up a little
View state_overview_single_query.sql
SELECT (CASE WHEN certnames.latest_report_id IS NULL THEN 'unreported'
/* NOW() would instead be a parameterized value */
WHEN reports.end_time < NOW() - interval '1 hour' THEN 'unresponsive'
WHEN reports.noop = TRUE THEN 'noop'
ELSE resport_statuses.status
END) AS latest_report_status,
FROM certnames
LEFT JOIN reports ON certnames.latest_report_id =
LEFT JOIN report_statuses ON reports.status_id =;
View merge-conflict.rb
<<<<<<< HEAD
def get_package_version(host, version = nil)
version = PuppetDBExtensions.config[:package_build_version].to_s
# version can look like:
# 3.0.0
# 3.0.0.SNAPSHOT.2015.07.08T0945
# Rewrite version if its a SNAPSHOT in rc form
if version.include?("SNAPSHOT")
View gist:bd18a07d468cabfa67a3
usermod: user puppetdb is currently used by process 15306
Updating : puppetdb-3.0.0-0.1SNAPSHOT.2015.07.09T1006.el7.noarch 1/2
Migrating configuration files /tmp/puppetdb-orig-configs/jetty.ini /tmp/puppetdb-orig-configs/database.ini /tmp/puppetdb-orig-configs/config.ini to /etc/puppetlabs/puppetdb/conf.d
Replacing: /etc/puppetlabs/puppetdb/conf.d/jetty.ini with /tmp/puppetdb-orig-configs/jetty.ini
Replacing: /etc/puppetlabs/puppetdb/conf.d/database.ini with /tmp/puppetdb-orig-configs/database.ini
Replacing: /etc/puppetlabs/puppetdb/conf.d/config.ini with /tmp/puppetdb-orig-configs/config.ini
Checking to see if we need to update default settings
Backing up /etc/puppetlabs/puppetdb/conf.d/config.ini to /etc/puppetlabs/puppetdb/conf.d/config.ini.bak.1436463075 before making changes
Updated setting vardir in /etc/puppetlabs/puppetdb/conf.d/config.ini.
Replacing: /opt/puppetlabs/server/data/puppetdb with /var/lib/puppetdb
You can’t perform that action at this time.