---
    - name: Configure resolv.conf
      block:  
        - name: check if dmz_ip
          shell: "[ $(ifconfig -a | grep -c '{{DMZ_regex}}') -gt  0 ]"
          register: _grep
          ignore_errors: true

        - name: set DMZ pattern
          set_fact: 
            net_scope: "DMZ"
          when: _grep is succeeded

        - debug:
            msg: "{{inventory_hostname}} => net_scope = {{net_scope}}"
            verbosity: 2

        # - name: apply template resolv.conf
        #   become: true
        #   template:
        #     src: "{{net_scope}}_resolv.conf.j2"
        #     dest: /etc/resolv.conf
        #     owner: root
        #     group: root
        #     mode: u=rw,g=r,o=r
        #     backup: yes



      when: 
        - update_dns_by_ip_enabled
        