Module: reposerver - lbr38/linupdate GitHub Wiki

The linupdate reposerver module provides a connection between linupdate and a Repomanager server.

The Manage hosts and Manage profiles parameters must be enabled in Repomanager.

Repomanager preview

Managing hosts

A host executing linupdate can send its system and packages informations to the Repomanager server, especially:

  • General informations (hostname, IP, kernel, OS...)
  • Available packages for update
  • Installed packages
  • Packages events history (installation, updates, uninstallation...)

If enabled, an agent on the host can regulary send those informations to the reposerver.

The MANAGE HOSTS tab regroups all hosts that have sent their informations:

alt text

alt text

Managing profiles

The MANAGE PROFILES tab provides a way to create configuration profiles for hosts executing linupdate.

  • A profile can define packages to exclude from updates, services to restart after an update, and repositories the hosts will have access to. It's a convenient way to manage multiple hosts with the same configuration and limit the risks on critical packages updates.
  • Every time linupdate is executed on the host, it gets its profile configuration (including repositories and package exclusions) from its reposerver.

alt text


Module parameters

Those are all the available parameters for the reposerver module:

linupdate --mod-configure reposerver --help
 Available options:

    Name                                                              Description
--  ----------------------------------------------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------
    --help, -h                                                        Show reposerver module help
    
    Configuring reposerver
    
    --url [URL]                                                       Specify target reposerver URL
    --api-key [APIKEY]                                                Specify API key to authenticate to the reposerver
    --ip [IP]                                                         Specify an alternative local IP address to use to authenticate to the reposerver (default: will use the public IP address)
    --register                                                        Register this host to the reposerver (--api-key required)
    --unregister                                                      Unregister this host from the reposerver
    
    Configuring retrieval from reposerver (using configured profile)
    
    --get-packages-conf-from-reposerver [true|false]                  If enabled, packages exclusions will be retrieved from the reposerver
    --get-repos-from-reposerver [true|false]                          If enabled, repositories configuration will be retrieved from the reposerver
    --remove-existing-repos [true|false]                              If enabled, existing repositories will be removed before adding the new ones
    
    Retrieving data from reposerver
    
    --get-profile-packages-conf                                       Get profile packages configuration from reposerver
    --get-profile-repos                                               Get profile repositories from reposerver
    
    Sending data to reposerver
    
    --send-general-info                                               Send host's general informations (OS, version, kernel..) to the reposerver
    --send-packages-info                                              Send this host's packages informations to the reposerver (available package updates, installed packages)
    --send-all-info                                                   Send all of the previous informations to the reposerver
    --agent-enable [true|false]                                       Enable reposerver module agent. This agent will regularly send informations about this host to reposerver (global informations, packages informations...)
    --agent-listen-enable [true|false]                                Enable or disable agent listening for requests coming from the reposerver

 Usage: linupdate --mod-configure reposerver [OPTIONS]

Startup

Follow the steps below to configure the reposerver module and register a host to Repomanager.

You can also check the Quick setup example at the end of this page.

Enable reposerver module

linupdate --mod-enable reposerver

Configure target reposerver URL

Linupdate 2.x

Configure target reposerver URL and fail-level.

linupdate --mod-configure reposerver --url https://REPOMANAGER_URL --fail-level 3

Notes:

  • --fail-level defines the module criticality (between 1 and 3):

    1: linupdate stops no matter the module error (disabled module, the target reposerver does not handle the same package type, minor or critical error...)

    2: linupdate stops on module critical error (continues on minor error)

    3: linupdate continues even in case of module critical error

Linupdate 3.x

Configure target reposerver URL

linupdate --mod-configure reposerver --url https://REPOMANAGER_URL

Register a host to a reposerver

You can then register the host to the reposerver and retrieve an authentication id + token (you'll need an API key from a Repomanager user):

linupdate --mod-configure reposerver --api-key <API-KEY> --register

From here, the host should become visible in the MANAGE HOSTS tab on Repomanager. You can now send host's informations to the reposerver:

Linupdate 2.x
linupdate --mod-configure reposerver --send-general-status    # send general informations 
linupdate --mod-configure reposerver --send-packages-status   # send packages informations (available updates, installed...)
linupdate --mod-configure reposerver --send-full-history      # send packages history
Linupdate 3.x
linupdate --mod-configure reposerver --send-general-info    # send general informations 
linupdate --mod-configure reposerver --send-packages-info   # send packages informations

You can enable reposerver agent to regulary send those informations. See Enable reposerver agent


Send data to the reposerver

Send general informations to the reposerver

Linupdate 2.x
linupdate --mod-configure reposerver --send-general-status
Linupdate 3.x
linupdate --mod-configure reposerver --send-general-info

Send packages informations to the reposerver

It will send all packages informations and history (installed, updated, uninstalled...)

Linupdate 2.x
linupdate --mod-configure reposerver --send-packages-status
linupdate --mod-configure reposerver --send-full-history
Linupdate 3.x
linupdate --mod-configure reposerver --send-packages-info

Send all informations to the reposerver

Same as Send general informations to the reposerver and Send packages informations to the reposerver

Linupdate 2.x
linupdate --mod-configure reposerver --send-full-status
Linupdate 3.x
linupdate --mod-configure reposerver --send-all-info

Enable / disable retrieving packages configuration from the reposerver

When enabled, linupdate will get its packages configuration (packages exclusions) from the reposerver.

Linupdate 2.x

Possible values: yes / no (default: yes)

linupdate --mod-configure reposerver --get-packages-conf-from-reposerver yes
Linupdate 3.x

Possible values: true / false (default: true)

linupdate --mod-configure reposerver --get-packages-conf-from-reposerver true

Enable / disable retrieving repos configuration from the reposerver

When enabled, linupdate will get its repos configuration from the reposerver.

Linupdate 2.x

Possible values: yes / no (default: yes)

linupdate --mod-configure reposerver --get-repos-from-reposerver yes
Linupdate 3.x

Possible values: true / false (default: true)

linupdate --mod-configure reposerver --get-repos-from-reposerver true

Agent

When enabled, the reposerver agent will regulary send informations to Repomanager, including:

  • Host's general informations (OS, version, kernel..)
  • Host's packages informations (installed, available...) and history (installation, update, uninstallation...)

Make sure that linupdate service is running :

systemctl status linupdate

Enable reposerver agent

Linupdate 2.x
linupdate --mod-configure reposerver --enable-agent
Linupdate 3.x
linupdate --mod-configure reposerver --agent-enable true

Enable / disable requests from reposerver

Repomanager can request the host to execute specific actions, including:

  • Requesting the host to update its packages.
  • Requesting the host to send its general informations.
  • Requesting the host to send its packages informations.
Linupdate 3.x

Possible values: true / false (default: true)

linupdate --mod-configure reposerver --agent-listen-enable true

Quick setup example

Here is a quick setup example to register a host to a reposerver, retrieve its configuration and send its informations.

Linupdate 2.x
# First set linupdate profile and environment to match a Repomanager profile and environment
linupdate --profile app-server
linupdate --env prod

# Enable reposerver module
linupdate --mod-enable reposerver

# Configure target reposerver URL
linupdate --mod-configure reposerver --url https://reposerver.localhost --fail-level 3

# Register the host to the reposerver (the host should be visible in Repomanager after that)
linupdate --mod-configure reposerver --api-key ak_xxxxxx --register

# Send all informations to the reposerver
linupdate --mod-configure reposerver --send-full-status

# Enable reposerver agent and restart linupdate service to apply changes
linupdate --mod-configure reposerver --enable-agent
systemctl restart linupdate

# Make sure to retrieve packages configuration and repositories from the reposerver
linupdate --mod-configure reposerver --get-packages-conf-from-reposerver yes
linupdate --mod-configure reposerver --get-repos-from-reposerver yes

# Perform packages update
linupdate
Linupdate 3.x
# First set linupdate profile and environment to match a Repomanager profile and environment
linupdate --profile app-server
linupdate --env prod

# Enable reposerver module
linupdate --mod-enable reposerver

# Configure target reposerver URL
linupdate --mod-configure reposerver --url https://reposerver.localhost

# Register the host to the reposerver (the host should be visible in Repomanager after that)
linupdate --mod-configure reposerver --api-key ak_xxxxxx --register

# Send all informations to the reposerver
linupdate --mod-configure reposerver --send-all-info

# Enable reposerver agent
linupdate --mod-configure reposerver --agent-enable true

# Make sure to retrieve packages configuration and repositories from the reposerver (default: true)
linupdate --mod-configure reposerver --get-packages-conf-from-reposerver true
linupdate --mod-configure reposerver --get-repos-from-reposerver true

# But make sure to keep existing repositories when retrieving those from the reposerver (default: true)
linupdate --mod-configure reposerver --remove-existing-repos false

# Perform packages update
linupdate
⚠️ **GitHub.com Fallback** ⚠️