Registering Hosts Using the Bootstrap Script

orcharhino comes with a bootstrap.py script to register existing hosts to orcharhino. It is available on your orcharhino at https://orcharhino.example.com/pub/bootstrap.py.

You need root access on any hosts you want to attach to orcharhino and they need to be able to communicate with orcharhino or any orcharhino proxy via HTTP(S). Consider creating a backup or snapshot of your host before running the bootstrap script.

Prerequisites
  • If you use a self-signed certificate on your orcharhino, ensure hosts trust the SSL certificate before running the bootstrap.py script.

  • An activation key for the host needs to exist and contain the necessary software content.

  • A host group must be configured accordingly to have orcharhino manage the host completely.

    Ensure to select a host group without any predefined deploy on compute resource. Otherwise, attaching an existing host starts deploying a new host to the compute resource selected in the deploy on drop down menu. Refer to creating a host group for more information.

  • Synchronize the required orcharhino client repository and create a content view.

  • Use --deps-repository-url to specify the repository containing the required dependencies. Navigate to Content > Products, click on your orcharhino clients product, choose the orcharhino client repository on the Repositories tab, and select the appropriate client repository. Pass the Published At URL using --deps-repository-url, for example --deps-repository-url https://orcharhino.example.com/pulp/deb/Example/Library/custom/SLES_Client/SLES_15_SP3_Client/.

  • Ensure that you provide the managed host with the dependencies of subscription-manager:

    Operating System SUSE Repositories

    SLES 11 SP4

    SLES11-SP4-Pool for sle-11-x86_64, SLES11-SP4-Updates for sle-11-x86_64

    SLES 12 SP5

    SLES12-SP5-Pool for sle-12-x86_64

    SLES 15

    SLE-Product-SLES15-Pool for sle-15-x86_64, SLE-Module-Basesystem15-Pool for sle-15-x86_64

    SLES 15 SP1

    SLE-Product-SLES15-SP1-Pool for sle-15-x86_64, SLE-Module-Python2-15-SP1-Pool for sle-15-x86_64, SLE-Module-Basesystem15-SP1-Pool for sle-15-x86_64

    SLES 15 SP2

    SLE-Product-SLES15-SP2-Pool for sle-15-x86_64, SLE-Module-Python2-15-SP2-Pool for sle-15-x86_64, SLE-Module-Basesystem15-SP2-Pool for sle-15-x86_64

    SLES 15 SP3

    SLE-Product-SLES15-SP3-Pool for sle-15-x86_64, SLE-Module-Python2-15-SP3-Pool for sle-15-x86_64, SLE-Module-Basesystem15-SP3-Pool for sle-15-x86_64

    • Install the SCC Manager Plugin on your orcharhino.

    • Add your SCC account to orcharhino.

    • Import SUSE products, including the base operating system and the required repositories as described above.

      For example, if you want to attach hosts running SLES 15 SP3, include the SLE-Product-SLES15-SP3-Pool for sle-15-x86_64, SLE-Module-Python2-15-SP3-Pool for sle-15-x86_64, and SLE-Module-Basesystem15-SP3-Pool for sle-15-x86_64 repositories.

    • Synchronize SUSE content to your orcharhino.

      Ensure the necessary SUSE repositories are available to the host you want to attach to orcharhino using the activation key.

Procedure
  1. Download the bootstrap.py script using wget:

    # wget https://orcharhino.example.com/pub/bootstrap.py
  2. Use the --help option to display a list of mandatory options:

    # python bootstrap.py --help
  3. Attach an existing host to orcharhino. This example attaches an existing host running SUSE Linux Enterprise Server:

    # ./bootstrap.py \
    --fqdn "my-host.example.com" \
    --skip "puppet" \
    -L "Munich" \
    -a "suse_linux_enterprise_server" \
    -g "SUSE Linux Enterprise Server" \
    -l "admin" \
    -o "Example" \
    -p "password" \
    -s "orcharhino.example.com"
    • Use --fqdn to specify the FQDN of the new host, for example --fqdn my-host.example.com.

    • Use --skip "puppet" to optionally skip the installation of Puppet.

    • Use -L to specify the location, for example -L Munich.

    • Use -a to specify the activation key, for example -a suse_linux_enterprise_server or -a suse_linux_enterprise_server_puppet.

    • Use -g to add the host to a host group, for example -g "SUSE Linux Enterprise Server with Puppet".

    • Use -l to specify the orcharhino user, for example -l admin.

    • Use -o to specify the organization, for example -o Example.

    • Use -p to specify the corresponding password, for example -p password.

    • Use -s to specify the orcharhino FQDN, for example -s orcharhino.example.com.

      You may use additional options to have orcharhino manage DHCP, provisioning, and configuration management for your existing host.

Associating Registered Hosts with a Compute Resource

If you attach hosts to orcharhino using the bootstrap.py script, the hosts are not automatically associated with their compute resource. You have to manually disassociate the host and then reassociate them again.

Procedure
  1. Navigate to Hosts > All Hosts and select your host.

  2. In the Select Action menu, click Disassociate Hosts.

  3. Navigate to Infrastructure > Compute Resources and select your compute resource.

  4. Click Associate VMs.

  5. In case your orcharhino Server or orcharhino Proxies run on the same compute resource, disassociate the VMs on the All Hosts page again.

Registering Hosts Manually

You can manually register existing hosts to use orcharhino as a source of content.

Procedure
  1. (Debian, SLES, and Ubuntu only) Add a repository containing the subscription-manager package.

  2. Install the subscription-manager using apt, yum, or zypper.

  3. Install the katello-consumer certificate from orcharhino.example.com/pub/.

  4. Register your host with orcharhino using an activation key.

  5. Install the katello-host-tools.

  6. Add SSH keys for remote execution.

Registering Hosts Running SUSE Linux Enterprise Server Manually

Procedure
  1. Add a repository containing the subscription-manager package:

    # zypper addrepo -G --check "http://orcharhino.example.com/pulp/repos/Example/Library/custom/SLES_Client_V2/SLES_Client_15SP3_V2/" or_sles_client
  2. Install the subscription-manager:

    # zypper --non-interactive --no-gpg-checks --quiet install --auto-agree-with-licenses subscription-manager
  3. Install a package from your orcharhino bundling all necessary certificates:

    # rpm -ivh http://orcharhino.example.com/pub/katello-ca-consumer-latest.noarch.rpm
  4. Register your host with an activation key:

    # subscription-manager register --org="Example" --name="sles15sp3.example.com" --activationkey="my-sles15sp3-activation-key"
  5. Install the katello-host-tools:

    # zypper --non-interactive --no-gpg-checks --quiet install --auto-agree-with-licenses katello-host-tools
  6. Continue with adding SSH keys for remote execution.

Adding SSH Keys for Remote Execution

Add the SSH public key from orcharhino to your managed hosts to use remote execution and to patch your hosts.

Procedure
  1. Create the required directory:

    # mkdir -p ~root/.ssh
  2. Add the SSH public key from your orcharhino:

    # cat << EOF >> ~root/.ssh/authorized_keys
    ssh-rsa <ssh-public-key> foreman-proxy@orcharhino.example.com
    EOF

    Ensure that you use a user with root privileges. This can either be root or any user being part of the sudo group.

Registering Hosts Running SUSE Linux Enterprise Server 11 Using Katello Agent

We generally recommend using the katello-host-tools on CentOS, Oracle Enterprise Linux, Red Hat Enterprise Linux, as well as SUSE Linux Enterprise Server version 12 and 15 as shown above. However, SLES 11 hosts only work with katello-agent. Hosts running SLES 12 and below cannot signal orcharhino that they need to be rebooted after a Linux Kernel update or that services need to be restarted.

SLES 11 is EoL and the Katello Agent is deprecated.

Use the following options to register an existing host running SLES 11 using the bootstrap.py script to orcharhino:

  • Use --deps-repository-url to specify the client repository, for example --deps-repository-url "https://orcharhino.example.com/pulp/repos/Example/Library/custom/SLES_Client/SLES_Client_11SP4/".

  • Use --download-method="http" to specify the download method.

  • Use --install-katello-agent to install the katello-agent package.

  • Use --install-packages "or-sles-client" to specify the necessary meta package with dependencies to other required packages.

  • Use --skip "katello-host-tools" to not install the katello-host-tools package.

Associating Registered Hosts with a Compute Resource

If you attach hosts to orcharhino manually, the hosts are not automatically associated with their compute resource. You have to manually enter networking information before you can associate the VMs.

Procedure
  1. On your managed hosts, view the MAC address, IP address, and device identifier of the network interface providing a connection to your orcharhino:

    # ip a
  2. Navigate to Hosts > All Hosts, select your host, and click Edit.

  3. On the Interfaces tab, click Edit and enter the MAC address, IPv4 address, and the device identifier.

  4. Click Submit to save your changes.

  5. Navigate to Hosts > All hosts and tick the checkbox of your host.

  6. In the Select Action drop down menu, click Disassociate Hosts.

  7. Navigate to Infrastructure > Compute Resources and select the compute resource your host runs on.

  8. On the Compute Resources tab, click Associate VMs.

  9. Optional: Navigate to Hosts > All Hosts, select your host, and verify your change by changing the power status of the host.

Migrating From Katello Agent to Remote Execution

Remote Execution is the preferred way to manage package content on hosts. The Katello Agent is deprecated and will be removed in a future orcharhino version. Follow these steps to switch to Remote Execution.

Prerequisites
  • You have previously installed the katello-agent package on content hosts.

Procedure
  1. Stop the goferd service on content hosts:

    # systemctl stop goferd.service
  2. Disable the goferd service on content hosts:

    # systemctl disable goferd.service
  3. Remove the Katello agent on content hosts:

    If your host is installed on oVirt version 4.4 or lower, do not remove the katello-agent package because the removed dependencies corrupt the host.
    # yum remove katello-agent
  4. Distribute the remote execution SSH keys to the content hosts. For more information, see Distributing SSH Keys for Remote Execution.

  5. In the orcharhino management UI, navigate to Administer > Settings.

  6. Select the Content tab.

  7. Set the Use remote execution by default parameter to Yes.

The orcharhino server now uses host management by remote execution instead of katello-agent.

The following table shows the remote execution equivalent commands to perform specific package actions. See hammer job-invocation create --help to learn how to specify search queries to determine the target hosts or host collections.

Table 1. Hammer Commands
Action Katello Agent Remote Execution

Install a package

hammer host package install

hammer job-invocation create --feature katello_package_install

Install a package (host collection)

hammer host-collection package install

hammer job-invocation create --feature katello_package_install

Remove a package

hammer host package remove

hammer job-invocation create --feature katello_package_remove

Remove a package (host collection)

hammer host-collection package remove

hammer job-invocation create --feature katello_package_remove

Update a package

hammer host package upgrade

hammer job-invocation create --feature katello_package_update

Update a package (host collection)

hammer host-collection package update

hammer job-invocation create --feature katello_package_update

Update all packages

hammer host package update

hammer job-invocation create --feature katello_package_update

Install errata

hammer host errata apply

hammer job-invocation create --feature katello_errata_install

Install errata (host collection)

hammer host-collection errata install

hammer job-invocation create --feature katello_errata_install

Install a package group

hammer host package-group install

hammer job-invocation create --feature katello_group_install

Install a package group (host collection)

hammer host-collection package-group install

hammer job-invocation create --feature katello_group_install

Remove a package group

hammer host package-group remove

hammer job-invocation create --feature katello_group_remove

Remove a package group (host collection)

hammer host-collection package-group remove

hammer job-invocation create --feature katello_group_remove

Update a package group

hammer host package-group update

hammer job-invocation create --feature katello_group_update

Update a package group (host collection)

hammer host-collection package-group update

hammer job-invocation create --feature katello_group_update