Skip to content

Instantly share code, notes, and snippets.

@ajroetker
ajroetker / ur.clj
Created July 17, 2015 18:55
unchanged resources test-data loader
(ns ur
(:require [puppetlabs.puppetdb.examples.reports :as example-reports]
[puppetlabs.kitchensink.core :as kitchensink]
[puppetlabs.puppetdb.scf.storage-utils :as scf-utils]
[clojure.java.jdbc :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
ajroetker / foo.clj
Created September 28, 2015 20:56
update the wire-format of example reports
(ns foo
(:require [clojure.java.io :as io]
[puppetlabs.puppetdb.reports :as reports]
[puppetlabs.puppetdb.cheshire :as json]))
(defn update-file-contents [file]
[(.getName file)
(json/generate-string
(reports/wire-v5->wire-v6
(json/parse-string
@ajroetker
ajroetker / puppetdb_101.md
Last active May 25, 2016 20:55
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
ajroetker / mine.txt
Created April 4, 2017 17:00
lock file for gems
*[2016.4.x][~/Projects/code-manager/test]$ bundle update rvm:ruby-2.3.0
Fetching source index from http://rubygems.delivery.puppetlabs.net/
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
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 : {
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
ajroetker / pubsub_example.go
Created August 21, 2018 19:32
Reproducing the pubsub code
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,