--- - name: Restore original /etc/resolv.conf from backup copy: src: "{{ samba_resolv_conf_backup_path }}" dest: /etc/resolv.conf remote_src: yes force: yes when: - samba_ad_dc_state == "absent" - ansible_virtualization_type != "docker" - samba_resolv_conf_backup_path is defined