Skip to content

Install

Install Lemano on the machine you work from; nothing is installed on your servers. The install script is the quickest way. The packages, the container image, go install and a build from source are below.

Install script

The script installs lemano and lemano-ansible, the Ansible integration, from the release’s archive for your system: Linux or macOS, on amd64 or arm64. It downloads the release’s checksums.txt and refuses an archive that does not match. When cosign is installed, it first checks that checksums.txt was signed by the release workflow of that release’s tag. It needs no sudo.

curl -fsSL https://lemano.dev/install.sh | sh

Then describe a server and read it a first time: Getting started.

It installs the newest release, never a release candidate. For a given version, a release candidate included, set LEMANO_VERSION:

curl -fsSL https://lemano.dev/install.sh | LEMANO_VERSION=VERSION sh

Both programs go to ~/.local/bin ($XDG_BIN_HOME when it is set). When that folder is not on your PATH, the script adds it in your shell startup files, and says which: ~/.profile, and ~/.bashrc, ~/.bash_profile, ~/.bash_login, ~/.zshrc and ~/.config/fish/conf.d/lemano.fish when that shell is set up. Each gets one line, never twice; delete it to undo. Open a new terminal afterwards, or run the export line the script prints. To read the script before you run it, download it first:

curl -fsSL -o install.sh https://lemano.dev/install.sh
less install.sh
sh install.sh

The script is scripts/install.sh in the repository. These variables change what it does:

  • LEMANO_VERSION: the version to install, such as 0.1.0.
  • LEMANO_INSTALL_DIR: the folder to install into.
  • LEMANO_DOWNLOAD_URL: the folder holding a release’s files, for a mirror or a local copy (file:///path, which needs curl). It must hold checksums.txt, the archive and, when cosign is installed, checksums.txt.sigstore.json.
  • LEMANO_NO_MODIFY_PATH: set to any value to leave your startup files alone; the script then prints the line to add instead.

Before you start

You need a Linux or macOS machine to run Lemano from, on amd64 or arm64. To build from source you also need Go 1.27.4 or later, Git and make.

Nothing is installed on the servers Lemano reads, but each needs a login for it: see what the servers need.

Download a release

Download the archive for your platform from the releases page. It holds lemano and lemano-ansible, the Ansible integration, which lemano ansible runs and which must stay in the same folder as lemano.

Verify the download before you run it. The checksum file, which lists the archives and the packages, is signed by the release workflow, and GitHub attests the files:

# The checksum file was signed by this repository's release workflow.
cosign verify-blob \
  --bundle checksums.txt.sigstore.json \
  --certificate-identity-regexp '^https://github.com/opafra/lemano/\.github/workflows/release\.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  checksums.txt

# The archive you downloaded matches the signed checksums.
sha256sum --check --ignore-missing checksums.txt

# The file was built from this repository by GitHub Actions.
gh attestation verify lemano_VERSION_linux_amd64.tar.gz --owner opafra

Then put both programs in the same folder on your PATH:

tar -xzf lemano_VERSION_linux_amd64.tar.gz lemano lemano-ansible
sudo install -m 0755 lemano lemano-ansible /usr/local/bin/

The macOS binaries are not signed or notarized. A file fetched with curl runs as it is; one downloaded in a browser may need xattr -d com.apple.quarantine lemano lemano-ansible.

Debian, Ubuntu and RHEL packages

The release has a .deb and a .rpm for each architecture (amd64 and arm64 for .deb, x86_64 and aarch64 for .rpm). Download one, check it against the signed checksums.txt as above, then install it with the package manager, which also installs the OpenSSH client that Lemano needs:

sudo apt install ./lemano_VERSION_amd64.deb
sudo dnf install ./lemano-VERSION-1.x86_64.rpm

Both programs go to /usr/bin, with the licence and the readme under /usr/share/doc/lemano/ (/usr/share/licenses/lemano/ on RHEL). The packages are not signed themselves, and there is no apt or yum repository yet, so an upgrade is a new download.

Container image

The image ghcr.io/opafra/lemano (linux/amd64 and linux/arm64) holds lemano, lemano-ansible and the OpenSSH client. It runs as an unprivileged account, uid 10001, with its home in /home/lemano: the store is in ~/.local/share/lemano and the key file in ~/.config/lemano, so keep each in a volume. The account must be able to read what you mount, and a key file must not be readable by others. Make a folder for the container, copy into it your target files and the keys they name, keeping their relative paths, and give it to that account. Your own files stay yours; copy them again after a change.

mkdir lemano-container
cp -r targets keys lemano-container/
sudo chown -R 10001:10001 lemano-container

docker run --rm -it --read-only --tmpfs /tmp \
  -v lemano-store:/home/lemano/.local/share/lemano \
  -v lemano-key:/home/lemano/.config/lemano \
  -v "$PWD/lemano-container:/work:ro" -w /work \
  ghcr.io/opafra/lemano:vVERSION init

Run the same command with discover -f targets or any other command in place of init. The release workflow signs the image; check the signature before you run it:

cosign verify ghcr.io/opafra/lemano:vVERSION \
  --certificate-identity-regexp '^https://github.com/opafra/lemano/\.github/workflows/release\.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

The image does not hold Ansible, so the lemano ansible commands that run Ansible need it installed in an image of your own. The tag latest follows the newest release and never a release candidate.

In CI and on a schedule

The image suits places where nothing is installed for Lemano: a CI job that reads or checks servers, or a timer that runs discover from an always-on machine. Keep the store and the key file in the same volumes from one run to the next, so that each pass is compared with the last. A server that cannot be reached, or is read only in part, makes the command exit with a code other than 0 (see the exit codes), so the job fails:

docker run --rm --read-only --tmpfs /tmp \
  -v lemano-store:/home/lemano/.local/share/lemano \
  -v lemano-key:/home/lemano/.config/lemano \
  -v "$PWD/lemano-container:/work:ro" -w /work \
  ghcr.io/opafra/lemano:vVERSION discover -f targets

Scheduling shows a timer, and the daily summary what changed since the last run.

With Go

With Go 1.27.4 or later, go install puts both programs in $GOBIN (~/go/bin by default). Name both: installing lemano alone leaves out lemano-ansible.

go install github.com/opafra/lemano/cmd/lemano@latest github.com/opafra/lemano/cmd/lemano-ansible@latest

Build from source

git clone https://github.com/opafra/lemano.git
cd lemano
make build

make build writes two static binaries to bin/:

  • bin/lemano, the command itself;
  • bin/lemano-ansible, the Ansible integration, which lemano ansible runs. Keep it in the same folder as lemano.

Check the installation

$ lemano version
lemano dev
...

The first line names the version: a release prints its own, such as v0.1.0, and a build from source prints dev. The lines after it give the versions of the wire format, the identity script, the store schema and the generation format, and the Go version it was built with.

Run lemano --help for the list of commands. After a build from source, run bin/lemano from the repository folder instead.

Put a build on your PATH

Copy both binaries to the same folder on your PATH, or run them from bin/. The scheduling examples in the documentation use /usr/local/bin:

sudo install -m 0755 bin/lemano bin/lemano-ansible /usr/local/bin/

What the servers need

Lemano reaches a server with an SSH key and runs its scripts as root through sudo. On each server, as root, create the login, put your public key in its authorized_keys, and allow the one command it runs:

useradd --create-home --shell /bin/sh lemano
install -d -m 0700 -o lemano -g lemano /home/lemano/.ssh
# put your public key line in /home/lemano/.ssh/authorized_keys,
# owned by lemano, mode 0600
echo 'lemano ALL=(root) NOPASSWD: /bin/sh -s' > /etc/sudoers.d/lemano
visudo -cf /etc/sudoers.d/lemano

Without sudo, set privilege: user in the target file: Lemano then reads what an ordinary account can read and lists what only root can read as skipped. If ssh web-01 already works from your machine, name that alias as the target’s host and skip the account. The security model says why the sudoers line is safe to give, and what a sudo password changes; Getting started shows the whole sequence.

The Ansible collection

Only if you use Ansible and want every playbook run recorded, or want to check servers against your playbooks: the lemano.lemano collection holds the record callback that lemano ansible check and lemano ansible codify rely on. It asks for ansible-core 2.20 or later and is tested with 2.20, 2.21 and 2.22. Each release has its tarball, listed in the signed checksums.txt; Ansible installs it from its address:

ansible-galaxy collection install https://github.com/opafra/lemano/releases/download/vVERSION/lemano-lemano-VERSION.tar.gz

Ansible can also install it from the repository at a tag:

ansible-galaxy collection install 'git+https://github.com/opafra/lemano.git#/integrations/ansible/collection,vVERSION'

Or build it from a clone of the repository, in its folder:

ansible-galaxy collection build integrations/ansible/collection
ansible-galaxy collection install lemano-lemano-0.1.0.tar.gz

When the collection is published on Galaxy, ansible-galaxy collection install lemano.lemano installs it. Recording Ansible runs shows how to enable it in ansible.cfg. The other lemano ansible commands (import, discover, revert, export) need only lemano-ansible and Ansible itself; see Lemano and Ansible.

Supported systems

Lemano runs on Linux and is tested on Debian 12 and 13, Ubuntu 24.04 and 26.04 and Rocky Linux 9 in containers, on Debian 12 and Rocky Linux 9 virtual machines (the latter with SELinux enforcing), and is also checked by hand on real Ubuntu 24.04 and 26.04 servers. It should work on any Linux server with SSH, a POSIX shell and the usual system tools. On a server outside the Debian and Red Hat families, packages are not read: the Package kind says it is not supported there.

What runs where

Lemano runs on the machine you work from, or on an always-on machine that reaches your servers if you schedule it. Each pass opens one SSH session and sends a POSIX sh script on standard input; nothing is installed on the server. Reading a server changes nothing in its configuration; only lemano revert writes.

Next

Getting started: describe a server in a target file, create the store and its key, and read the server a first time.