--- - name: Install unbound ansible.builtin.apt: name: unbound state: present update_cache: true register: apt_result retries: 3 until: apt_result is succeeded - name: Download the root file ansible.builtin.get_url: url: https://www.internic.net/domain/named.root dest: /var/unbound/etc/root.hints mode: "0444" notify: Reload unbound - name: Fetch the initial keys ansible.builtin.command: unbound-anchor - name: Deploy the configuration ansible.builtin.template: src: unbound.conf.j2 dest: /etc/unbound/unbound.conf owner: root group: root mode: 0644 notify: Reload unbound - name: Enable and start unbound ansible.builtin.systemd: name: unbound enabled: true state: started