---
- name: "include task receive certbot certificate"
  include_role: 
    name: nginx-https-get-cert
  vars:
    domain: "{{item.source}}"
  loop: "{{domain_mappings}}"

- name: The domains for which a www. redirect will be implemented
  debug:
    var: domain_mappings
  when: enable_debug | bool

- name: configure nginx redirect configurations
  vars:
    item: "{{item}}"
  template: 
    src:  redirect.domain.nginx.conf.j2
    dest: "{{nginx.directories.http.servers}}{{item.source}}.conf"
  loop:   "{{domain_mappings}}"
  notify: restart nginx