diff --git a/handlers/main.yml b/handlers/main.yml index eb5e8ae3c04a3c1d9348c5694ec32fb98293c33e..ffd63355a82928f9c8adea7518d3a6cd78507625 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -10,25 +10,25 @@ name: lefilament/odoo:{{ instance_odoo_version }}_ml source: pull force_source: true - when: not ansible_check_mode and odoo_multilingual is defined and odoo_multilingual + when: not ansible_check_mode and instance.value.odoo_multilingual is defined and instance.value.odoo_multilingual - name: pull odoo Python3.6 image docker_image: name: lefilament/odoo:{{ instance_odoo_version }}_py3.6 source: pull force_source: true - when: not ansible_check_mode and odoo_python36 is defined and odoo_python36 + when: not ansible_check_mode and instance.value.odoo_python36 is defined and instance.value.odoo_python36 - name: pull odoo image docker_image: name: lefilament/odoo:{{ instance_odoo_version }} source: pull force_source: true - when: not ansible_check_mode and (odoo_multilingual is not defined or not odoo_multilingual) and (odoo_python36 is not defined or not odoo_python36) + when: not ansible_check_mode and (instance.value.odoo_multilingual is not defined or not instance.value.odoo_multilingual) and (instance.value.odoo_python36 is not defined or not instance.value.odoo_python36) - name: build odoo image docker_compose: - project_src: /home/docker/{{ instance_name }}/ + project_src: /home/docker/{{ instance.key }}/ build: true nocache: true recreate: always @@ -40,7 +40,7 @@ - name: start odoo container docker_compose: - project_src: /home/docker/{{ instance_name }}/ + project_src: /home/docker/{{ instance.key }}/ remove_orphans: true when: not ansible_check_mode @@ -54,6 +54,6 @@ - name: remove ssh private keys file: - path: "/home/docker/{{ instance_name }}/odoo/id_ed25519.sources" + path: "/home/docker/{{ instance.key }}/odoo/id_ed25519.sources" state: absent when: not ansible_check_mode and inventory_hostname not in groups['maintenance_contract'] diff --git a/tasks/instance.yml b/tasks/instance.yml index 8e5ca10d90eb4552bb2a189a88311aa4a051bde6..dea62629392bfe9ec4f222e768f65bcb8b7d9350 100644 --- a/tasks/instance.yml +++ b/tasks/instance.yml @@ -246,7 +246,7 @@ # Flush handlers. - name: set facts ansible.builtin.set_fact: - instance_name: "{{ item.key }}" + instance: "{{ {'key': item.key, 'value': item.value} }}" instance_odoo_version: "{{ instance_odoo_setup.odoo_version }}" cacheable: no diff --git a/tasks/main.yml b/tasks/main.yml index d64e4d0ad24a874498993a0e18d5d0d07aea1ac5..ec42316852aeb3f57377279832e5b024b4cd2c72 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -10,7 +10,7 @@ owner: root group: root mode: '0400' - notify: start odoo docker whitelists + notify: start odoo whitelists when: restrict_internet_access and whitelisted_urls is defined tags: odoo_nonprod, odoo_prod