{# Recieves https certificate and setup proxy with domain replace #}

- name: "include role receive certbot certificate"
  include_role: 
    name: nginx-https-get-cert
  vars:
    domain: "{{domains[application_id]}}"

- name: configure {{domains[application_id]}}.conf
  template: 
    src:  "roles/nginx-docker-reverse-proxy/templates/vhost/basic.conf.j2" 
    dest: "{{nginx.directories.http.servers}}{{domains[application_id]}}.conf"
  notify: restart nginx
  vars: 
    nginx_docker_reverse_proxy_extra_configuration: "sub_filter '{{source_domain}}' '{{domains[application_id]}}';"
