first commit
This commit is contained in:
@@ -16,16 +16,26 @@
|
||||
name: "{{ container_name }}"
|
||||
state: absent
|
||||
|
||||
- name: Scarica immagine ML app
|
||||
community.docker.docker_image:
|
||||
name: "{{ container_image }}"
|
||||
tag: "{{ image_tag }}"
|
||||
source: pull
|
||||
- name: Scarica immagine ML app (platform-aware)
|
||||
block:
|
||||
- name: Pull immagine Docker da registry
|
||||
ansible.builtin.command: >-
|
||||
docker pull{% if image_platform | default('') | length > 0 %} --platform {{ image_platform }}{% endif %} {{ container_image_ref }}
|
||||
register: image_pull
|
||||
changed_when: image_pull.rc == 0
|
||||
|
||||
rescue:
|
||||
- name: Errore pull immagine con suggerimenti
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Pull fallito per {{ container_image_ref }} su platform {{ image_platform | default('default') }}.
|
||||
Verifica che il registry pubblichi un manifest compatibile con l'architettura host
|
||||
(esempio linux/amd64) oppure ricostruisci l'immagine come multi-arch.
|
||||
|
||||
- name: Avvia container ML app
|
||||
community.docker.docker_container:
|
||||
name: "{{ container_name }}"
|
||||
image: "{{ container_image }}:{{ image_tag }}"
|
||||
image: "{{ container_image_ref }}"
|
||||
state: started
|
||||
restart_policy: unless-stopped
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user