stack-orchestrator/playbooks/biscayne-sync-tools.yml

94 lines
3.1 KiB
YAML
Raw Normal View History

---
# Sync laconic-so and agave-stack to latest on biscayne
#
# Updates both repos that laconic-so deployment commands depend on:
# - stack-orchestrator (laconic-so itself, editable install)
# - agave-stack (stack definitions, compose files, container scripts)
#
# Then regenerates the deployment config from the updated stack.
# Does NOT restart anything — just syncs code and config.
#
# Usage:
# ansible-playbook -i inventory/biscayne.yml playbooks/biscayne-sync-tools.yml
#
# # Use a feature branch
# ansible-playbook -i inventory/biscayne.yml playbooks/biscayne-sync-tools.yml \
# -e laconic_so_branch=fix/kind-mount-propagation
#
- name: Sync laconic-so and agave-stack
hosts: all
gather_facts: false
environment:
KUBECONFIG: /home/rix/.kube/config
vars:
deployment_dir: /srv/deployments/agave
stack_repo: /srv/deployments/agave-stack
stack_path: /srv/deployments/agave-stack/stack-orchestrator/stacks/agave
laconic_so: /home/rix/.local/bin/laconic-so
laconic_so_repo: /home/rix/stack-orchestrator
laconic_so_branch: fix/kind-mount-propagation
stack_branch: main
tasks:
# Git operations run as the connecting user (no become) so that
# SSH agent forwarding works. sudo drops SSH_AUTH_SOCK.
- name: Update laconic-so (editable install)
become: false
ansible.builtin.shell: |
cd {{ laconic_so_repo }}
git fetch origin {{ laconic_so_branch }}
git reset --hard origin/{{ laconic_so_branch }}
register: laconic_so_update
changed_when: true
- name: Show laconic-so version
become: false
ansible.builtin.shell:
cmd: set -o pipefail && cd {{ laconic_so_repo }} && git log --oneline -1
executable: /bin/bash
register: laconic_so_version
changed_when: false
- name: Report laconic-so
ansible.builtin.debug:
msg: "laconic-so: {{ laconic_so_version.stdout }}"
- name: Pull agave-stack repo
become: false
ansible.builtin.shell: |
cd {{ stack_repo }}
git fetch origin {{ stack_branch }}
git reset --hard origin/{{ stack_branch }}
register: stack_update
changed_when: true
- name: Show agave-stack version
become: false
ansible.builtin.shell:
cmd: set -o pipefail && cd {{ stack_repo }} && git log --oneline -1
executable: /bin/bash
register: stack_version
changed_when: false
- name: Report agave-stack
ansible.builtin.debug:
msg: "agave-stack: {{ stack_version.stdout }}"
- name: Regenerate deployment config from updated stack
ansible.builtin.command: >
{{ laconic_so }}
--stack {{ stack_path }}
deploy create
--spec-file {{ deployment_dir }}/spec.yml
--deployment-dir {{ deployment_dir }}
--update
register: regen_result
changed_when: true
- name: Report sync complete
ansible.builtin.debug:
msg: >-
Sync complete. laconic-so and agave-stack updated to
origin/{{ laconic_so_branch }}. Deployment config regenerated.
Restart or redeploy required to apply changes.