From Wikitech
Jump to navigation Jump to search

You can run puppet-compiler by hand to get the results of a given puppet configuration without having to deploy it to servers.

This page gives some instructions on doing so.

Catalog compiler in integration Jenkins

There is a jenkins job that takes a gerrit change and runs the compiler.


  1. Push your change to gerrit using git-review
  2. Go to
  3. Go to "Build with parameters"
  4. In the form, fill change number (from gerrit) and list of nodes
  5. Hit the Build button
  6. Wait for the jenkins job to end
  7. You can check for results in the jenkins Console output
  8. You can see the compiled catalogs in a web frontend. The URL structure is where...
    • compiler_host is the hostname (without domain name) of the compiler node that Jenkins dispatched the build to. A current list of possible compiler nodes is available at
    • build_id is the unique id of the Jenkins build (changes with every run).
    • This link is automatically constructed and can be found at the bottom of the Jenkins console output after each build.

NOTE: this method won't work for CloudVPS instances (see next method below).

Catalog compiler for CloudVPS

This is a way to get a catalog compiler working for CloudVPS instanes. You can do a local run of the integration jenkins job. This is usually done in an instance VM on CloudVPS.

Steps are:

  • Push your patch to gerrit using git-review. You will get a change number.
  • Choose a puppet master server <master>
  • Build <worker> as a large Jessie instance (probably anywhere, but ideally in the same project as <master> if <master> is a VM
  • On <worker>, apply the classes "role::puppet_compiler" and "profile::puppetmaster::labsenc" (via Horizon, for example)
  • On <worker>, apply the following hiera (via Horizon, for example):
    discovery::app_routes: {}
    etcd::cluster_name: <something arbitrary and distinctive>
    etcd::cluster_state: new
    etcd::host: '%{::fqdn}'
    etcd::peers_list: <worker hostname>=http://<worker fqdn>:2380
    etcd::port: 2739
    etcd::ssl::puppet_cert_name: '%{::fqdn}'
    etcd::use_ssl: true
    labsdnsconfig: {}
  • Gather facts of target host. On a local (not a VM) with keys installed to access all the necessary hosts, run this script from the puppet repo:
$ PUPPET_MASTERS=<master> PUPPET_COMPILER=<worker> modules/puppet_compiler/files/compiler-update-facts
  • In order to see results in HTML for a web browser, you will need to set up a web proxy (ideally named pointing to <worker>

Make sure port 80 is open on <worker> so the proxy can reach it. You can do this via Horizon.

  • Once all that is done, you can invoke a compiler test on <worker> like this:
CHANGE=<patch of interest> NODES=<node of interest> BUILD_NUMBER=8 puppet-compiler

The source of this information is:

Catalog compiler local run (pcc utility)

There is a also a tool called pcc under the operations/puppet/utils repo. You'll need your Jenkins API token to make it work, retrievable under$YOURUSERNAME/configure.


$ ./utils/pcc GERRIT_CHANGE_NUMBER LIST_OF_NODES --username YOUR_USERNAME --api-token 12312312312312313  
$ ./utils/pcc 282936 oxygen.eqiad.wmnet --username batman --api-token 12312312312312313


Some common errors and mistakes.

  • Catalog for Cloud VPS instances doesn't get any classes/roles.

This happens because $::realm is not set to labs. There are patches in place to fix this, but the puppet-compiler software needs to be released with these patches.

  • ERROR: Unable to find facts for host, skipping

If running locally, collect facts by hand from the corresponding puppetmaster. If running in the jenkins web service for a production host, follow these instructions.

See also