Files
spinifex/scripts/ansible/roles/build/tasks/main.yml
T
Josh Siviour b7dea45ee0 feat: Ansible dev lifecycle (parallel to bash scripts) (#178)
Playbooks for preflight / teardown / install / reset covering the same
ground as dev-install.sh, dev-setup.sh, reset-dev-env.sh. Existing bash
scripts untouched — decide which to keep after parity testing.

- roles/teardown + teardown catalog README track every known state
  source; add a task + row when a leak is reported.
- roles/init gates smoketest on awsgw readiness (describe-regions poll).
- roles/smoketest is dup-tolerant, retry-wrapped, auto-terminates the
  launched instance.
- dev-install.yml skips build/install/init when a healthy environment
  is already present (4-signal health check), always runs smoketest.
- dev-reset.yml captures region/az/external-mode scalars from the
  existing spinifex.toml and replays them into init.

Plan: docs/development/improvements/ansible-dev-lifecycle.md (mulga).
Bead: mulga-siv-9.
2026-05-01 10:04:37 +10:00

49 lines
1.6 KiB
YAML

---
- name: build — spinifex (make build)
ansible.builtin.command:
cmd: make build
chdir: "{{ spinifex_root }}"
changed_when: true
- name: build — viperblock nbdkit plugin (make go_build_nbd)
ansible.builtin.command:
cmd: make go_build_nbd
chdir: "{{ mulga_root }}/viperblock"
changed_when: true
- name: build — verify build artifacts present
ansible.builtin.stat:
path: "{{ item }}"
register: build_artifacts
loop:
- "{{ spinifex_root }}/bin/spx"
- "{{ mulga_root }}/viperblock/lib/nbdkit-viperblock-plugin.so"
- name: build — assert artifacts exist
ansible.builtin.assert:
that: item.stat.exists
fail_msg: "Missing build artifact: {{ item.item }}"
loop: "{{ build_artifacts.results }}"
loop_control:
label: "{{ item.item }}"
- name: build — stage tarball contents (mirrors dev-install.sh)
ansible.builtin.shell: |
set -e
STAGING=$(mktemp -d)
trap 'rm -rf "$STAGING"' EXIT
cp "{{ spinifex_root }}/bin/spx" "$STAGING/spx"
cp "{{ mulga_root }}/viperblock/lib/nbdkit-viperblock-plugin.so" "$STAGING/"
cp "{{ spinifex_root }}/scripts/setup-ovn.sh" "$STAGING/"
mkdir -p "$STAGING/systemd"
cp "{{ spinifex_root }}/build/systemd/"* "$STAGING/systemd/"
mkdir -p "$STAGING/scripts"
cp "{{ spinifex_root }}/build/scripts/"* "$STAGING/scripts/"
cp "{{ spinifex_root }}/build/logrotate/spinifex" "$STAGING/logrotate-spinifex"
tar czf "{{ build_tarball_path }}" -C "$STAGING" .
changed_when: true
- name: build — summary
ansible.builtin.debug:
msg: "Built spx + nbdkit plugin, tarball at {{ build_tarball_path }}"