Gardience Documentation gardience.com →
Docs / Clients

Enroll Linux machines

To manage a Linux machine, Gardience needs the Salt agent on it, pointed at the Salt master and approved. There are two ways to get there:

Supported distributions: RHEL, Oracle Linux, Rocky, Ubuntu, Debian, SUSE and Amazon Linux (every verified release is listed in the requirements and on the compatibility matrix). Both ways install Salt 3008.3 and pin it, so OS patching never upgrades the agent.

Add machines over SSH (coming from Ansible)

The quickest way to bring an existing Ansible estate across. Under Machines > Add machines, in Add machines over SSH, paste:

Gardience opens a two-hour enrollment, runs its own enrollment playbook (the same one you can download below) from its isolated playbook runner, and shows each host's result. Machines that got the agent join on their own, already accepted. Up to 500 hosts at a time.

What it never does:

Only admins can add machines this way. To keep the key on your own controller instead, use the playbook below with the Ansible you already run.

Option 1: enroll with the Ansible playbook

You need the admin role, and an Ansible control machine with plain ansible-core (no collections are needed). Gardience never sees your SSH keys or passwords.

To enroll an inventory:

  1. In the console, open Machines > Add machines.
  2. Under Bring your Ansible inventory, give the enrollment a label and choose how long it stays open (4 hours, 24 hours or 3 days).
  3. Select Create enrollment playbook. The browser downloads gardience-enroll.yml.
  4. Run it against your inventory:

    ansible-playbook -i YOUR_INVENTORY gardience-enroll.yml

    Linux hosts need sudo (Ansible become). The playbook is safe to run again: it only changes what differs.

Machines appear under Fleet as they join. Their Ansible groups appear under Machines > Groups after the next scan, which runs every 5 minutes.

The playbook holds an enrollment token that lets machines join without approval. Treat it like a password, and close the enrollment when you are done. See Enrollment tokens.

What the playbook does on a Linux host

StepDetail
Download the Salt bootstrap scriptFrom the pinned salt-bootstrap release on github.com to /tmp/bootstrap-salt.sh, checked against a pinned SHA-256 checksum.
Install the agentsh /tmp/bootstrap-salt.sh -X stable 3008.3, without starting it yet. Skipped when /usr/bin/salt-minion already exists.
Pin the versiondnf versionlock add 'salt*' on the RHEL family, or apt-mark hold salt-minion salt-common on the Debian family.
Write the agent config/etc/salt/minion.d/gardience.conf, mode 0600. See below.
Add the enrollment tokenThe line gardience_enroll: <token> in /etc/salt/grains, mode 0600.
Start the agentEnables salt-minion and starts it, or restarts it if the config or token changed.

A host counts as Windows when its ansible_connection is winrm or psrp, or its ansible_shell_type is powershell. Every other host gets the Linux steps.

Option 2: install on one machine and approve its key

To add one machine:

  1. In the console, open Machines > Add machines and copy the Linux commands. They are filled in with this server's address, the pinned Salt version and the installer checksum.
  2. Run them on the machine as a user with sudo. They:

    • download the Salt bootstrap script and stop if its SHA-256 checksum does not match,
    • install Salt 3008.3 with the master address set and the agent ID set to the short host name (hostname -s),
    • pin the agent version with dnf versionlock or apt-mark hold.
  3. Back on Machines > Add machines, find the machine under Waiting for approval and select Approve. Select Reject for a machine you do not recognize. The list refreshes every 8 seconds.

Approving and rejecting keys needs a role that can manage keys in Salt (the admin role). Other roles see "Your role cannot manage node keys." Each approval and rejection is written to the audit log.

On distributions without dnf or apt-mark, pin the Salt packages with your own package manager.

End-of-life releases (Debian 11)

Salt's bootstrap script refuses releases past their end of life, which includes Debian 11 since its long-term support ended on 31 August 2026. On those machines both enrollment ways install the same pinned agent from Salt's own package repository instead: they download Salt's repository signing key, stop if its SHA-256 checksum does not match the one built into Gardience, add the repository and install salt-minion and salt-common at the pinned version. Nothing changes on a machine where the agent is already installed. Gardience manages these machines normally; plan the operating system upgrade anyway, since the release no longer gets security fixes.

If the server uses non-default Salt ports (--salt-ports), the one-line commands do not set them. Add publish_port and master_port to the agent config before you start the agent.

Check the key before you approve it

An approved key lets that machine receive commands, so you may want to compare fingerprints first. On the machine:

sudo salt-call --local key.finger

On an all-in-one Gardience server, from the install folder:

cd /opt/gardience
sudo docker compose exec salt-master salt-key -f MACHINE_ID

The two fingerprints must match.

What the agent config contains

The enrollment playbook writes /etc/salt/minion.d/gardience.conf. With default settings it looks like this:

master: gardience.example.com
id: "web-01"
autosign_grains:
  - gardience_enroll
grains:
  gardience_groups: ["linux", "web"]
SettingMeaning
masterThe address agents use to reach the Salt master (the installer's --master-address, which defaults to --hostname).
idThe agent ID, taken from the host's name in your Ansible inventory (inventory_hostname). This is the node's name in Gardience.
autosign_grainsTells the agent to send its gardience_enroll grain when it first asks to join, so the master can accept it while the token is active.
grains: gardience_groupsThe host's Ansible groups (group_names). Gardience turns them into groups. See Groups and patch rings.

Extra settings appear in some installs:

WhenExtra settings
The server uses non-default Salt portspublish_port and master_port
The server was installed with --fleet-size over 1000recon_randomize: True, recon_default: 1000, recon_max: 60000, random_reauth_delay: 60, acceptance_wait_time_max: 60, which spread reconnects after a master restart
The server has a warm standby (--standby-address)master becomes a list of both servers, plus master_type: failover, master_alive_interval: 30, master_failback: False, master_tries: -1 and retry_dns: 10. Gardience also installs a systemd timer (gardience-agent-watchdog.timer) that restarts the agent after 4 minutes with no master, because Salt can hang for good when no master resolves at the moment of a failover

With the one-line installer, the bootstrap script writes the master address itself. When the server has a warm standby, the commands also write /etc/salt/minion.d/failover.conf with both servers and the failover settings. When --fleet-size is over 1000, they write /etc/salt/minion.d/gardience-fleet.conf with the reconnect settings.

The enrollment token grain

/etc/salt/grains holds the line gardience_enroll: <token>. Once the node is accepted, Gardience removes this grain from it at the next scan, because anyone who can read grains could otherwise see the token.

After a machine joins

When a new agent connects, Gardience pushes its Salt modules, grains and pillar to it within seconds. The node then shows on Overview > Dashboard after the next scan. To see its asset facts on Machines > Inventory, select Collect now there.

Gardience by Bouziden Management LLC.