diff --git a/scripts/bootstrap/bootstrap-local.sh b/scripts/bootstrap/bootstrap-local.sh index 76d134ef2..6b024659b 100755 --- a/scripts/bootstrap/bootstrap-local.sh +++ b/scripts/bootstrap/bootstrap-local.sh @@ -408,6 +408,21 @@ phase_5_haproxy() { fi cd "$REPO_ROOT/infra/ansible" + + # Ansible collections needed by the haproxy/deploy playbooks. + # ansible.cfg sets stdout_callback=yaml which lives in + # community.general — without it, ansible-playbook errors out + # immediately ("Invalid callback for stdout specified: yaml"). + info "ensuring ansible collections (community.general / .postgresql / .rabbitmq) are installed" + for col in community.general community.postgresql community.rabbitmq; do + if ! ansible-galaxy collection list "$col" 2>/dev/null | grep -q "^$col"; then + info "installing $col" + ansible-galaxy collection install "$col" >/dev/null \ + || die "ansible-galaxy collection install $col failed (network ? ~/.ansible/ writable ?)" + fi + done + ok "collections present" + info "running ansible-playbook playbooks/haproxy.yml (5–10 min)" if ! ansible-playbook -i inventory/staging.yml playbooks/haproxy.yml \ --vault-password-file .vault-pass; then