Satellite-clone contains simple Ansible playbooks that can be used to perform any of the following tasks:
- Setup Satellite 6.1 or 6.2 install with the Satellite backup data.
- Change the hostname on an existing Satellite install.
Ideally, you need two hosts to run this project:
- Ansible Control node (referred to as
Control node
in the rest of this document) is the host from which this ansible project is run. - A
Satellite host
(for hostname change) or ablank host
(to clone existing Satellite 6.1 or 6.2)
Note
- You can get away with using one host by optionally choosing to use the
Satellite host
as theControl node
. - Make sure that the Control node can connect to the Satellite host via paswordless ssh.
Supported versions
- RHEL 6
- RHEL 7
-
Installation of required packages: a. Install
ansible
package on the Control node. For RHEL boxes, [access to EPEL] (https://access.redhat.com/solutions/3358) is required.# yum install -y ansible
b. Since the playbook uses
synchronize
module, installrsync
package on the Ansible Control node.# yum install -y rsync
-
git clone this project.
# git clone https://github.com/RedHatSatellite/satellite-clone.git
- Create an inventory file named
inventory
(by copyinginventory.sample
) and update it as necessary:
# cp inventory.sample inventory
Now you can proceed to any of the following tasks:
- Cloning a Satellite host
- Changing the hostname of a Satellite host
- Update Satellite to a new minor version
- You will need files from a katello-backup (
katello-backup
on theSatellite host
).
Note: The cloning playbook will work with or without the pulp_data.tar file from the backup.
- Make sure that the Destination node has adequate space and also make sure that the root partition has all the storage space. You may utilize this [script] (https://gist.githubusercontent.com/sthirugn/cdc34006ae280c344a15a474f7e35918/raw/d6382b8ffabcd9b2a5ab07150201388abfb7e01f/reallocate.sh) if needed.
Note The ansible playbook run will fail if the free space in root partition is less than the value specified in required_root_free_space
variable in [roles/sat6repro/vars/main.yml] (roles/sat6repro/vars/main.yml)
-
Move the data backup tar files - config, pgsql, mongodb to the Control Node under the project folder - [satellite-clone/roles/sat6repro/files] (roles/sat6repro/files) so Ansible can find them.
-
Create file
roles/sat6repro/vars/main.yml
(by copyingroles/sat6repro/vars/main.sample.yml
) and update it as necessary.# cp roles/sat6repro/vars/main.sample.yml roles/sat6repro/vars/main.yml
-
Add the IP address of the Destination node to the copied inventory file. If executing the playbook on localhost, add
ansible_connection=local
after the IP address. -
Run the ansible playbook:
# ansible-playbook -i inventory satellite-clone-playbook.yml
Note:
- The playbook installs Satellite and may may take a while to complete.
- To view the sequence of steps performed by this playbook see the [readme] (roles/sat6repro/README.md#sequence-of-steps-performed-by-this-playbook) section of the sat6repro role.
- The playbook will reset the admin password to "changeme"
- The installer will be run with
--foreman-proxy-dns false --foreman-proxy-dhcp false
to avoid configuration errors during the install. If you want to use provisioning on the cloned Satellite, you will have to manually re-enable these settings.
- Before you run the hostname change playbook, you have to make a manual change to the default capsule's hostname. Log into UI and rename the default capsule (under infrastructure->capsules) to the new hostname using both the name and url fields.
-
Update the required sections in [roles/change_hostname/vars/main.yml] (roles/change_hostname/vars/main.yml).
-
Update the [inventory] (inventory) file under the root of this project to add your Satellite host's ip address. If executing the playbook on localhost, add
ansible_connection=local
after the IP address -
Run the ansible playbook:
# ansible-playbook -i inventory satellite-hostname-playbook.yml
-
If you have a capsule you will need to reregister it with RHSM and then run the following (replacing
<capsule-hostname>
with your capsule's hostname):# capsule-certs-generate --capsule-fqdn '<capsule-hostname>' --certs-tar '~/<capsule-hostname>-certs.tar'`
Then follow the output generated by the capsule-certs-generate command
-
Update the [inventory] (inventory) file under the root of this project to add your Satellite host's ip address. If executing the playbook on localhost, add
ansible_connection=local
after the IP address -
Run the ansible playbook:
Reboot is disabled by default, so to update without a reboot:
# ansible-playbook -i inventory satellite-update-playbook.yml"
To update with a reboot:
# ansible-playbook -i inventory satellite-update-playbook.yml --extra-vars "reboot=yes"