/postrun

Deploy Puppet Code via modules.yaml

Primary LanguagePython

Build Status Coverage Status

Postrun

Deploys Puppet modules from modules.yaml

Prerequisite

Vagrant

To deploy local modules and Hiera data in Vagrant the files need to places under:

  • /opt/puppet/modules
  • /opt/puppet/hiera

modules.yaml

The postrun script requires a modules.yaml file for each environment in /etc/puppetlabs/code/environments/environment_name/modules.yaml

The modules.yaml file lists a location and the Puppet modules for this location. Example:

modules:
  location_name:
    module_name:
      url: 'https://github.com/foobar.git'
      ref: branch'

Usage

Getting help:

/etc/puppetlabs/r10k/postrun/postrun.py -h

Running the postrun script:

/etc/puppetlabs/r10k/postrun/postrun.py

Running the postrun script verbose:

/etc/puppetlabs/r10k/postrun/postrun.py -v

Logging

The script writes all messages to stdout and into a logfile /var/log/postrun.log.

Testing and Development

Installing requirements:

pip install -r tests/requirements.txt

Running tests:

py.test

Running tests with coverage:

py.test --cov=postrun tests/