--- - name: run optional versionscheck ansible.builtin.include_tasks: versioncheck.yml when: submodules_versioncheck|bool - name: update cache become: true ansible.builtin.apt: state: "{{ unbound__state }}" update_cache: true cache_valid_time: 43200 when: ansible_pkg_mgr == "apt" - name: install unbound become: true ansible.builtin.package: name: unbound state: present - name: Copy unbound configuration snippets become: true ansible.builtin.copy: src: '{{ item }}' dest: '/etc/unbound/unbound.conf.d/' owner: root group: root mode: 'u=rw,g=r,o=r' with_fileglob: - 'files/snippets/*.conf' notify: - unbound checkconf - 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' notify: - unbound checkconf