auberge ansible bootstrap
Bootstrap a fresh VPS: create the ansible user, harden SSH, change the SSH port, configure UFW. Run once per VPS. Alias: auberge a b.
auberge ansible bootstrap [HOST] [OPTIONS]Options
Section titled “Options”| Option | Description | Default |
|---|---|---|
--port PORT |
SSH port for initial connection | 22 |
--ip IP |
Target IP (required with --force) |
Prompt |
-f, --force |
Skip confirmation prompts (CI/CD) | false |
Without --ip, bootstrap prompts for the target IP. When the host’s configured address is an IP, the prompt offers it as the default (Enter IP address for my-vps [203.0.113.10]:) — press Enter to accept. Input is validated; an invalid IP re-prompts.
Prerequisites
Section titled “Prerequisites”auberge host add my-vps 203.0.113.10 --user ansibleauberge config set admin_user_name yournameauberge config set ssh_port 22022auberge config set admin_user_password your-password # optional, for Cockpit web loginYou also need either password access or a pre-authorized SSH key for the bootstrap user (typically root).
Examples
Section titled “Examples”auberge ansible bootstrap my-vps --ip 203.0.113.10auberge ansible bootstrap my-vps --ip 203.0.113.10 --port 22222auberge ansible bootstrap my-vps --ip 203.0.113.10 --force # non-interactiveWhat it does
Section titled “What it does”- Connect as bootstrap user (root) on port 22.
- Create
ansibleuser (passwordless sudo) and{admin_user_name}(full sudo). - Apply SSH hardening: custom port, disable root login, disable password auth.
- Validate SSH on the new port — only then enable UFW.
Troubleshooting
Section titled “Troubleshooting”- Locked out: provider firewall blocks the new port. Use the provider’s web/VNC console:
sudo ufw disable, fix SSH, re-enable. User already exists: bootstrap already ran. Useauberge ansible runfor subsequent changes.Host key verification failed: the target was rebuilt and offers a new key. Bootstrap prints both fingerprints and offers to drop the staleknown_hostsentry;--forcedrops it without asking. See SSH problems.