Forge Home

pulp_resources

Pulp resources

7,882 downloads

6,431 latest version

4.6 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.0.5 (latest)
  • 0.0.4
released Nov 7th 2016
This version is compatible with:

Start using this module

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

Add this module to your Puppetfile:

mod 'af6140-pulp_resources', '0.0.5'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add af6140-pulp_resources
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install af6140-pulp_resources --version 0.0.5

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

af6140/pulp_resources — version 0.0.5 Nov 7th 2016

#pulp_resource

Talbe of Contents

  1. Module description - What is the pulp_resource module, and what does it do?

Module description

This module defines custom types and providers to manage pulp server resources, including repo, user, role, user permission and role permission.

Set up

What the pulp_resource module required:

  • puppetlabs/inifile module: A inifile utility class is used. The built-in puppet/util/inifile does not allow customized key value seperator
  • working pulp-admin client installation
  • ~/.pulp/admin.conf with auth configuration
[auth]
username: admin
password: admin

Note: This module use credentials from admin.conf to login, so a user certificate is generated. It uses the certificate for operations later on. It checks the certificate expiration date and logins again if necessary.

Beginning with pulp_resource

Declaring pulp_resource class to include custom types.

class {'pulp_resource':
}

Managing pulp resources with custom types

Pulp repos####

Listing pulp repos: (other resource types works similarly)

[root@localhost ~]# puppet resource pulp_repo
pulp_repo { 'test':
  ensure      => 'present',
  description => 'test rpm repo',
  serve_http  => 'false',
  serve_https => 'true',
  type        => 'rpm',
}
pulp_repo { 'test_rpm':
  ensure       => 'present',
  description  => '"test rpm"',
  display_name => '"Test RPM Repo"',
  serve_http   => 'false',
  serve_https  => 'true',
  type         => 'rpm',
}
pulp_repo { 'test_rpm2':
  ensure      => 'present',
  description => '2test rpm repo',
  serve_http  => 'false',
  serve_https => 'true',
  type        => 'rpm',
}
pulp_repo { 'test_rpm_rpm':
  ensure       => 'present',
  description  => 'test rpm',
  display_name => 'Test RPM Repo',
  serve_http   => 'false',
  serve_https  => 'true',
  type         => 'rpm',
}

Create a pulp repository:

pulp_repo {'test_rpm':
 ensure => 'present',
 description => 'test rpm repository',
 display_name => 'Test RPM Repository',
 feed => 'http://dummy',
 serve_http => 'false',
 serve_https => 'true',
 type => 'rpm',
}

Create a pulp user:

Note A password field is required, but it is only effective when the user is created.

pulp_user {'test':
 ensure => 'present',
 roles => ['super-user'],
 password => 'test',
}

Create a pulp role:

pulp_role {'testrole':
  ensure => 'present',
  description => 'test role',
}

Create a pulp user permission:

This resource use composite namevar. The title is spit into two parts seperated by ':', first part is the name which maps to pulp user login, the second part is the pulp resource.

pulp_permission {'test:/':
  ensure => 'present',
  permissions => ['read']
}

Create a pulp role permission:

It uses composite namevar. The title split into two parts seperated by ':'. The first part is the role-id, the second part is the resource.

pulp_role_permission{'testrole:/':
  ensure => 'present',
  permissions => ['read']
}