Keeping Linux machines in a known state requires a configuration management system. Reemote approaches that problem as a Python library: your inventory, deployment logic, and integrations are ordinary Python code, while Reemote supplies the facts, idempotent operations, and execution model that turn that code into changes on remote machines.
If you already know Python, the learning curve is short. Loops, conditions, functions, classes, and third-party packages are all available without translating your intent into a separate configuration language. Under the hood, Reemote renders Python operations as shell commands and transfers them over SSH. The target needs a POSIX-compatible shell, but it does not need Python or a Reemote agent.
Reemote is a younger project than the established configuration management systems, so its built-in module collection and surrounding ecosystem are smaller. That is the trade-off for a compact, Python-native design. When an operation is missing, the answer is often a small Python function rather than a new plugin system.
The examples below progress from a disposable container to a reusable inventory, a multi-step application deployment, and a GitOps workflow. They use Python 3.13 or newer and run on Reemote 0.1.4 as well as current source.
Installing Reemote
Reemote is a Python package, so install it with pip or the more modern uv package manager. A virtual environment keeps the project dependencies separate from other Python work:
python3 -m venv .venv
. .venv/bin/activate
python -m pip install reemote
With uv, the equivalent setup is:
uv venv
. .venv/bin/activate
uv pip install reemote
Confirm that the package imports and shows its version:
python -c 'import reemote; from importlib.metadata import version; print(version("reemote"))'
The examples assume that the commands run from the directory containing your inventory and deploy files.
A Docker Base Example
The quickest way to see Reemote work is to target a local container. The Docker connector accepts either an existing container or an image name. When given an image, it creates a throwaway container for each run, so the example can install a file without leaving a changed container behind.
Save the following as hello.py:
# hello.py
import asyncio
from reemote import files, format_log, format_plan, op, run
INVENTORY = [{
"host": "demo",
"family": "Alpine",
"connection": {
"connector": "docker",
"identifier": "alpine:3.20",
"docker_cmd": "podman",
},
}]
def deploy(host):
yield op(files.install,
name="Write a greeting",
content="Hello from reemote!\n",
dest="/tmp/reemote-hello.txt",
mode="0644")
async def main():
plans, _, _ = await run(INVENTORY, deploy, dry=True)
print("== Dry run ==")
print(format_plan(plans))
_, report, _ = await run(INVENTORY, deploy)
print("\n== Apply ==")
assert report is not None
print(format_log(report))
asyncio.run(main())
Replace podman with docker if that is the container runtime you use. Run the script with:
python hello.py
The output has two parts:
== Dry run ==
demo: Write a greeting [changed: content /tmp/reemote-hello.txt is absent, will install]
== Apply ==
demo: Write a greeting [changed: content /tmp/reemote-hello.txt is absent, will install]
$ scp <files install> -> /tmp/reemote-install-2e52d4f8373a608a/content
$ sh -c 'mkdir -p /tmp && cp /tmp/reemote-install-2e52d4f8373a608a/content /tmp/reemote-hello.txt && chmod 644 /tmp/reemote-hello.txt && rm -rf /tmp/reemote-install-2e52d4f8373a608a'
The files.install operation first transfers the content to a temporary spool file, then installs it with an elevated shell command when necessary. This spool-and-install pattern lets Reemote write root-owned files without embedding arbitrary file content directly in a privileged shell command.
The container example also illustrates an important connector detail: an image-based Docker host owns its container. Closing it commits the result to a new image and removes the container. Separate dry-run and apply calls therefore both begin from the original image rather than from the state left by the preceding call.
Inventory, Operations, and Facts
The container inventory introduces the three central Reemote concepts: inventory, operations, and facts.
An inventory is a Python list of dictionaries. Each dictionary describes one host, including its name, operating-system family, connection settings, and optional metadata. The family value is one of Ubuntu, RedHat, or Alpine; it lets deployment code choose the appropriate package manager without first discovering the distribution.
Reemote separates immediate actions from state operations. An action executes a command now, such as uname -r. A state operation describes the desired state and is idempotent: it compares that state with the current state and changes something only when the two differ.
Facts are read-only observations of a host. Operations use facts to decide whether a command is necessary. For example, a package operation reads the installed-package state and requests an installation only when the package is absent.
The distinction is practical. A shell command is appropriate for a one-off query or an intentionally non-idempotent action. A state operation is usually the better choice for configuration because a second run converges to the same result without repeating work that is already complete.
Running Commands in Python
The hello.py script used a state operation. For an immediate command, Reemote provides actions such as Shell. The gather_action helper runs an action concurrently across a list of hosts and returns a dictionary keyed by host name.
The following script assumes an inventory named INVENTORY, which the "Creating an Inventory File" section below shows how to create. It also assumes that journalctl is installed on every selected host:
# commands.py
import asyncio
from reemote import Host, Shell, gather_action
from inventory import INVENTORY
hosts = [Host.from_inventory(entry) for entry in INVENTORY]
async def main():
for command in ("uname -r", "uptime", "journalctl --no-pager -n 1"):
results = await gather_action(hosts, Shell, command=command)
print(f"$ {command}")
for name, result in results.items():
print(f"{name}: {result['stdout'].strip()}")
asyncio.run(main())
Each Shell result contains exit_status, stdout, and stderr. A non-zero command exit is data returned to the caller; connection, timeout, and privilege failures are reported as typed exceptions.
gather_action closes the host connections it used when the call returns. The same Host objects can be reused for later calls; each call opens and closes a fresh connection.
On a systemd host with journalctl installed, a command such as journalctl --follow works too, but it never finishes under normal circumstances, so the call waits until you interrupt it or the command exits. Reemote captures the result rather than maintaining an interactive terminal session.
Rebooting and Checking Uptime
The same action API can reboot a host and then wait for it to return. A reboot normally drops the SSH connection before the command can return a clean result, so the script treats that specific connection loss as expected. It records the boot ID beforehand, then polls until the machine has a new boot ID and reports its uptime. Checking the boot ID avoids a race in which SSH briefly accepts a connection while the old system is still shutting down.
# reboot.py
import asyncio
from reemote import (
Host, HostConnectionError, Shell, WaitForConnection, gather_action,
)
from inventory import INVENTORY
async def main():
hosts = [Host.from_inventory(entry) for entry in INVENTORY]
before = await gather_action(
hosts, Shell, command="cat /proc/sys/kernel/random/boot_id",
)
old_boot_ids = {
name: result["stdout"].strip()
for name, result in before.items()
}
try:
await gather_action(hosts, Shell, command="reboot", sudo=True)
except HostConnectionError as exc:
# A successful reboot can tear down SSH connections mid-command.
print(f"Reboot disconnected a host: {exc}")
hosts = [Host.from_inventory(entry) for entry in INVENTORY]
await gather_action(hosts, WaitForConnection, timeout=300, retry=5)
async with asyncio.timeout(300):
while True:
try:
result = await gather_action(
hosts,
Shell,
command="cat /proc/sys/kernel/random/boot_id && uptime",
)
except HostConnectionError:
# SSH can disappear again while the old systems shut down.
await asyncio.sleep(5)
continue
lines = {
name: output["stdout"].strip().splitlines()
for name, output in result.items()
}
if all(lines[name][0] != old_boot_ids[name] for name in old_boot_ids):
for name, output in lines.items():
print(f"{name}: {output[1]}")
return
await asyncio.sleep(5)
asyncio.run(main())
The WaitForConnection action polls until the host is reachable or the timeout expires. The boot-ID loop then waits for every host to complete its reboot, and each final uptime reports the time since that host's new boot.
The reboot and package examples use sudo=True; the connecting user must therefore have passwordless sudo, or sudo credentials must be supplied through the inventory's privilege mapping.
Installing Packages Idempotently
A package installation is a better fit for a state operation than a shell command. The apt.packages operation reads the installed-package facts, installs only missing packages, and reports no change when the desired set is already present.
# packages.py
import asyncio
from reemote import apt, format_log, op, run
from inventory import INVENTORY
def deploy(host):
yield op(apt.packages,
name="Install tmux and vim",
packages=("tmux", "vim"),
sudo=True)
async def main():
for attempt in (1, 2):
_, report, _ = await run(INVENTORY, deploy)
print(f"== Run {attempt} ==")
assert report is not None
print(format_log(report))
asyncio.run(main())
On an Ubuntu or Debian host, the first run installs any missing packages. The second run ends with:
== Run 2 ==
demo: Install tmux and vim [no change: all packages present]
Reemote also provides package operations for DNF and APK. A family-aware deploy can choose the operation from static inventory data. The small host_family helper works with published Reemote 0.1.4, which preserves family in host.extra, and with current source, which exposes host.family:
from reemote import apt, apk, dnf, op
def host_family(host):
return getattr(host, "family", None) or host.extra["family"]
def install_packages(host):
installer = {
"Ubuntu": apt.packages,
"RedHat": dnf.packages,
"Alpine": apk.packages,
}[host_family(host)]
yield op(installer,
name="Install tmux and vim",
packages=("tmux", "vim"),
sudo=True)
This branch is safe because the family value is fixed for both execution phases. It does not depend on a fact that could change while the deploy is running.
Getting Facts from Your Servers
The package operation already used facts internally, but you can gather the same read-only information directly. Suppose you want to compare the installed Vim version and kernel release across several Ubuntu machines. Materialize the inventory and call gather_fact for each fact:
# facts.py
import asyncio
from reemote import Host, apt, gather_fact, server
from inventory import INVENTORY
async def main():
hosts = [Host.from_inventory(entry) for entry in INVENTORY]
try:
vim = await gather_fact(hosts, apt.DebPackage, "vim")
kernels = await gather_fact(hosts, server.KernelVersion)
distributions = await gather_fact(hosts, server.LinuxName)
finally:
await asyncio.gather(*(host.aclose() for host in hosts))
for name in vim:
package = vim[name]
version = package["version"] if package else "not installed"
print(f"{name}: {distributions[name]}, kernel {kernels[name]}, "
f"vim {version}")
asyncio.run(main())
gather_fact returns one value per host and runs the reads concurrently. Unlike gather_action, it does not close the connections it opens, so the script closes them in a finally block.
Reemote does not currently provide a distribution-neutral RebootRequired fact. On Ubuntu and Debian, the conventional /var/run/reboot-required marker can be queried with a Shell action instead:
results = await gather_action(
hosts,
Shell,
command="if [ -f /var/run/reboot-required ]; then echo yes; else echo no; fi",
)
Treat that marker as an operating-system-specific convention, not as a portable fact. The module documentation lists the facts that are available for each subsystem.
Creating an Inventory File
The Docker example kept its inventory inline. For a real fleet, a separate inventory.py makes the targets and their metadata easier to reuse. The file is ordinary Python, so groups can be lists that are combined into the final inventory.
# inventory.py
SSH = {
"username": "your-user",
"key_path": "~/.ssh/id_ed25519",
}
def host(name, group):
return {
"host": name,
"family": "Ubuntu",
"connection": dict(SSH, address=name),
"group": group,
"tags": [group],
}
SERVERS = [
host("podpile.home", "servers"),
host("microos.home", "servers"),
host("code.example.com", "servers"),
]
WORKSTATIONS = [
host("nov.home", "workstations"),
host("tux.home", "workstations"),
]
INVENTORY = SERVERS + WORKSTATIONS
Every entry in these inventories supplies host, family, and connection; current Reemote requires all three. The group and tags fields are optional classifiers that deployment code can inspect. Additional keys are preserved in host.extra, which provides a simple place for host-specific data.
To restrict a deployment to one group, pass only that group's list to run, or attach a when predicate to each request. A predicate must remain stable across the prepare and apply phases, so define it at module level:
def is_server(host):
return host.group == "servers"
def deploy(host):
yield op(apt.packages,
name="Install tmux and vim",
packages=("tmux", "vim"),
sudo=True,
when=is_server)
The when guard keeps the request in every host's schedule but skips it on ineligible hosts. That uniform schedule lets Reemote compare hosts in lockstep without losing determinism.
Creating a Deploy
A deploy is a synchronous generator that yields operation requests through op(). Put the package deployment in deploy.py:
# deploy.py
import asyncio
from reemote import apt, format_log, format_plan, op, run
from inventory import INVENTORY
def deploy(host):
yield op(apt.packages,
name="Install packages",
packages=("tmux", "vim"),
sudo=True)
async def main():
plans, _, _ = await run(INVENTORY, deploy, dry=True)
print(format_plan(plans))
_, report, _ = await run(INVENTORY, deploy)
assert report is not None
print(format_log(report))
asyncio.run(main())
The dry run reads the current state for real and plans the work without applying changes. The normal run performs the same preparation, checks that the request sequence is unchanged, and then applies the plan. This gives you a reviewable preview without maintaining a second description of the deployment.
Use tuples rather than lists for operation arguments such as packages. Requests must be hashable and comparable by value so that Reemote can verify that both phases describe the same work.
Using Host Data
A single package list is rarely ideal for every machine. Reemote preserves additional inventory keys in host.extra, so the inventory can carry a package list for each host and the deploy can remain generic.
# inventory.py
SSH = {
"username": "your-user",
"key_path": "~/.ssh/id_ed25519",
}
def host(name, group, packages):
return {
"host": name,
"family": "Ubuntu",
"connection": dict(SSH, address=name),
"group": group,
"tags": [group],
"packages": tuple(packages),
}
SERVERS = [
host("podpile.home", "servers", ("tmux", "vim")),
host("microos.home", "servers", ("tmux",)),
host("code.example.com", "servers", ("tmux", "vim")),
]
WORKSTATIONS = [
host("nov.home", "workstations", ("git", "tmux", "vim")),
host("tux.home", "workstations", ("git",)),
]
INVENTORY = SERVERS + WORKSTATIONS
The deploy now reads the list from the host instead of embedding it in the operation:
def deploy(host):
yield op(apt.packages,
name="Install host packages",
packages=host.extra["packages"],
sudo=True)
The inventory remains data, while the deploy remains reusable. Because the package tuple is fixed before the run starts, both execution phases see the same value.
Using Group Data
Host data is flexible, but repeating the same package list for every member of a group defeats the purpose of grouping. A small inventory helper can provide group defaults and allow individual hosts to override them.
# inventory.py
SSH = {
"username": "your-user",
"key_path": "~/.ssh/id_ed25519",
}
GROUP_PACKAGES = {
"servers": ("tmux", "vim"),
"workstations": ("git", "tmux", "vim"),
}
def host(name, group, packages=None, **extra):
data = dict(extra)
data["packages"] = tuple(packages) if packages is not None else GROUP_PACKAGES[group]
return {
"host": name,
"family": "Ubuntu",
"connection": dict(SSH, address=name),
"group": group,
"tags": [group],
**data,
}
SERVERS = [
host("podpile.home", "servers"),
host("microos.home", "servers", packages=("tmux",)),
host("code.example.com", "servers"),
]
WORKSTATIONS = [
host("nov.home", "workstations"),
host("tux.home", "workstations", packages=("git",)),
]
INVENTORY = SERVERS + WORKSTATIONS
The precedence rule is explicit: a host-level packages argument wins; otherwise the group default applies. The same pattern works for welcome messages, service ports, or any other static configuration value.
This is ordinary Python rather than a special inheritance language. You can compute defaults, validate them, or load them from another source, and the final inventory still consists of plain dictionaries.
Installing Caddy in a Task
The package deploys are intentionally small. A real application usually combines several operations: install a package, write a configuration file, and restart a service when the configuration changes. Caddy makes a compact example because its configuration can be a short text file.
Reemote deliberately has no files.template operation. A template context is naturally a dictionary, but operation arguments must be hashable so the prepare and apply phases can be compared. More importantly, a deploy cannot read a live fact and render differently in each phase without violating determinism.
The recommended shape is to render on the control node before the deploy and pass the finished string to files.install. For Caddy, the renderer can use Python's json.dumps to quote the welcome message safely:
# tasks/caddy.py
import asyncio
import json
from reemote import apt, files, format_log, op, run, systemd
def render_caddyfile(message):
return f":80 {{\n respond {json.dumps(message)}\n}}\n"
def build_caddy(configs):
def deploy(host):
if host.name not in configs:
return
yield op(apt.packages,
name="Install Caddy",
packages=("caddy",),
sudo=True)
yield op(files.install,
name="Write Caddyfile",
content=configs[host.name],
dest="/etc/caddy/Caddyfile",
mode="0644",
sudo=True)
return deploy
def build_restart(changed, *, daemon_reload=False):
def restart(host):
if host.name in changed:
yield op(systemd.service,
name="Restart Caddy",
service="caddy",
restarted=True,
daemon_reload=daemon_reload,
sudo=True)
return restart
async def deploy_caddy(inventory):
configs = {
entry["host"]: render_caddyfile(entry["welcome_message"])
for entry in inventory
}
_, report, _ = await run(inventory, build_caddy(configs))
assert report is not None
print(format_log(report))
notifying = {"Install Caddy", "Write Caddyfile"}
changed = frozenset(
entry.host for entry in report.log
if entry.changed and entry.name in notifying
)
_, restart_report, _ = await run(inventory, build_restart(changed))
assert restart_report is not None
print(format_log(restart_report))
if __name__ == "__main__":
from inventory import WEBSERVERS
asyncio.run(deploy_caddy(WEBSERVERS))
The corresponding web-server inventory carries the message as static data. Add this list to inventory.py:
WEBSERVERS = [
host("playground.home", "webservers",
packages=("tmux",),
welcome_message="Hello world!"),
]
Run the task as a module from the directory containing inventory.py:
python -m tasks.caddy
The first run installs Caddy and writes /etc/caddy/Caddyfile. The code then freezes the names of hosts whose notifying operations reported a change. build_restart turns that frozen set into a second deploy, so Caddy restarts only on hosts that changed.
This two-deploy split is the key detail. A plain run() deploy cannot branch on the result of an operation it yielded earlier, because its generator runs once against pre-deployment state and again against live state. Reading the ApplyReport between two complete runs moves the decision to a point where the outcome is final and immutable.
The Caddy package must be available from the target's configured repositories. On distributions where it is not, add the vendor repository with Reemote's repository operations before requesting the package, or install a pinned binary with the file operations.
How Does It All Work?
The Caddy example uses more of Reemote's execution model than the earlier scripts, so it is worth stepping back through what run() does.
First, Reemote validates and materializes the inventory. It then executes the deploy generator in a prepare phase. Each yielded operation reads the facts it needs and emits a command descriptor only if the current state differs from the requested state. The resulting plan shows which hosts would change and why.
For a dry run, execution stops there. For a normal run, Reemote executes the generator again in the apply phase and compares the new request sequence with the prepared sequence. If the requests differ, it raises a determinism error rather than applying a plan that no longer matches the code.
Once the sequences match, Reemote applies the operations in order. At each step, eligible hosts run concurrently, and the driver waits for that step to finish before advancing to the next operation. This lockstep execution gives every host the same logical schedule while still overlapping network and command latency across the fleet.
The apply report records each host's outcome: changed, unchanged, or skipped. A non-zero command fails the run rather than being silently recorded as a successful change. At the end, Reemote closes the connections it owns and returns the plan, report, and host objects to the caller.
This model explains several design choices. Request arguments must be hashable and value-stable because they are compared between phases. when predicates must read static inventory data because both phases must make the same eligibility decision. And a decision based on an earlier operation's result belongs between runs, not in an ordinary generator branch.
Conditional Operations
Static conditions belong in when predicates. A deploy that installs a package only on Red Hat family hosts can select dnf.packages and attach a family guard; the earlier family-aware package example showed the selection half.
Conditions based on facts require one more step. Gather the fact before calling run(), freeze the result, and pass it into a deploy factory:
def build_debian_deploy(names):
eligible = frozenset(names)
def deploy(host):
if host.name not in eligible:
return
yield op(apt.packages,
name="Install Debian build tools",
packages=("build-essential",),
sudo=True)
return deploy
The eligible set is fixed before either phase starts, so the branch is deterministic. Do not call gather_fact or read mutable host state from inside an ordinary deploy generator and use the answer to choose which requests to yield.
Conditions based on change outcomes follow the Caddy pattern. If a service must restart when either of two files changes, include both request names in the notification set:
notifying = {"Write Caddyfile", "Write Caddy unit"}
changed = frozenset(
entry.host for entry in report.log
if entry.changed and entry.name in notifying
)
restart = build_restart(changed, daemon_reload=True)
A host is included if any matching entry changed. The frozen set keeps the second deploy deterministic across its own prepare and apply phases.
For more complex orchestration, keep explicit fact and change barriers in separate Python steps around run() calls. The ordinary run() path intentionally keeps caller-driven fact barriers and change-outcome branches outside the generator so its two-phase contract stays simple.
Applying GitOps with Reemote
Once the inventory, deploy modules, and configuration content live in files, they can be stored in Git as the authoritative record of the infrastructure. A change becomes a reviewable diff rather than a sequence of commands typed into a terminal.
A practical repository might contain:
inventory.py
deploy.py
tasks/
caddy.py
secrets.json
.sops.yaml
.pre-commit-config.yaml
Pre-commit hooks can check Python syntax, run the test suite, and lint the deployment code. A pull request then shows which packages, files, and services the deployment code manages, and another team member can review that intent before it reaches production.
Continuous integration can add a stronger check by running the deploy against disposable containers or test hosts. A dry run against a representative inventory catches invalid arguments and unresolved inputs without changing a real server. A normal run against a disposable target verifies convergence and can run the deployment a second time to detect unintended changes.
After a pull request is merged, a delivery workflow can install the repository, retrieve the deployment credentials, and run the deploy. This is the GitOps loop: Git holds the desired state, review protects the change, automation applies it, and the next run proves whether the target already matches.
Secrets need separate treatment. Storing encrypted secret material in the same repository preserves the reviewable workflow without committing plaintext passwords.
Using Secrets with Reemote
Reemote does not require a special secrets file format or a global configuration object. Because a deploy is Python, it can call an existing secrets manager before constructing its operations.
One option is Secrets OPerationS (SOPS) with age encryption. Create a .sops.yaml file that selects your age public key, replacing the placeholder below with the key you generated:
creation_rules:
- age: >-
age1ql3zl7d8k4m2p9w6y5x4c3v2b1n0m9a8s7d6f5g4h3j2k
Create an encrypted JSON file with:
sops edit secrets.json
The decrypted document can contain ordinary key-value pairs:
{
"smtp_user": "060ef95df2fa4683aef6ca3ecf",
"smtp_password": "c983deee174a4f6b9c97035a6d"
}
After you save and close the editor, SOPS encrypts the values in secrets.json. The encrypted file can be committed to Git; only a holder of the corresponding private key can decrypt it. Running sops edit secrets.json again opens the decrypted content and re-encrypts it when saved.
A small Python module can decrypt that file at startup and expose the values to the deploy:
# app_secrets.py
import json
import subprocess
DECRYPTED = subprocess.run(
["sops", "--decrypt", "--output-type", "json", "secrets.json"],
check=True,
capture_output=True,
text=True,
).stdout
SECRETS = json.loads(DECRYPTED)
A deploy can then install an application environment file. The content remains a plain string, which is exactly what files.install expects:
# smtp.py
import asyncio
from reemote import files, format_log, op, run
from inventory import INVENTORY
from app_secrets import SECRETS
def deploy(host):
content = (
f"SMTP_USER={SECRETS['smtp_user']}\n"
f"SMTP_PASSWORD={SECRETS['smtp_password']}\n"
)
yield op(files.install,
name="Install SMTP environment",
content=content,
dest="/etc/reemote-smtp.env",
mode="0600",
sudo=True)
yield op(files.file,
name="Protect SMTP environment",
path="/etc/reemote-smtp.env",
mode="0600",
sudo=True)
async def main():
_, report, _ = await run(INVENTORY, deploy)
assert report is not None
print(format_log(report))
asyncio.run(main())
The second operation enforces the file mode even when the content is already correct. Reemote logs command descriptors rather than printing the environment file's contents, but you should still avoid logging the SECRETS mapping or the operation arguments yourself.
This integration has no privileged plugin API. SOPS handles encryption and decryption, Python handles the workflow, and Reemote receives the finished configuration through the same operation used for non-secret files.
Verified output
The example was verified with SOPS 3.13.3 and age 1.2.1 against a fresh Ubuntu 24.04 host. It passed with both current Reemote source and published Reemote 0.1.4. The encrypted file contained neither plaintext secret, and the first deployment produced:
sops-demo: Install SMTP environment [changed: content /etc/reemote-smtp.env is absent, will install]
$ scp <files install> -> /tmp/reemote-install-99f76d7123b98c88/content
$ sudo sh -c 'mkdir -p /etc && cp /tmp/reemote-install-99f76d7123b98c88/content /etc/reemote-smtp.env && chmod 600 /etc/reemote-smtp.env && rm -rf /tmp/reemote-install-99f76d7123b98c88'
sops-demo: Protect SMTP environment [no change: file /etc/reemote-smtp.env already exists]
The remote file matched the decrypted values and had mode 0600. After changing its mode to 0644, a second run left the content alone and repaired the permissions:
sops-demo: Install SMTP environment [no change: content already up to date (/etc/reemote-smtp.env)]
sops-demo: Protect SMTP environment [changed: mode 644 differs, will chmod 600]
$ sudo chmod 600 /etc/reemote-smtp.env
Neither run printed the secret values.
Conclusion
Reemote brings configuration management back to a small set of Python ideas: a list of hosts, generator functions that describe desired state, facts that observe the present state, and an execution model that compares the two. Its immediate actions cover ad-hoc commands, while its state operations make package, file, and service changes idempotent.
The Docker connector is useful for experiments and tests, SSH is the normal path to real machines, and the same inventory and deploy code can move between them. Python remains available for the parts that a configuration language often makes awkward: group defaults, control-side rendering, external secrets, and custom deployment logic.
The documentation covers the complete module vocabulary and the two-phase execution rules. For a fleet that already speaks Python, those are enough building blocks to keep the desired state readable, reviewable, and reproducible.
Top comments (0)