Files
brainwave/ansible/deploy.yml
T

37 lines
1.2 KiB
YAML

---
- name: Deploy Brainwave ARM to OrangePi
hosts: orangepi
gather_facts: false
# Requires: SSH user must be in the 'docker' group on the OrangePi.
# If not, set 'become: true' on the Load Docker image and Start container tasks.
vars:
deploy_dir: "/home/{{ ansible_user }}/brainwave"
tasks:
- name: Ensure deploy directory exists
ansible.builtin.file:
path: "{{ deploy_dir }}"
state: directory
mode: '0755'
- name: Copy ARM tarball
ansible.builtin.copy:
src: "{{ artifact_path }}/brainwave-arm64.tar.gz"
dest: "{{ deploy_dir }}/brainwave-arm64.tar.gz"
- name: Copy ARM docker-compose file
ansible.builtin.copy:
src: "{{ artifact_path }}/docker-compose.arm64.yml"
dest: "{{ deploy_dir }}/docker-compose.yml"
- name: Load Docker image
ansible.builtin.command: docker load -i {{ deploy_dir }}/brainwave-arm64.tar.gz
register: docker_load_result
changed_when: "'Loaded image' in docker_load_result.stdout"
- name: Start container
ansible.builtin.command: docker compose up -d
args:
chdir: "{{ deploy_dir }}"
changed_when: true