- name: "load variables from {{ role_path }}/vars/docker-compose.yml for whole play" include_vars: "{{ role_path }}/vars/docker-compose.yml" - name: "Set global domain based on application_id" set_fact: domain: "{{ domains[application_id] if application_id in domains else None }}" # Default case: One domain exists. Some applications like matrix don't have an default domain - name: "Set global http_port to {{ ports.localhost.http[application_id] }}" set_fact: http_port: "{{ ports.localhost.http[application_id] if application_id in ports.localhost.http else None }}" # Default case: One port exists. Some applications like matrix don't have an default port - name: "remove {{ docker_compose.directories.instance }} and all its contents" file: path: "{{ docker_compose.directories.instance }}" state: absent when: mode_reset | bool # This could lead to problems in docker-compose directories which are based on a git repository # @todo Verify that this isn't the case. E.g. in accounting - name: "Create all docker-compose directories (including parent directories)" file: path: "{{ item.value }}" state: directory mode: '0755' with_dict: "{{ docker_compose.directories }}" - name: flush docker service meta: flush_handlers when: run_once_docker_compose is not defined - name: run the docker tasks once set_fact: run_once_docker_compose: true when: run_once_docker_compose is not defined