Deploy User Agent via Puppet

Install, configure, update and uninstall the Kabeen user agent on a Linux fleet with Puppet

Beta version. The user agent for Linux is in beta. Its installation packages cannot yet be downloaded from the platform: request them from Kabeen support (support@kabeen.io), specifying your distributions and architectures.

This article describes how to install, update and uninstall the agent on a fleet of Linux workstations with Puppet. The package, its configuration and the specifics of each desktop environment are described in User Agent on Linux (beta). The same steps with Ansible are in Deploy User Agent via Ansible.

Prerequisites

  • The .deb (Debian, Ubuntu) and .rpm (Fedora) packages provided by support, for each architecture in your fleet (x86_64, aarch64), placed in the files/ folder of a kabeen module. You can verify their signature before deploying them (see Verify a package signature).
  • The API key, the structure UUID and the team UUID (see Where to find the values). Provide the API key through Hiera, encrypted (with hiera-eyaml, for example), rather than in clear text in the code.
  • WebKitGTK 4.1 already installed on the workstations: the dpkg and rpm providers install a file without resolving its dependencies. You can also publish the packages in an internal repository and install with provider => apt or dnf.

Install and configure the agent

class kabeen (
  String $version,
  String $api_key,
  String $structure,
  String $team,
) {
  $format  = $facts['os']['family'] ? { 'Debian' => 'deb', default => 'rpm' }
  $package = "kabeen-${version}-linux-${facts['os']['hardware']}.${format}"
  $config  = "{\"ApiKey\": \"${api_key}\", \"StructureId\": \"${structure}\", \"TeamId\": \"${team}\"}\n"
 
  file { "/var/tmp/${package}":
    ensure => file,
    source => "puppet:///modules/kabeen/${package}",
  }
 
  package { 'kabeen':
    ensure   => latest,
    source   => "/var/tmp/${package}",
    provider => $facts['os']['family'] ? { 'Debian' => 'dpkg', default => 'rpm' },
    require  => File["/var/tmp/${package}"],
  }
 
  file { '/etc/kabeen':
    ensure => directory,
    owner  => 'root',
    group  => 'root',
    mode   => '0755',
  }
 
  file { '/etc/kabeen/configuration.json':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => Sensitive($config),
    require => File['/etc/kabeen'],
  }
}

With ensure => latest, Puppet compares the installed version with the version of the source file and updates the package when they differ. The version, api_key, structure and team parameters are defined through Hiera, for example one level per team. The optional keys (LogLevel, HideTrayIcon) and the per-user files are described in User Agent Configuration.

Browser extension

The package automatically installs the Kabeen extension in Chrome, Chromium, Brave, Vivaldi, Edge and Firefox, through their policy files. If you already manage /etc/firefox/policies/policies.json (with a Firefox module, for example), add the Kabeen entry to it yourself (see Browser extension). To deploy no browser policy at all, create the /etc/kabeen/no-browser-policies file before the package:

file { '/etc/kabeen/no-browser-policies':
  ensure => file,
  before => Package['kabeen'],
}

Update the agent

Add the new packages to the module, then change the version parameter in Hiera. On the next Puppet agent run, the package is updated over the old one, running Kabeen agents restart on the new version by themselves within about one minute, and the configuration in /etc/kabeen is kept.

Uninstall the agent

package { 'kabeen':
  ensure => $facts['os']['family'] ? { 'Debian' => 'purged', default => 'absent' },
}
 
file { '/etc/kabeen':
  ensure  => absent,
  force   => true,
  require => Package['kabeen'],
}

Uninstallation also removes the browser policies installed by the package. Each user's data stays in place: deleting it is described in Uninstall the agent.