unbound_exporter: Initial version of role
This commit is contained in:
parent
d4bfc7586f
commit
ae491f8977
3 changed files with 52 additions and 0 deletions
36
roles/unbound_exporter/tasks/main.yml
Normal file
36
roles/unbound_exporter/tasks/main.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
- 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
|
Loading…
Add table
Add a link
Reference in a new issue