init
This commit is contained in:
commit
883f31932e
169 changed files with 5676 additions and 0 deletions
29
scripts/provision.sh
Executable file
29
scripts/provision.sh
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
# Full first-time provisioning: set up networking, create VMs, run the
|
||||
# complete playbook, then snapshot as "provisioned" for fast iteration.
|
||||
set -eu
|
||||
. "$(dirname "$0")/env.sh"
|
||||
|
||||
echo "==> Setting up bridge network"
|
||||
mkdir -p .local/qemu
|
||||
sudo --preserve-env=QEMU_VM "$SCRIPT_DIR/vm/setup-network.sh"
|
||||
|
||||
echo "==> Creating VMs"
|
||||
"$SCRIPT_DIR/vm/create.sh"
|
||||
|
||||
echo "==> Starting VMs"
|
||||
"$SCRIPT_DIR/vm/start.sh"
|
||||
|
||||
echo "==> Running full playbook"
|
||||
ansible-playbook -i "$INVENTORY" "$PLAYBOOK" --vault-password-file "$VAULT_PASS"
|
||||
|
||||
echo "==> Setting up local WireGuard"
|
||||
sudo "$SCRIPT_DIR/local/setup-wireguard.sh"
|
||||
|
||||
echo "==> Setting up local /etc/hosts"
|
||||
sudo "$SCRIPT_DIR/local/setup-hosts.sh"
|
||||
|
||||
echo "==> Snapshotting 'provisioned'"
|
||||
"$SCRIPT_DIR/vm/snapshot.sh" provisioned
|
||||
|
||||
echo "==> Done. Iterate with: scripts/deploy.sh <service>"
|
||||
Loading…
Add table
Add a link
Reference in a new issue