Adding Clients (Linux)

This chapter outlines the process of integrating Linux clients into the opsi environment. We’ll first guide you through adding existing clients, followed by instructions on how to add new clients.

opsi also supports the management of Windows and macOS clients. For detailed information on these, refer to the chapters Windows Clients and macOS Clients.

Integrating existing Clients

To add existing clients with an already installed operating system to opsi, you need to install the client agent on the respective computer. Once installed, the client will automatically appear in the client list of the management interface, even if you haven’t manually added it there.

There are two primary methods for installing the client agent:

  • Using the Installer on the Client: This approach involves installing the client agent directly on the client. It’s especially effective for setting up individual computers.

  • Using opsi-deploy-client-agent: This method focuses on installing the client agent via the server. It’s optimal for mass rollouts, assuming the required activations are in place on the Linux clients.

After installing the client agent, you can then install opsi products on the client (refer to chapter Deploying Products (Client)).

Using the Installer on the Client

This method is ideal for integrating individual computers as clients in an opsi environment. Follow these steps:

  1. Log in to the client.

  2. Download the installer from your opsi config server. It is located at https://<fqdn_or_ip_of_the_config_server>:4447/public/opsi-client-agent/. For Linux, the program is named opsi-linux-client-agent-installer.run, and for macOS, it’s opsi-mac-client-agent-installer.command.

The Installer is located on the opsi config server at `\https://<fqdn_oder_ip_des_configservers>:4447/public/opsi-client-agent/`.
  1. Make the file executable:
    chmod +x opsi-linux-client-agent-installer.run (Linux)
    chmod +x opsi-mac-client-agent-installer.command (macOS)

  2. Execute the installer; root rights are required for both Linux and macOS:
    sudo ./opsi-linux-client-agent-installer.run (Linux)
    sudo ./opsi-mac-client-agent-installer.command (macOS)

  3. The installer then unpacks itself into a temporary local directory and launches the included oca-installation-helper.

The Installer launches the `oca-installation-helper`.
  1. In the dialog box, enter the details for the client ID, the opsi service URL, the username, and the password. The fields may already be pre-filled, but ensure they are adjusted to match your environment:

    • The client ID usually corresponds to the FQDN (Fully Qualified Domain Name) of the client.

    • The opsi service URL should be formatted as https://<fqdn_or_ip_of_config_server>:4447.

    • For initial installations, use the username and password of an account in the opsiadmin group (refer to chapter Authorizations). For reinstallation, you may use the client ID and the host key.

  2. The installer will contact the server via the opsi web service to register the client with the server. Subsequently, it executes the setup.opsiscript of the client agent using the included opsi-script.

When running the installer, you can include parameters to automate various processes. Detailed information is available in the respective client agent chapters.

Using opsi-deploy-client-agent

The opsi-deploy-client-agent tool enables the distribution of the opsi Linux client agent directly from the opsi server to the clients, offering an efficient approach for integrating numerous clients into the opsi environment from the server itself.

Requirements for Linux clients:

  • Activated SSH access

  • An administrative account

You can locate the opsi-deploy-client-agent in the /var/lib/opsi/depot/opsi-linux-client-agent directory on the opsi server. Executing this program requires root privileges. Alternatively, it is sufficient for the user to be a member of the opsifileadmins group. If you encounter any issues in executing the script, resolve them using the following command:

opsi-set-rights /var/lib/opsi/depot/opsi-linux-client-agent/opsi-deploy-client-agent

The tool performs the following steps:

  1. Creates clients on the server.

  2. Copies installation files and configurations, such as the host key.

  3. Initiates installation through the oca-installation-helper in a non-interactive manner.

The opsi-deploy-client-agent tool accepts IP addresses, host names, and FQDNs. It automatically attempts to identify the type of address provided by the user.

To begin, navigate to the program’s main directory:

cd /var/lib/opsi/depot/opsi-linux-client-agent

Use the --help parameter to display the online help:

*opsi-deploy-client-agent* Online Help
Figure 1. opsi-deploy-client-agent Online Help

Typical commands are:

  • For a single client:

./opsi-deploy-client-agent -v --user=root linux-client
  • For a list of clients:

./opsi-deploy-client-agent -v --user=root --hosts-from-file HOSTFILE.TXT  --skip-existing-clients

The file HOSTFILE.TXT holds a list of clients, with each client’s name (FQDN) entered on a separate line. If these clients are not already registered with the opsi-server, the opsi-deploy-client-agent will attempt to install the opsi-linux-client-agent on these machines.

Adding new Clients

You can also use opsi to install an operating system on new clients and subsequently integrate them. In this approach, the required client agent is installed automatically.

The following sections describe various methods of creating a client in opsi: via the graphical management interface opsi-configed, on the command line, and with our boot CD. After creating a client, you can then use opsi to install a new operating system on it.

Graphical Management Interface

To add a new client to the opsi server via the management interface opsi-configed, select Client / Create a new opsi client from the menu and enter the following information:

  • Client name

  • DNS domain (if it’s different from the default)

  • Client description

  • IP address (required if DNS can not be used to resolve the client’s address)

  • MAC address (required if the opsi server is the DHCP server or if you want to use PXE boot with this client)

Once you have confirmed everything, the client is registered with the opsi server. If the opsi server also functions as a DHCP server, the client is additionally set up as a PXE client in the DHCP configuration.

You can view the list of configured opsi clients at any time in Client Configuration mode on the Clients tab.

Command Line

You can also use the opsi-cli tool on the command line to create a new client. The general syntax looks like this:

opsi-cli jsonrpc execute host_createOpsiClient <client-id> [opsiHostKey] [description] [notes] [hardwareAddress] [ipAddress] [inventoryNumber] [oneTimePassword] [created] [lastSeen]

If you omit any of the optional values in the call, default values are used; as a result, most of the fields will then be empty.

Example: The following opsi-cli command creates the client testclient.domain.local with a random host key, the description testclient, without notes, with the MAC address 00:0c:29:12:34:56, and the IP address 192.0.2.1:

opsi-cli jsonrpc execute host_createOpsiClient testclient.domain.local "null" "testclient" "" 00:0c:29:12:34:56 192.0.2.1

Boot CD

You can find an ISO image of the boot CD on the opsi Tools website. Download the image and burn it to a CD. Then, boot the computer from this CD. The installer will welcome you with the following boot menu:

The Boot CD shows the following Boot Menu.
Figure 2. The Boot CD shows the following Boot Menu.

Select Start opsi (english) and press the [Enter] key. After a while, a dialog box will appear in which you should enter the IP address of the client, the network mask, the hostname, the domain name, the gateway, the DNS server, and the IP address of the opsi config server (optional). If your DHCP server assigns IP addresses to unknown computers, some of these fields may already show valid values.

The Network Settings for the new Client
Figure 3. The Network Settings for the new Client

Use the [Tab] key to navigate to the OK option and then press [Enter].

How should the client register with the opsi server?
Figure 4. How should the client register with the opsi server?

Select Admin account to enable the client to log on to the opsi server and create itself. This process will be authorized in the following step.

Authenticate on the opsi server.
Figure 5. Authenticate on the opsi server.

Enter the username and password for an account that is a member of the opsiadmin group (refer to chapter Authorizations for details). Upon successful login, the client will automatically transmit its data to the server, creating its record. You’ll then see a list of available Netboot products. Select the desired products for installation using the space bar.

Select a Netboot product for Installation
Figure 6. Select a Netboot Product for Installation

You can now choose either the operating system you wish to install or opt for hardware inventory.