nstrug / sync-satellite-org

Project to clone metadata from an organisation to a disconnected satellite via a generated playbook
3 stars 0 forks source link

sync-satellite-org

Use this playbook to clone the structure of a Red Hat Satellite Organisation from one satellite to another satellite. The playbook has the following features:

How it works

The sync-satellite-org playbook connects to a satellite, the 'source' and reads metadata for the following objects:

After reading this metadata, a new, portable playbook directory is created - we call this the execution playbook. This execution playbook can be executed against another organisation on any satellite (including the original satellite). The execution playbook will recreate the objects from the source organisation.

Prerequisites

The following python packages need to be installed:

The APYPIE library can be installed by following procedure

RHEL 7 1) Find Python version: env python

2) Install pip version for the default python version: sudo -i yum install python27-python-pip-8.1.2-3.el7.noarch

3) Enable relevant software collection: sudo scl enable python27 bash

4) Install APYPIE: pip install apypie

Fedora 1) Install APYPIE: pip3 install apypie

Running the Playbook

Inventory

An example inventory is provided, the structure is as follows:

[satellite]
<FQDN of source satellite>

[satellite:vars]
<param1>=<val1>
<param2>=<val2>
<param3>=<val3>

NB Only ONE satellite should be specified.

The following parameters can be set:

Parameter Default Notes
foreman_organisation Default_Organization The organization on the source satellite to clone from
foreman_username admin The username to use when connecting to the source satellite
foreman_password foobar The password to use when connecting to the source satellite
foreman_verify_ssl true Whether to use strict SSL cert checking when connecting to the satellite
output_dir /tmp/sync-satellite-org The directory where the execution playbook will bre created

Running the execution playbook

The execution playbook will be created in output_dir on the ansible host.

Inventory

A stub inventory is created for the execution playbook as follows:

[target]
<Enter target satellites here>

[target:vars]
target_foreman_username=<username to connect to target satellites>
target_foreman_password=<password to connect to target satellites>
foreman_verify_ssl=true

MULTIPLE target satellites can be specified, however the same username and password will be used on all of them.