Skip to main content

Module to manage Puppet control repository hosted on Github

Project description

Py Control Repository is SDK for Pyththon which allows developpers to manage a Puppet Control Repository based on GitHub.


$ pip install py-control-repository


Get Puppet Environment

control_repository = ControlRepository('myorga', 'my_control_repository', 'token')

puppet_environment = control_repository.get_environment('production')

Get all Puppet Environment

Returns the list of all Puppet Environment.

control_repository = ControlRepository('myorga', 'my_control_repository', 'token')

puppet_environments = control_repository.get_environments()

Get all Puppet Environment names

Returns the list of all Puppet Environment names.

control_repository = ControlRepository('myorga', 'my_control_repository', 'token')

puppet_environment_names = control_repository.get_environment_names()

Create a Puppet Environment

Returns the new Puppet Environment.

control_repository = ControlRepository('myorga', 'my_control_repository', 'token')

new_puppet_environments = control_repository.create_environment('source_environment_name',

Get Puppetfile

puppetfile = puppet_environment.get_puppetfile()

List Puppet modules in Puppetfile

module_list = puppetfile.list_modules()

Add a forge module

puppetfile.add_forge_module('puppetlabs/apache', version='0.10.1')

Update a forge module

puppetfile.update_forge_module('puppetlabs/apache', '0.11.0')

Remove a forge module


Add a git module

With no version spicified, it will install the current master branch.

puppetfile.add_git_module('custom_module', '')

You can specify a specific git reference. Supported are :

  • branch
  • ref
  • tag
  • commit

Update a git module

Bump module version

puppetfile.update_git_module('mymodule', '12.0.2')

You can also change a module reference type and its value.

For example you have a module deployed by its master branch and want to track it by a specific tag.

puppetfile.update_git_module('mymodule', '1.0.0', reference_type='tag')

Remove a git module


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for py-control-repository, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size py_control_repository-1.0.0-py3-none-any.whl (12.1 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page