Forge Home

github_projects

Clone all the public github projects for a given github ID

8,316 downloads

7,891 latest version

2.3 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.2.0 (latest)
  • 0.1.0
released Nov 16th 2015

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'geoffwilliams-github_projects', '0.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add geoffwilliams-github_projects
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install geoffwilliams-github_projects --version 0.2.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

geoffwilliams/github_projects — version 0.2.0 Nov 16th 2015

github_projects

Build Status

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with github_projects
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

Overview

Clone (and optionally update) all GitHub projects for a given github user ID

Module Description

Downloads all the public repositories for a given GitHub user ID. The gitim script is used to do this and a complete copy of this project is supplied in this module's files directory. To avoid slowing down your puppet runs, a cron resource is used instead of an exec.

Setup

Setup Requirements

  • GitHub API usage requires that the user be authenticated against a valid GitHub account
  • While this can be done with a password, this is not recommended as passwords may give more access then is required
  • Instead, users should generate an OAuth token
  • Requires the pip3 python command to be present. On Ubuntu and Debian systems, this is provided in the python3-pip package
  • If you get errors about the pygithub library being missing despite apparently successful library installation, then you may have a miss-match between your pip3 and python3 versions. Check that the versions match and update the symlink at /usr/local/bin/python3 if this is the case

Beginning with github_projects

github_projects module needs to be included once to bring in the python dependencies into scope. The github_projects::get defined resource type can then be used to manage a given directory and checkout code from the specified GitHub user.

This is can be done with a hash of Hiera data:

profiles::github_projects::get:
    "/home/geoff/github": {
        "github_user": "GeoffWilliams",
        "local_user": "geoff",
        "token": "replace_with_you_oauth_hash",
    }

Once data is in Hiera, a simple profile class can both initiate Python and perform the download

class profiles::github_projects(
    $get = hiera("profiles::github_projects::get", {}),
) {

  include github_projects
  create_resources("github_projects::get", $get)

}

Usage

Put the classes, types, and resources for customizing, configuring, and doing the fancy stuff with your module here.

Reference

  • github_projects - Main class used to setup Python dependencies
  • github_projects::get - Defined resource type for cloning/updating repositories

Limitations

Needs Python 3, tested on Ubuntu 15.10. Installs the pygithub Python package and requires Internet access to download. Should work anywhere that pygithub does but this hasn't been tested.

Development

PRs accepted