--- - name: Install packages ansible.builtin.package: name: unbound_exporter state: installed - name: Add user to hostkey group ansible.builtin.user: name: _unboundexporter groups: hostkey append: true create_home: false notify: Restart unbound_exporter - name: Create config directory ansible.builtin.file: path: /etc/unbound_exporter state: directory mode: "0755" owner: root group: "{{ ansible_wheel }}" - name: Create web-config ansible.builtin.template: dest: /etc/unbound_exporter/web-config.yml src: web-config.yml.j2 mode: "0644" owner: root group: "{{ ansible_wheel }}" notify: Restart unbound_exporter - name: Enable service ansible.builtin.service: name: unbound_exporter state: started enabled: true