{"id":20728848,"url":"https://github.com/npwalker/puppetdb_compile_master_vagrant_stack","last_synced_at":"2026-04-28T03:06:15.460Z","repository":{"id":74281822,"uuid":"64511453","full_name":"npwalker/puppetdb_compile_master_vagrant_stack","owner":"npwalker","description":"A Vagrant Stack for testing putting puppetdb on compile masters","archived":false,"fork":false,"pushed_at":"2017-04-18T21:55:17.000Z","size":179,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T09:41:12.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npwalker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-29T21:28:07.000Z","updated_at":"2017-06-27T08:56:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"2827d36f-fac9-4843-87c3-f9831227851a","html_url":"https://github.com/npwalker/puppetdb_compile_master_vagrant_stack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/npwalker/puppetdb_compile_master_vagrant_stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npwalker%2Fpuppetdb_compile_master_vagrant_stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npwalker%2Fpuppetdb_compile_master_vagrant_stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npwalker%2Fpuppetdb_compile_master_vagrant_stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npwalker%2Fpuppetdb_compile_master_vagrant_stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npwalker","download_url":"https://codeload.github.com/npwalker/puppetdb_compile_master_vagrant_stack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npwalker%2Fpuppetdb_compile_master_vagrant_stack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32364107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T04:40:11.279Z","updated_at":"2026-04-28T03:06:15.453Z","avatar_url":"https://github.com/npwalker.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testing PuppetDB on compile masters\n\n## To Start the stack\n\n```\nvagrant destroy -f\nvagrant up\nvagrant ssh puppet-master-centos -c \"sudo puppet agent -t\"\n```\n\n## To Confirm you can run an agent against the compile master with PuppetDB\n\n```\nvagrant ssh compile-master-puppetdb -c \"sudo puppet agent -t --server compile-master-puppetdb --certname test\"\n\n```\n\nThe setup is handled by the vagrant stack but here are the details\n\n1.  Add `puppet_enterprise::profile::puppetdb' to your compile master\n2.  Configure puppetdb.conf on the compile master to connect to the local puppetdb\n  - This causes the compile masters to connect to the puppetdb_host that is local to it I suppose it also makes the MoM connect to it's puppetdb but it was already doing that.  \n  - You could provide a comma delimited list of $clientcert and the fqdn of your MoM if you wanted the master to fail over to the MoM when it can't connect to the local puppetdb\n    - I recommend that if the local puppetdb on the compile master stops working that you instead remove the compile master from your load balancer instead of failing over just puppetdb traffic.  \n\nThe setup used by the stack is somewhat fragile and likely to break in future versions of PE.  However, the basic idea that you can run puppetdb on a compile master is proved and it's not complicated.\n\n\n# Puppet Debugging Kit\n_The only good bug is a dead bug._\n\nThis project provides a batteries-included Vagrant environment for debugging Puppet powered infrastructures.\n\n# Tuning PuppetDB and Puppet Server Together\n\n## Disable gc-interval on PuppetDB\n\nOnly one PuppetDB should ever perform GC on the database so each compile master should disable [gc-interval](https://docs.puppet.com/puppetdb/latest/configure.html#gc-interval).\n\n## CPUs = puppet server jrubies + puppetdb command processing threads + 1\n\nIn order to prevent a situation in which a thundering herd of traffic would cause puppet server and puppetdb to compete for resources you want to make sure jrubies + command processing threads \u003c # CPUs.\n\nI recommend setting PuppetDB command processing threads to 1 to start with and see if that allows for adequate throughput.  You can monitor the QueueSize in PuppetDB with the [pe_metric_curl_cron_jobs](https://github.com/npwalker/pe_metric_curl_cron_jobs) to make sure you're not seeing a backup of commands.  If you do see a backup then add a command processing thread and reduce by one jruby.\n\n## Set max_connections in PostgreSQL to 1000\n\nEach PuppetDB uses 50 connections to PostgreSQL by default.  So, you need to increase max_connections to allow for all of those connections.\n\nIf you are adding more than 4 puppetdb nodes then you might want to consider tuning down the connection pools to reduce the connection overhead on the postgresql side.  There are parameters for read and write connection pool sizes in the puppet_enterprise module.\n\nMy understanding is that you need a read connection for each jruby instance and you need roughly 2x command processing threads for write connections.  This assumes the console will use the PuppetDB instance on the MoM for it's read queries.\n\n## Setup\n\nGetting the debugging kit ready for use consists of three steps:\n\n  - Ensure the proper Vagrant plugins are installed.\n\n  - Create VM definitions in `config/vms.yaml`.\n\n  - Clone Puppet Open Source projects to `src/puppetlabs` (optional).\n\nRake tasks and templates are provided to help with all three steps.\n\n### Install Vagrant Plugins\n\nTwo methods are avaible depending on whether a global Vagrant installation, such as provided by the official packages from [vagrantup.com](http://vagrantup.com), is in use:\n\n  - `rake setup:global`:\n    This Rake task will add all plugins required by the debugging kit to a global Vagrant installation.\n\n  - `rake setup:sandboxed`:\n    This Rake task will use Bundler to create a completely sandboxed Vagrant installation that includes the plugins required by the debugging kit.\n    The contents of the sandbox can be customized by creating a `Gemfile.local` that specifies additional gems and Bundler environment parameters.\n\n### Create VM Definitions\n\nDebugging Kit virtual machine definitions are stored in the file `config/vms.yaml` and an example is provided as `config/vms.yaml.example`.\nThe example can simply be copied to `config/vms.yaml` but it contains a large number of VM definitions which adds some notable lag to Vagrant start-up times.\nStart-up lag can be remedied by pruning unwanted definitions after copying the example file.\n\n### Clone Puppet Open Source Projects\n\nThe `poss-envpuppet` role is designed to run Puppet in guest machines directly from Git clones located on the host machine at `src/puppetlabs/`.\nThis role is useful for inspecting and debugging changes in behavior between versions without re-installing packages.\nThe required Git clones can be created by running the following Rake task:\n\n    rake setup:poss\n\n\n## Usage\n\nUse of the debugging kit consists of:\n\n  - Creating a new VM definition in `config/vms.yaml`.\n    The `box` component determines which Vagrant basebox will be used.\n    The default baseboxes can be found in [`data/puppet_debugging_kit/boxes.yaml`](https://github.com/puppetlabs/puppet-debugging-kit/blob/internal/data/puppet_debugging_kit/boxes.yaml).\n\n  - Assigning a list of \"roles\" that customize the VM behavior.\n    The role list can be viewed as a stack in which the last entry is applied first.\n    Most VMs start with the `base` role which auto-assigns an IP address and sets up network connectivity.\n    The default roles can be found in [`data/puppet_debugging_kit/roles.yaml`](https://github.com/puppetlabs/puppet-debugging-kit/blob/internal/data/puppet_debugging_kit/roles.yaml) and are explained in more detail below.\n\n\n### PE Specific Roles\n\nThere are three roles that assist with creating PE machines:\n\n  - `pe-forward-console`:\n    This role sets up a port forward for console accesss from 443 on the guest VM to 4443 on the host machine.\n    If some other running VM is already forwarding to 4443 on the host, Vagrant will choose a random port number that will be displayed in the log output when the VM starts up.\n\n  - `pe-\u003cversion\u003e-master`:\n    This role performs an all-in-one master installation of PE `\u003cversion\u003e` on the guest VM.\n    When specifying the version number, remove any separators such that `3.2.1` becomes `321`.\n    The PE console is configured with username `admin@puppetlabs.com` and password `puppetlabs`.\n\n  - `pe-\u003cversion\u003e-agent`:\n    This role performs an agent installation of PE `\u003cversion\u003e` on the guest VM.\n    The agent is configured to contact a master running at `pe-\u003cversion\u003e-master.puppetdebug.vlan` --- so ensure a VM with that hostname is configured and running before bringing up any agents.\n\n\n### POSS Specific Roles\n\nThere are a few roles that assist with creating VMs that run Puppet Open Source Software (POSS).\n\n  - `poss-apt-repos`:\n    This role configures access to the official repositories at apt.puppetlabs.com for Debian and Ubuntu VMs.\n\n  - `poss-yum-repos`:\n    This role configures access to the official repositories at yum.puppetlabs.com for CentOS and Fedora VMs.\n\n\n## Extending and Contributing\n\nThe debugging kit can be thought of as a library of configuration and data for [Oscar](https://github.com/adrienthebo/oscar).\nData is loaded from two sets of YAML files:\n\n```\nconfig\n└── *.yaml         # \u003c-- User-specific customizations\ndata\n└── puppet_debugging_kit\n    └── *.yaml     # \u003c-- The debugging kit library\n```\n\nEverything under `data/puppet_debugging_kit` is loaded first.\nIn order to avoid merge conflicts when the library is updated, these files should never be edited unless you plan to submit your changes as a pull request.\n\nThe contents of `config/*.yaml` are loaded next and can be used to extend or override anything provided by `data/puppet_debugging_kit`.\nThese files are not tracked by Git and are where user-specific customizations should go.\n\n---\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"http://i.imgur.com/TFTT0Jh.png\" /\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpwalker%2Fpuppetdb_compile_master_vagrant_stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpwalker%2Fpuppetdb_compile_master_vagrant_stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpwalker%2Fpuppetdb_compile_master_vagrant_stack/lists"}