- block:
  - name: Include dependency 'srv-proxy-7-4-core'
    include_role:
      name: srv-proxy-7-4-core
    when: run_once_srv_proxy_7_4_core is not defined
  - include_tasks: utils/run_once.yml
  when: run_once_web_app_mybb is not defined

- name: "include tasks setup-domain.yml with {{ domains | get_domain(application_id) }}"
  include_tasks: setup-domain.yml
  loop: "{{ mybb_domains + [source_domain] }}"
  loop_control:
    loop_var: domain

- name: "load docker and db for {{ application_id }}"
  include_role:
    name: cmp-db-docker

- name: "create {{docker_compose_instance_confd_directory}} and parent directories"
  file:
    path: "{{docker_compose_instance_confd_directory}}"
    state: directory
    mode: "0755"
    recurse: yes

- name: "create {{docker_compose_instance_confd_defaultconf_file}}"
  template:
    src: "default.conf.j2"
    dest: "{{docker_compose_instance_confd_defaultconf_file}}"
  notify: docker compose up

- name: add docker-compose.yml
  template:
    src: "docker-compose.yml.j2"
    dest: "{{ docker_compose.directories.instance }}docker-compose.yml"
  notify: docker compose up
