--- - name: Include OS-specific variables ansible.builtin.include_vars: "{{ ansible_os_family }}.yml" - name: Install packages ansible.builtin.package: name: unbound state: installed when: ansible_os_family != "OpenBSD" - name: Create control keys ansible.builtin.command: argv: - unbound-control-setup creates: "{{ unbound_control_key }}" notify: Restart unbound - name: Copy config ansible.builtin.template: dest: "{{ unbound_conf }}" src: "unbound.conf.{{ inventory_hostname }}.j2" mode: "0644" owner: root group: "{{ ansible_wheel }}" validate: "unbound-checkconf %s" notify: Restart unbound - name: Enable service ansible.builtin.service: name: unbound state: started enabled: true