acd-deploy
Page not available in that version
The current page acd-deploy doesn't exist in version 1.6.2 of the documentation for this product.
Synopsis
acd-deploy [--dry-run]
acd-deploy init [prod|lab]
acd-deploy apply [--dry-run] [-i <inventory>] [<ansible-playbook option>...]
acd-deploy apply --attach
acd-deploy backup [--postgres] [-i <inventory>] [<ansible-playbook option>...]
acd-deploy restore --postgres [--backup <folder name>] [--roles] --yes [-i <inventory>]
acd-deploy plan [-i <inventory>]
acd-deploy -h | --help | -V | --version
Description
acd-deploy is on the installation ISO, at its root; it is not on the PATH. Run it as root on the first server in the inventory, from wherever the ISO is mounted, for example /mnt/esb3027/acd-deploy. It reaches every machine in the inventory, the first server included, over SSH. It needs nothing installed first: acd-deploy init installs what the runs need.
acd-deploy reads its configuration from /etc/acd/deploy, applies it to every machine, and installs or upgrades the cdn-platform Helm release. The first run installs; every later run re-applies the configuration and changes only what differs. Running it again is safe, including after a failed run. It is the only supported way to change what is installed.
With no command, acd-deploy opens a full-screen terminal interface that edits the same files, shows every problem next to the setting at fault, and applies the configuration behind a confirmation. It needs a terminal on its input and output. See Running acd-deploy.
The commands below never prompt and never ask for anything on their input, so they suit scripts.
When a run stops on a problem it recognizes, its message starts with a code such as [ACD-TLS-HOSTNAME]. Each code is described in Installation Troubleshooting.
Commands
init
acd-deploy init [prod|lab]
Prepares the first server. Run it once before the first apply, and again from each new ISO before an upgrade. It:
- Installs
ansible-corefrom the operating system’s repositories withdnf, unless it is already installed. - Installs the Ansible collections bundled on the ISO, every time, replacing any version already installed.
- Creates
/etc/acd/deployand every file in it that is missing: see Files. It never overwrites a file that exists. - Points
preset.yamlat the chosen preset on the ISO it runs from.
| Argument | Effect |
|---|---|
prod | Uses the production preset. A new configuration gets prod when no preset is given. |
lab | Uses the lab preset. |
| (none) | On an existing configuration, keeps the current preset and points preset.yaml at the ISO init runs from. |
acd-deploy init takes no other arguments. Run it on the first server only.
apply
acd-deploy apply [--dry-run] [-i <inventory>] [<ansible-playbook option>...]
acd-deploy apply --attach
Runs the deployment: install, reconfigure or upgrade. Every run takes a backup before it changes anything, even with the preflight checks skipped, and stops if the backup fails. The stages of a run are described in Running acd-deploy. apply refuses to start when acd-deploy init has not been run.
The run continues on the first server as a system service, acd-deploy-run, so closing the terminal or losing the SSH connection does not stop it. apply shows the run’s output as it goes and appends it to deploy.log. Only one run goes at a time: while one runs, another apply or backup refuses to start.
- Ctrl-C stops the run before its next step. A step already running on a machine finishes there.
acd-deploythen exits with status 130. --attach, alone, follows the run in progress from the start of its output, to its end, and exits with its status. Use it after a lost connection. With no run in progress it exits with status 1.
apply does not run the checks that plan and the terminal interface show. The run’s own preflight stage still checks the machines and the settings before it changes anything.
backup
acd-deploy backup [--postgres] [-i <inventory>] [<ansible-playbook option>...]
Takes a backup and changes nothing. It runs only the gather-inputs and backup stages, so it also skips the preflight checks. See Backups for what a backup holds. Like apply, it runs as the acd-deploy-run service.
With --postgres, the backup also holds a dump of every PostgreSQL database and of the database roles. acd-deploy first prints each database’s size and the free space on the backup disk, and refuses when the dumps do not fit. Neither apply nor a plain backup dumps the databases. See PostgreSQL Backup for the procedure, and the Upgrade Guide for why an upgrade needs one.
restore
acd-deploy restore --postgres [--backup <folder name>] [--roles] --yes [-i <inventory>]
Overwrites the PostgreSQL databases with the dumps of a backup taken with acd-deploy backup --postgres. The platform is unavailable while it runs, and every restored database is overwritten. It refuses without --yes, before it does anything. --postgres is required, and --dry-run is refused. See PostgreSQL Restore for the order of steps and what to do when it stops.
plan
acd-deploy plan [-i <inventory>]
Checks the configuration, each machine’s SSH login and the port 5001/tcp of each CDN Director listed in external_directors, asks a server which release the cluster runs, and prints what a run would do. It changes nothing. Its output lists:
- the task:
first install,reconfigure,upgrade <installed> -> <new>,downgrade <installed> -> <new> (not supported)orunknown; - the errors, then the warnings, then the notes, each with the setting at fault and how to fix it;
- on an upgrade, the installed and new releases, the state of the PostgreSQL backup, and what the new release does to your settings in
values.override.yaml; - the files a run would write.
plan exits with status 1 when an error would make the run fail or would block an upgrade. It cannot see a PostgreSQL dump taken earlier, so on an upgrade it always reports the databases as not backed up.
Options
| Option | Commands | Effect |
|---|---|---|
--dry-run | apply, and the terminal interface | Runs only the gather-inputs, preflight and render-values stages, against a temporary copy of the configuration, and prints the rendered Helm values. Neither the configuration folder nor any machine changes, and no backup is taken. It exits with the playbook’s status. It may come before or after apply. See Dry Runs. |
-i <inventory> | apply, backup, restore, plan | Uses this inventory file instead of /etc/acd/deploy/inventory.ini. The settings still come from /etc/acd/deploy/group_vars/all.yaml, which must exist. |
--attach | apply | Follows the run in progress. It takes no other option. |
--postgres | backup, restore | backup: also dumps the PostgreSQL databases. restore: required, restores them. |
--backup <folder name> | restore | Restores this backup, named by its folder under the backup folder, not by a path. Without it, the newest backup that holds a database dump is used. |
--roles | restore | Also applies the saved roles, which replaces the passwords of existing roles with the ones in the backup. |
--yes | restore | Confirms the restore. Without it, the command refuses. |
--skip-tags preflight | apply | Skips the preflight checks. The run still works out every setting and takes the backup. The check of each machine’s network after it is changed cannot be skipped. |
-v, -vv, -vvv | apply, backup | More detailed output, for support. |
-h, --help | all | Prints the usage and exits with status 0. |
-V, --version | none | Prints the version and exits with status 0. |
apply and backup pass every other option to ansible-playbook; restore takes only its own options and passes nothing on. These are rejected, because every run must start with gathering inputs and the backup:
| Option | Rejected with |
|---|---|
--start-at-task, or any prefix of it from --sta | apply, backup |
--skip-tags naming always | apply, backup |
-t, --tags, or any prefix of --tags from --ta | backup |
--limit | apply: the run stops with [ACD-PARTIAL-RUN], because what each machine’s firewall trusts depends on all of them |
--dry-run | init, plan, backup, restore and apply --attach |
Environment
| Variable | Effect |
|---|---|
ACD_CONFIG_DIR | The configuration folder. Default: /etc/acd/deploy. Every path on this page under /etc/acd/deploy moves with it. |
Files
Configuration
In /etc/acd/deploy, created by acd-deploy init and edited by you, by hand or in the terminal interface:
| File | Contents |
|---|---|
inventory.ini | The machines and their roles. See Inventory. |
group_vars/all.yaml | The site settings. See Site Settings. |
values.override.yaml | Your application settings. See Application Settings. |
preset.yaml | A link to the chosen preset on the ISO. Change it with acd-deploy init prod or acd-deploy init lab. |
certs/ | The TLS certificate and key. See TLS Certificates. |
maxmind/ | The MaxMind databases. See GeoIP Databases. |
README.md | A copy of the configuration reference shipped on the ISO. |
Written by a Run
In /etc/acd/deploy:
| File | Contents |
|---|---|
deploy.log | Every run’s output, newest last, each under a header with its start time in UTC |
values.yaml | The Helm values the cluster received. Generated: do not edit. See Application Settings. |
decision-record.json | What the run worked out about the cluster and each machine |
probe/<machine>.json | Everything the run read from each machine |
support-bundle-acd.tar.gz | Written only when the final health check fails |
recaps/acd-deploy-<time>.txt | Written by the terminal interface after each run: every command it ran and every file it wrote in that session. It never holds a password. |
The terminal interface keeps your unapplied changes in a draft under root’s ~/.local/state, readable only by root, until you apply or discard them.
Backups
Each run, and each acd-deploy backup, writes a folder on the first server, readable only by root: <backup_dir>/<UTC time>-<release>/, where <release> is the version on the installation ISO, such as /var/lib/acd/backups/20261019T201232Z-1.8.0/. backup_dir is a site setting and defaults to /var/lib/acd/backups. A run never deletes a backup.
| File | Contents |
|---|---|
<machine>.tar.gz | That machine’s files as they were before the run: k3s configuration, unit files and token, network connection profiles, firewall, sysctl and kernel module settings, SELinux configuration, /etc/hosts and routing table names. The first server’s archive also holds /etc/acd/deploy, except certs/, maxmind/ and deploy.log. On a running cluster, one server’s archive also holds an etcd snapshot of the cluster. |
<machine>.files.sha256 | A checksum for every file in that archive |
postgres-globals.sql | With --postgres only: the database roles and other cluster-wide objects |
postgres-<database>.dump | With --postgres only: one database, in the format pg_restore reads |
SHA256SUMS | A checksum for each archive and each dump |
manifest.yaml | The release, the machines, the run time, the etcd snapshot’s path, what took the backup (apply, backup, or manual for a playbook run by hand), and the dump files, or none |
The dumps are not encrypted. What a backup leaves out is listed in Running acd-deploy.
Exit Status
| Status | Meaning |
|---|---|
0 | The run, backup, restore or initialization finished, plan found no blocking error, or the usage or version was printed |
1 | acd-deploy refused to start: an unknown command or bad arguments, a rejected option, no configuration in /etc/acd/deploy (run acd-deploy init), ansible-core missing, a preset.yaml that points at an ISO no longer mounted there, a run already in progress, no run to attach to, not enough space for a PostgreSQL dump, or a failed acd-deploy init. For plan: an error would make the run fail or block an upgrade. |
130 | The run was stopped with Ctrl-C |
| other | The exit status of ansible-playbook: the run started and stopped on a failure. The last message names the cause, usually with an [ACD-…] code. |
Examples
Open the terminal interface:
/mnt/esb3027/acd-deploy
Prepare a new lab installation:
/mnt/esb3027/acd-deploy init lab
Check the configuration and see what a run would do:
/mnt/esb3027/acd-deploy plan
Install, or apply a changed configuration:
/mnt/esb3027/acd-deploy apply
Follow a run again after the SSH connection dropped:
/mnt/esb3027/acd-deploy apply --attach
Check a changed configuration without changing anything:
/mnt/esb3027/acd-deploy apply --dry-run
Take a backup with the PostgreSQL databases, before an upgrade:
/mnt/esb3027/acd-deploy backup --postgres
Restore the PostgreSQL databases from the newest backup that holds them:
/mnt/esb3027/acd-deploy restore --postgres --yes
See Also
- Running acd-deploy: the terminal interface, the stages of a run, backups and restoring a machine, and what to send support
- Upgrade Guide: moving to a new release
- Installation Troubleshooting: every
[ACD-…]code acd-admin: day-to-day operations once the cluster is installed