--- - name: Copy unbound configuration snippets become: true ansible.builtin.copy: src: '{{ item }}' dest: '/etc/unbound/unbound.conf.d/' owner: root group: root mode: 'u=rwX,g=rX,o=rX' with_fileglob: - 'files/snippets/*.conf' notify: Systemctl restart unbound - name: Copy main unbound configuration become: true ansible.builtin.template: src: 'files/unbound.conf' dest: '/etc/unbound/unbound.conf' owner: root group: root mode: 'u=rw,g=r,o=r' validate: unbound-checkconf %s notify: Systemctl restart unbound