Skip to content

Instantly share code, notes, and snippets.

@ajroetker
Last active May 25, 2016 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajroetker/1ea62ada6dd99309e36e8bb49e8404e2 to your computer and use it in GitHub Desktop.
Save ajroetker/1ea62ada6dd99309e36e8bb49e8404e2 to your computer and use it in GitHub Desktop.
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:
    • mkdir tmp in the PuppetDB repo as we gitignore everything under ./tmp
    • Create vardir for AMQ
    • Create config file with SSL and AMQ settings set for local setup (should get an example config with everything a dev might want)
    • Create PuppetDB database and user
    • createuser -DRSP puppetdb
    • createdb -E UTF8 -O puppetdb puppetdb && psql -c "create extension pg_trgm; create extension pg_stat_statements" -d puppetdb
    • Add database configs to the config file
    • lein run services --config <path to config>
    • When wanting to clean up after PuppetDB do a dropdb puppetdb and rm -rf <puppetdb_repo>/tmp/<mq_path>
  • To run some example commands against PuppetDB:
    • While PuppetDB is running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment