Files
playbooks/affine/roles/affine-migration/tasks/main.yaml
T
2026-10-18 21:35:52 +05:30

45 lines
1.2 KiB
YAML

---
# Tasks for Sharelatex role
- name: Pull Affine migration image
docker_image:
name: "{{ migration_image }}"
source: pull
force_source: yes
- name: Ensure Affine Storage Directory exists
file:
path: "/var/lib/{{ host_directory }}/storage"
state: directory
mode: 0755
- name: Ensure Affine Config Directory exists
file:
path: "/var/lib/{{ host_directory }}/config"
state: directory
mode: 0755
- name: Ensure 'affine' Docker network exists
docker_network:
name: "{{ docker_network }}"
state: present
connected:
- "{{ postgres_container }}"
- "{{ redis_container }}"
- name: Create Affine migration container
docker_container:
name: "{{ migration_container }}"
image: "{{ migration_image }}"
state: started
restart_policy: "no"
command: "sh -c node ./scripts/self-host-predeploy.js"
env:
REDIS_SERVER_HOST: "{{ redis_container }}"
DATABASE_URL: "{{ db_url }}"
AFFINE_INDEXER_ENABLED: "false"
volumes:
- "/var/lib/{{ host_directory }}/storage:/root/.affine/storage"
- "/var/lib/{{ host_directory }}/config:/root/.affine/config"
networks:
- name: "{{ docker_network }}"