mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-21 11:46:37 +00:00
138 lines
5.1 KiB
YAML
138 lines
5.1 KiB
YAML
---
|
|
# Production layout (per spinifex/scripts/setup.sh).
|
|
spinifex_etc_dir: /etc/spinifex
|
|
spinifex_data_dir: /var/lib/spinifex
|
|
spinifex_log_dir: /var/log/spinifex
|
|
spinifex_run_dir: /run/spinifex
|
|
spinifex_config_file: "{{ spinifex_etc_dir }}/spinifex.toml"
|
|
spinifex_ca_trust_path: /usr/local/share/ca-certificates/spinifex-ca.crt
|
|
spinifex_ca_src: "{{ spinifex_etc_dir }}/ca.pem"
|
|
|
|
# Legacy $HOME layout (still present on older dev boxes).
|
|
spinifex_legacy_home_dir: "{{ lookup('env','HOME') }}/spinifex"
|
|
|
|
# OVN state.
|
|
ovn_db_dir: /var/lib/ovn
|
|
ovn_nb_db: "{{ ovn_db_dir }}/ovnnb_db.db"
|
|
ovn_sb_db: "{{ ovn_db_dir }}/ovnsb_db.db"
|
|
|
|
# Region / init.
|
|
spinifex_region: ap-southeast-2
|
|
spinifex_az: "{{ spinifex_region }}a"
|
|
spinifex_node_name: node1
|
|
spinifex_node_count: 1
|
|
|
|
# External network.
|
|
# spx admin init contract (as of network-layer-redesign):
|
|
# external_mode : "pool" or "" (NAT path removed)
|
|
# external_pool : MANDATORY when mode=pool — set start/end below or pass -e.
|
|
# external_gw : auto-detected from default route when blank.
|
|
# external_prefix: auto-detected from WAN when blank.
|
|
# external_gw_ip : OVN router external-IP override (was nat_gateway_ip).
|
|
# no_external : true → emit --no-external (skip external networking).
|
|
spinifex_external_mode: pool
|
|
spinifex_external_no_external: false
|
|
spinifex_external_pool_start: ""
|
|
spinifex_external_pool_end: ""
|
|
spinifex_external_gateway: ""
|
|
spinifex_external_prefix_len: ""
|
|
spinifex_external_gateway_ip: ""
|
|
|
|
# Preflight checks.
|
|
spinifex_ports:
|
|
- { port: 4222, service: NATS }
|
|
- { port: 8443, service: Predastore }
|
|
- { port: 9999, service: "Spinifex Gateway" }
|
|
|
|
spinifex_required_commands:
|
|
- go
|
|
- make
|
|
- nbdkit
|
|
spinifex_optional_commands:
|
|
- air
|
|
spinifex_ovn_commands:
|
|
- ovs-vsctl
|
|
- ovn-controller
|
|
- ovn-nbctl
|
|
|
|
spinifex_components:
|
|
- viperblock
|
|
- predastore
|
|
|
|
# Process patterns for teardown.
|
|
# Bracket trick ([b]in/spx etc.) prevents the pattern literal from matching
|
|
# our own pgrep/shell cmdline. Exclude filter drops benign log followers and
|
|
# ansible's own wrappers that also mention these service names.
|
|
spinifex_process_pattern: "([b]in/spx|spinifex-[u]i|nats-[s]erver|[p]redastore|[v]iperblock|[v]pcd)"
|
|
spinifex_process_exclude: "(journalctl|ansible|/bin/sh|pgrep|pkill|tail -[fF])"
|
|
spinifex_qemu_processes:
|
|
- qemu-system-x86_64
|
|
- qemu-system-aarch64
|
|
|
|
# Invoking user (when run under sudo).
|
|
spinifex_invoking_user: "{{ lookup('env','SUDO_USER') | default(ansible_facts['user_id'], true) }}"
|
|
|
|
# Opt-in wipes.
|
|
spinifex_wipe_ssh_keys: false
|
|
spinifex_wipe_aws_creds: false
|
|
spinifex_wipe_legacy_home: true
|
|
|
|
# Timeouts.
|
|
teardown_process_wait_seconds: 30
|
|
|
|
# Path resolution — playbook_dir is scripts/ansible/playbooks/ at runtime.
|
|
spinifex_root: "{{ lookup('pipe', 'readlink -f ' ~ playbook_dir ~ '/../../..') }}"
|
|
mulga_root: "{{ lookup('pipe', 'readlink -f ' ~ playbook_dir ~ '/../../../..') }}"
|
|
|
|
# Wrappers around `aws` and `spx` that re-enter a shell with the
|
|
# `spinifex` supplementary group active. Needed because ansible's
|
|
# `become_user` is a no-op when target user equals current user, so
|
|
# supplementary groups are never re-initialised and /etc/spinifex/ca.pem
|
|
# (drwxr-x--- root:spinifex) is unreadable.
|
|
spinifex_aws_cli: "{{ playbook_dir }}/../scripts/aws-as-spinifex.sh"
|
|
spinifex_spx_cli: "{{ playbook_dir }}/../scripts/spx-as-spinifex.sh"
|
|
|
|
# dev-vpc fixture. Deterministic VPC + public subnet + IGW + default
|
|
# route. Idempotent: re-running detects existing resources by Name tag.
|
|
# Used by smoketest's launch path (which looks for any
|
|
# map-public-ip-on-launch=true subnet).
|
|
dev_vpc_name: spinifex-dev-vpc
|
|
dev_vpc_cidr: 10.99.0.0/16
|
|
dev_vpc_subnet_cidr: 10.99.1.0/24
|
|
dev_vpc_subnet_az: "{{ spinifex_az }}"
|
|
dev_vpc_state: present # present | absent
|
|
|
|
# Build output.
|
|
build_tarball_path: /tmp/spinifex-local.tar.gz
|
|
|
|
# Snapshot / restore. Snapshots quiesce the full spinifex+ovn+ovs stack,
|
|
# tar these paths, then restart services. Restore wipes + untars + restarts.
|
|
# Default snapshot dir is root-owned so it survives `dev-teardown`
|
|
# (teardown only removes the four spinifex_*_dir paths above).
|
|
snapshot_dir: /var/lib/spinifex-snapshots
|
|
snapshot_paths:
|
|
- "{{ spinifex_etc_dir }}"
|
|
- "{{ spinifex_data_dir }}"
|
|
- "{{ ovn_db_dir }}"
|
|
- /etc/openvswitch/conf.db
|
|
# Order matters: stop spinifex first (depends on OVN/OVS), then OVN, then OVS.
|
|
# Restart in reverse.
|
|
snapshot_services_stop_order:
|
|
- spinifex.target
|
|
- ovn-controller
|
|
- ovn-central
|
|
- openvswitch-switch
|
|
|
|
# Smoketest image — parameterised so tofu examples can share the same base.
|
|
spinifex_smoketest_distro: debian
|
|
spinifex_smoketest_version: "13"
|
|
# Local image file path (if present, imported directly; otherwise fall back to --name).
|
|
spinifex_smoketest_local_image: "~/images/{{ spinifex_smoketest_distro }}-{{ spinifex_smoketest_version }}.img"
|
|
|
|
# Multi-node cluster bootstrap (cluster-bootstrap.yml).
|
|
# cluster_env, cluster_init_host, spinifex_node_count come from inventory/tofu.py.
|
|
cluster_external_pool: "" # "<start>-<end>" or empty for DHCP fallback
|
|
cluster_join_token_path: /etc/spinifex/join-token
|
|
cluster_formation_port: 4432
|
|
cluster_formation_timeout: 60 # seconds (uri retries = value // 2)
|