Skip to content
Extraits de code Groupes Projets
Valider c076f60b rédigé par Théo - Le Filament's avatar Théo - Le Filament
Parcourir les fichiers

change: inform user if image on test and prod differ

parent 607f3153
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -110,13 +110,23 @@ ...@@ -110,13 +110,23 @@
- name: Get image from another instance - name: Get image from another instance
when: item.value.image_instance | default(false) != item.key when: item.value.image_instance | default(false) != item.key
block: block:
- name: Check if instance image exists - name: Check if destination instance image exists
community.docker.docker_image_info: community.docker.docker_image_info:
name: "filament/{{ item.key }}:{{ instance_odoo_setup.odoo_version }}" name: "filament/{{ item.key }}:{{ instance_odoo_setup.odoo_version }}"
register: prod_image register: dst_image
- name: Check if source instance image exists
community.docker.docker_image_info:
name: "filament/{{ item.value.image_instance }}:{{ instance_odoo_setup.odoo_version }}"
register: src_image
- name: Copy image from {{ item.value.image_instance }} to {{ item.key }} may be needed
when: dst_image.images | length != 0 and dst_image.images[0]['Config']['Image'] != src_image.images[0]['Config']['Image']
ansible.builtin.debug:
msg: "Images differ between {{ item.value.image_instance }} to {{ item.key }}. You may need to run:\n$ ansible-playbook docker_odoo_operations_playbook.yml -l '{{ inventory_hostname }}' -t 'restart_prod_on_test_image' -e 'instance={{ item.key }}'"
- name: Copy image from image_instance if it does not exist - name: Copy image from image_instance if it does not exist
when: prod_image.images | length == 0 when: dst_image.images | length == 0
community.docker.docker_image: community.docker.docker_image:
name: "filament/{{ item.value.image_instance }}:{{ instance_odoo_setup.odoo_version }}" name: "filament/{{ item.value.image_instance }}:{{ instance_odoo_setup.odoo_version }}"
repository: "filament/{{ item.key }}:{{ instance_odoo_setup.odoo_version }}" repository: "filament/{{ item.key }}:{{ instance_odoo_setup.odoo_version }}"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter