Satellite 6 or Katello : How to add Puppet Module repository from PuppetForge?

From the gui

1.- Content-->Products--> New Product

2.- Fill the Following:
Name: PuppetForge
Label: is automatic fill for you 
Save the information

3.-Select the new product created

4.- Choice the Tab Repositories and Press the button create a new repository

5.- Fill the following:
Name : Puppet Forge Repo
Label: Puppet_Forge_Repo
Type: Puppet
URL:https://forge.puppetlabs.com/
Publish via HTTP
Save it

6.- Now with the new repository created just click the button sync now for start the syncronization of the repo

Via command shell you need to make the following procedure:

1.- Connect to you satellite server via ssh
#ssh root@satellite.example.com
2.- Run the following command to enter in hammer shell
hammer  --username   <admin user of satellite> --password   <password>
3.- Get the organization id that you want to create the new product
hammer> organization list
ID NAME LABEL DESCRIPTION
1 Default_Organization Default_Organization Default_Organization Organization
4.-Create the new product with the following command:
#hammer> product create --name PuppetForge --label PuppetForge --organization-id 1 
Product created
Where:
name: is the name of the product you want to add to you organization
label: is the name requiered for create the product  must be not contain any space you can use _ or - to fill the spaces
Organization-id: the id number of the organization you want to create the product
5.-Get from the new product the product id with the following command
#hammer> product list  --organization-id 1
ID NAME DESCRIPTION ORGANIZATION REPOSITORIES SYNC STATE
2 Red Hat Beta Default_Organization 0 not_synced
5 Red Hat Enterprise Linux High Availability for RHEL Server Default_Organization 0 not_synced
8 Red Hat Software Collections Beta for RHEL Server Default_Organization 0 not_synced
12 Oracle Java for RHEL Server Default_Organization 0 not_synced
9 Red Hat Enterprise Linux Load Balancer for RHEL Server Default_Organization 0 not_synced
3 Red Hat Software Collections for RHEL Server Default_Organization 0 not_synced
13 Red Hat Enterprise Linux Workstation Default_Organization 0 not_synced
6 Red Hat Enterprise Linux Server Default_Organization 2 finished
4 Red Hat Satellite Capsule Default_Organization 0 not_synced
11 Red Hat Enterprise Linux Resilient Storage for RHEL Server Default_Organization 0 not_synced
7 Red Hat Satellite Default_Organization 1 finished
34 PuppetForge Default_Organization 1 running
6.- Create the repository into this new product with the following command
hammer> repository create --name "Puppet Forge Repo" --label "Puppet_Forge_Repo" --content-type puppet --url http://forge.puppetlabs.com/ --organization-id 1 --product-id 34 --publish-via-http 1
Repository created

Where:
name: Name or the repository you want to have
label: is the name requiered for create the product  must be not contain any space you can use _ or - to fill the spaces
content-type : type of repo (either 'yum' or 'puppet', defaults to 'yum')
url:repository source url
Organization-id: the id number of the organization you want to create the product
Product-id: The id number of the product
Publish Via HTTP: One of true/false, yes/no, 1/0.


Syncronize the contents of the repo

1.- Run the following command to enter in hammer shell
hammer  --username   <admin user of satellite> --password   <password>
2.- Get the organization id that you want to create the new product
hammer> organization list
ID NAME LABEL DESCRIPTION
1 Default_Organization Default_Organization Default_Organization Organization
3.- Get the repo list
#hammer> repository list --organization-id 1
ID NAME PRODUCT CONTENT TYPE URL
58 Puppet Forge Repo PuppetForge puppet http://forge.puppetlabs.com/
2 Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server Red Hat Enterprise Linux Server yum https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os
3 Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server Red Hat Enterprise Linux Server yum https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os
4.-Get from the new product the product id with the following command
#hammer> product list  --organization-id 1
34 | PuppetForge | | Default_Organization | 0 | not_synced
5.-Syncronize the repo with the following command:
#hammer> repository synchronize --async --id 58 --organization-id 1 --product-id 34

Repository is being synchronized in task c555601e-8946-43a9-94e6-8cd523c174e4
6.-To check the progress of the task you can run the following command:
#hammer> task progress --id c555601e-8946-43a9-94e6-8cd523c174e4
If you want to exit from the task just press ctrl+c

Comments

Popular posts from this blog

How to clean all the foreman task and locked task

CentOS 7 Server Hardening Guide

How to restrict users to send only mail to the local domain in Zimbra