3.5. Adding Puppet Modules from a Git Repository

As an alternative to manually uploading modules, Red Hat Satellite 6 includes a utility called pulp-puppet-module-builder. This tool checks out repositories containing a set of modules, builds the modules, and publishes them in a structure for Satellite 6 to synchronize. This provides an efficient way to manage module development in Git and include them in the Satellite 6 workflow.

Note

You can also install the pulp-puppet-module-builder tool on other machines using the pulp-puppet-tools package.
One common method is to run the utility on the Satellite 6 server itself and publish to a local directory.

Procedure 3.3. Publishing Git Repository to a Local Directory

  1. Create a directory on the Satellite server to synchronize the modules.
    # mkdir /modules
    # chmod 755 /modules
    
  2. Run the pulp-puppet-module-builder and checkout the Git repository.
    # pulp-puppet-module-builder --output-dir=/modules --url=git@mygitserver.com:mymodules.git --branch=develop
    
    This checks out the develop branch of the Git repository from git@mygitserver.com:mymodules.git and publishes the modules to /modules.
The same procedure applies to publishing modules to a HTTP server.

Procedure 3.4. Publishing Git Repository to a Web Server

  1. Create a directory on the web server to synchronize the modules.
    # mkdir /var/www/html/modules
    # chmod 755 /var/www/html/modules/
    
  2. Run the pulp-puppet-module-builder and checkout the Git repository.
    # pulp-puppet-module-builder --output-dir=/var/www/html/modules/ --url=git@mygitserver.com:mymodules.git --branch=develop
    
    This checks out the develop branch of the Git repository from git@mygitserver.com:mymodules.git and publishes the modules to /modules.
In the Satellite 6 Web UI, create a new repository with the URL set to the location of your published modules.

Procedure 3.5. Creating a Repository for Puppet Modules from Git

  1. On the Products page, click on the custom product created previously (MyProduct).
  2. Navigate to the Repositories subtab.
  3. Click Create Repository.
  4. Provide the repository with a Name. This example uses the name MyGitRepo.
  5. The Label field automatically populates with a label based on the Name.
  6. Select puppet as the repository Type.
  7. In the URL field, set the location you defined earlier. For example, local directories on the Satellite 6 server use the file:// protocol:
    file:///modules
    
    A remote repository uses the http:// protocol:
    http://webserver.example.com/modules/
    
  8. Click Save.
  9. Click Sync Now to synchronize the repository.
The Puppet modules in the Git repository are now included in your Satellite 6 server.