00_core.ymlยถ

---
- include_tasks: utils/once/flag.yml

- name: "๐Ÿ”Œ Stage the MCP adapter instance for {{ application_id }}"
  ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/svc-ai-mcp-adapter/tasks/instance.yml') }}"
  vars:
    mcp_adapter_instance_dir: "{{ LIBRETRANSLATE_MCP_INSTANCE_DIR }}"
  when: LIBRETRANSLATE_MCP_ENABLED | bool
- name: "๐Ÿงฉ load docker, db and proxy for {{ application_id }}"
  include_role:
    name: sys-stk-full

- name: "๐Ÿ“ฆ Stage the model prefetch of {{ application_id }}"
  stack_host_copy:
    src: python/prefetch_models.py
    dest: "{{ [lookup('container', application_id, 'directories.instance'), 'prefetch_models.py'] | path_join }}"
    mode: "0644"
  notify:
    - compose-build
    - compose-up

- name: "๐Ÿ” Stage the package-cache CA into the build context of {{ application_id }}"
  stack_host_copy:
    content: "{{ lookup('file', LIBRETRANSLATE_CACHE_CA_FILE) if LIBRETRANSLATE_CACHE_CA_FILE is file else '' }}"
    dest: "{{ [lookup('container', application_id, 'directories.instance'), 'package-frontend-ca.crt'] | path_join }}"
    mode: "0644"
  notify:
    - compose-build
    - compose-up

- name: "๐Ÿ” Stage the package-cache CA installer of {{ application_id }}"
  stack_host_copy:
    src: "{{ lookup('path_absolute', LIBRETRANSLATE_CACHE_CA_INSTALLER) }}"
    dest: "{{ [lookup('container', application_id, 'directories.instance'), 'package-frontend-ca.sh'] | path_join }}"
    mode: "0755"
  notify:
    - compose-build
    - compose-up

- name: "๐Ÿงฑ Rebuild the MCP adapter of {{ application_id }}"
  ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/svc-ai-mcp-adapter/tasks/rebuild.yml') }}"
  when: LIBRETRANSLATE_MCP_ENABLED | bool

- name: "๐Ÿšฟ Flush compose handlers for {{ application_id }}"
  ansible.builtin.meta: flush_handlers

- name: "๐ŸŽฎ Verify the GPU reached {{ application_id }}"
  ansible.builtin.include_tasks: utils/assert_gpu.yml
  when:
    - IS_STACK_HOST | bool
    - LIBRETRANSLATE_GPU | bool