Skip to content

    Tool catalogue

    Every tool a plan step can call, grouped by namespace, with its arguments and whether a dry run can predict what it would do.

    A step calls a tool by name and passes it arguments. This page lists every tool, what it does, and which of them a dry run can simulate against the host rather than merely display.

    How to read a tool#

    A tool name is namespace.verb, and it goes in a step's tool field:

    a step calling a tool
    - name: Allow HTTPS through the firewall
      tool: ufw.allow
      args:
        port: 443
        protocol: tcp

    Every tool also receives the target host implicitly, so server_name is never something you pass. Arguments listed as none take nothing beyond the target.

    The dry run column says whether the tool supports a real read-only check. A yes means a dry run contacts the host and reports would create, would change or no change. A blank means the dry run shows you the resolved command it would execute, but does not predict its effect. That distinction is explained in full under dry runs.

    Choosing a tool over a raw command#

    ssh.cmd runs any shell command, which makes it the tool that can do anything and the tool that can tell you least. Opafra cannot preview it, cannot report whether it changed anything, and cannot make it idempotent.

    Prefer a named tool where one fits. file.lineinfile will not duplicate a line it already wrote; the equivalent echo >> will, every time the plan runs. apt.install reports that a package was already present; ssh.cmd: apt-get install -y nginx reports that a command exited zero.

    Every tool#

    ToolWhat it doesArgumentsDry run
    apt.installInstall packages via apt-get (non-interactive)packagesyes
    apt.update_upgradeUpdate apt cache and upgrade all installed packagesnone
    archive.extractExtract a gzipped tar archive to a directoryarchive_path, dest_dir
    backup.create_tarCreate a timestamped tar.gz backup of a directorybackup_path, source_path
    backup.rotateDelete backup files older than N days from a directorybackup_dir, days
    certbot.installInstall Certbot and the nginx plugin via apt-getnone
    certbot.obtainObtain an SSL certificate for a domain using Certbot + nginxdomain, email
    certbot.renewRenew all Certbot certificates quietlynone
    cron.addAdd a cron entry (idempotent - will not duplicate an identical line)schedule, commandyes
    cron.listList all cron jobs in the current crontabnone
    disk.usageShow disk usage for a given pathpath
    disk.cleanupDelete files older than N days under a pathpath, days
    docker.runRun a Docker container in detached modeargs, image
    docker.compose_upStart services defined in a Docker Compose filecompose_path
    docker.compose_downStop and remove services defined in a Docker Compose filecompose_path
    file.templateWrite text content directly to a file on the remote serverremote_path, content
    file.lineinfileEnsure a line is present in or absent from a config file (idempotent, like Ansible lineinfile)path, regexp, line, stateyes
    file.backupCopy a remote file to a backup pathremote_path, backup_pathyes
    git.cloneClone a git repository to a destination pathrepo, dest
    git.pullPull latest changes in an existing git repositoryrepo_path
    helm.upgradeInstall or upgrade a Helm release with retry on lock conflictsrelease, chart, helm_args
    helm.statusShow the status of a Helm releasenamespace, release
    helm.installInstall a Helm chart from a repositorychart_name, chart_repo, helm_args
    kube.applyApply a Kubernetes manifest to a namespacemanifest, namespace
    kube.wait_rolloutWait for a Kubernetes rollout to completekind, name, namespace, timeout
    log.tailShow the last N lines of a log filelines, log_path
    logs.grepSearch a log file for a pattern and return last N matchespattern, log_file, lines
    monitoring.disk_alertAlert if any filesystem is above a usage thresholdthreshold
    monitoring.cpu_loadShow 1/5/15 minute CPU load averagesnone
    monitoring.swap_usageShow current swap memory usage as a percentagenone
    monitoring.memory_checkShow current RAM usage as a percentagenone
    mysql.dumpDump a MySQL database to a SQL file using mysqldumphost, user, password, database, output_file
    network.pingPing a host N times and report packet losscount, host
    network.port_checkCheck if a TCP port is open on a remote hosthost, port
    network.curl_healthMake an HTTP health-check request and return status codeurl
    nginx.installInstall nginx via apt-getnoneyes
    nginx.configWrite an nginx configuration file to the serverconfig_content, config_path
    nginx.reloadTest nginx config and reload the servicenoneyes
    nginx.test_configTest the nginx configuration syntax (read-only; falls back to sudo if the config is unreadable)none
    nodejs.installInstall a specific Node.js version from NodeSourceversion
    nodejs.install_pm2Install PM2 globally and configure it to start on bootnone
    npm.installInstall an npm package inside an application directoryapp_path, package
    pm2.startStart a Node.js application with PM2 and save the process listapp_path, entry_file, app_name
    pm2.restartRestart a PM2-managed applicationapp_name
    pm2.logsShow recent PM2 logs for an applicationapp_name, lines
    postgres.dumpDump a PostgreSQL database to a SQL file using pg_dumppassword, host, user, database, output_file
    process.listList running processes matching a patternpattern
    rsync.syncSync files between two paths using rsyncsource, destination
    security.disable_root_sshDisable root SSH login (matches commented, prohibit-password and spaced variants)none
    service.healthCheck whether a systemd service is activeservice
    ssh.cmdRun any shell command on the target server over SSHcommand
    ssh.pingCheck SSH reachability of the target servernone
    ssh.script.fileUpload and execute a script file on the target serverscript_name, script_args, cleanup
    ssl.check_expiryCheck SSL certificate expiry dates for a domaindomain
    system.uptimeShow how long the server has been runningnone
    systemd.statusShow the status of a systemd serviceservice
    systemd.startStart a systemd serviceserviceyes
    systemd.restartRestart a systemd serviceserviceyes
    systemd.enableEnable a systemd service to start on bootserviceyes
    template.deployDeploy a config template to a target server pathtemplate_id, template_name, target_path, variables, environment_scope, owner, mode, backupyes
    template.verifyVerify a deployed config template matches the expected hashtarget_path, deployment_id
    ufw.enableEnable the UFW firewallnoneyes
    ufw.allowAllow a port/protocol through UFWport, protocolyes
    ufw.statusShow UFW firewall rules and statusnone
    user.createCreate a new Linux user with a home directoryusernameyes
    user.existsCheck whether a Linux user account existsusername
    user.deleteDelete a Linux user accountuserdel_flags, usernameyes
    user.set_shellChange the default shell for a Linux usershell, username
    user.ensure_groupCreate a Linux group if it does not already existgroup
    user.add_to_groupAdd a Linux user to a supplementary groupusername, group
    user.set_groupsSet the full list of supplementary groups for a Linux usergroups, username
    user.set_passwordSet the password for a Linux user accountusername, password
    user.add_ssh_keyAdd an SSH public key to a user's authorized_keysusername, ssh_key
    yum.installInstall packages via yum (RPM-based systems)packagesyes

    Namespaces at a glance#

    NamespaceToolsCovers
    apt, yum, npm4Package installation
    archive, backup, rsync4Files moved, packed and rotated
    certbot, ssl4Certificates and expiry
    cron2Scheduled entries on the host
    disk, system, process, monitoring8Reading host state: usage, load, memory, processes
    docker, helm, kube8Containers and clusters
    file, template5Config files, written and verified
    git2Repositories on the host
    log, logs2Reading and searching logs
    mysql, postgres2Database dumps
    network3Reachability and health checks
    nginx4Install, configure, test, reload
    nodejs, pm25Node runtimes and process management
    security, ufw4Hardening and firewall rules
    service, systemd5Service state
    ssh3Raw commands and uploaded scripts
    user9Accounts, groups, shells and keys

    Arguments and variables#

    Any argument can be a literal or a {{ vars.x }} reference resolved at run time from plan variables, environment variables, or values supplied when the run starts.

    the same step, parameterised
    - name: Allow the app port
      tool: ufw.allow
      args:
        port: "{{ vars.app_port }}"
        protocol: tcp

    A variable that stays unresolved is empty at run time, which is rarely what was meant. A dry run lists every unresolved variable it found, which is the cheapest place to catch it.

    Arguments naming a credential should be a secret:// reference rather than a literal. References are resolved on the host at the moment of use and are redacted everywhere a command is displayed or logged.

    Next steps#

    • Dry runs for what the dry run column actually means
    • Core concepts for how steps, tools and plans fit together