bartavelle / language-puppet

A library to work with Puppet manifests, test them and eventually replace everything ruby.
BSD 3-Clause "New" or "Revised" License
51 stars 8 forks source link
continuous-integration haskell library parser puppet server tests

language puppet lts nightly Build Status cachix cachix orange

A library to work with Puppet manifests, test them and eventually replace everything ruby.

Install

Install with stack:

stack install language-puppet

Install with nix:

nix-env -i -f https://github.com/bartavelle/language-puppet/tarball/v1.4.5

(replace 1.4.3 with any commit ref or tag).

Build from sources:

git clone https://github.com/bartavelle/language-puppet.git
cd language-puppet
# Using nix
nix build
# Using stack
ln -s stack-10.yaml stack.yaml
stack build

Puppetresources

Basic usage

puppetresources --puppetdir /where/your/puppet/files/are --node node.name.com

The puppetresources command is a command line utility that let you interactively compute catalogs on your local computer. It is much faster than its ruby counterpart, and has been designed for giving assistance to the Puppet catalog writer.

There are 4 different modes:

Catalog is not computed exactly the same way Puppet does. Some good practices are enforced. A strict and more permissive mode are provided.

Command line arguments

Settings defaults using a yaml file

Defaults for some of these options can be set using a /yourworkingdirectory/tests/defaults.yaml file. For instance OptionalTests is checking that all users and groups are known. Because some of these users and groups might be defined outside puppet, a list of known ones is used internally. This can be overridden in that file using the key knownusers and knowngroups.

Please look at the template file for a list of possible defaults.

pdbQuery

The pdbquery command will work with different implementations of PuppetDB (the official one with its HTTP API, the file-based backend and dummy ones). It can be used to:

Command line arguments

Supported features