--- - name: copy '{{ resolv_conf_file}}' file become: true copy: src: '{{ resolv_conf_file }}' dest: /etc/resolv.conf owner: root group: root mode: '0644' - name: update APT database apt: update_cache: true cache_valid_time: 3600 become: true when: - ansible_os_family == 'Debian'