Git-based version systems have become the cornerstone of many best practices in development teams. In the last couple of years, with the rise of continuous delivery and continuous deployment, slowly but surely git has also gained a foothold in the operations environment. The DevOps mindset propagates the use of Infrastructure as Code and to put all this code in versioning systems like git. So git has become a big thing and an integral part of DevOps processes and tools. . Examples of this are the full integration of Puppet and git.

In the world of git Github has been one of the largest git service providers and many organizations are depending on either the hosted GitHub version or their own GitHub enterprise to drive both their development as well as their operations. But along the way, we forgot something. We should be putting all our configuration in code. But what about the GitHub configuration? Most of this is still done by clicking around. But now we have introduced the github_config puppet module. This module extends the puppet language to allow you to manage your whole GitHub setup with Puppet.

The types

The github_config module allows you to manage:


Allows you to manage github collaborators on your repository. For organization-owned repositories, the list of collaborators includes outside collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.

Here is an example o how to do this:

github_collaborator { 'authentication/owner/repo:collaborator':
  ensure      => 'present',
  permissions => 'pull',


Specfies the credentials to use when connecting to github.

Here is an example on how to use this:

github_credentials { 'user':
  ensure   => 'present',
  password => 'very_secret',
  username => 'github_username',

You can use multiple accounts. I that case all github puppet types will fetch information from all accounts.


Allows you to manage github depoloy_keys. You can specify one or more deploy_keys to a repository. Here is an example:

  github_deploy_key { 'authentication/owner/repo:key_name':
    ensure    => 'present',
    key       => 'ssh-rsa XXXXB3NzaC5yc2EXXXXDAQABXXABAQDgrJyY5r+jfg+J5/nagq46UFVSwCLFwMh3UClkNTBxseuMxSa+GTBmeBnTDJySq5QxaCPj6P3oIIOUhjWZcjXo7MxAMXeTiPaMDQH9q8NJGiXhP19UDvEQMllHZG6qJmSNxAWkrFAIDxLO03AQYkYYoZSwF3lqcWQhCNtiRiCq2ivWBoRgotfXa6muo3yVvvsHVQnv9EojyfBdCxBZmRnRY9cAXGBQ2fx9TFba3cURgH9T9q2E6rB6TRI0jVDwvmdL/wLQPrNxUBD8lxd/uk4cE45emMFtQm0Hu4D/zlQLNarsiBhIaFFFOqIW+SJvmYipL6YxDX+huFdDrlfhFmwp',
    read_only => 'false',

When you are specifying a different key or change the read_only property, under the hood puppet will delete the key and create a new one.


Allows you to manage repository hooks. The Repository Webhooks API allows repository admins to manage the post-receive hooks for a repository. Webhooks can be managed using the JSON HTTP API, or the PubSubHubbub API.

If you would like to set up a single webhook to receive events from all of your organization’s repositories, check out the github API documentation for Organization Webhooks.

Here is an example:

github_hook { 'authenticator/owner/repo:web':
  ensure => 'present',
  active => 'true',
  config => {'content_type' => 'form', 'insecure_ssl' => '0', 'url' => ''},
  events => ['push'],


Allows you to manage a github organization.

Here is an example on how to do this:

github_organization { 'account/organization':
  ensure        => 'present',
  billing_email => '',
  blog          => '',
  description   => 'A github organization',
  email         => '',
  location      => 'The Netherlands',


Allows you to create and manage github repos. This includes repositories owned by the authenticated user, repositories where the authenticated user is a collaborator, and repositories that the authenticated user has access to through an organization membership.

Here is an example on how to do this:

github_repo { 'account/owner/repo':
  ensure        => 'present',
  description   => 'Just some text.',
  has_issues    => 'true',
  has_wiki      => 'true',
  homepage      => '',


Allows you to manage a github team. Here is an example on how to do this:

github_team { 'authentication/organization/team_name':
  ensure      => 'present',
  description => 'My first team',
  members     => ['jim', 'spock', 'checkov']
  privacy     => 'secret',


Allows you to manage the repo’s that are visible by team memembers. Here is an example on how to add a repository to a team.

github_team_repo { 'acount/organization/team:owner/repo':
  ensure      => 'present',
  permissions => 'pull',