ansible-role-prometheus-nod.../tasks/main.yml

40 lines
820 B
YAML

- name: Install prometheus node exporter
become: yes
apt:
name: prometheus-node-exporter
state: present
- name: Start and enable node exporter
become: yes
systemd:
name: prometheus-node-exporter
state: started
enabled: yes
- name: Place reverse proxy conf
become: yes
template:
src: templates/nginx.conf.j2
dest: /etc/nginx/conf.d/{{ node_exporter_domain }}.conf
notify: Check and Reload nginx
- name: Install apache2-utils
become: yes
apt:
name: apache2-utils
state: present
- name: Setup htpasswd file
become: yes
file:
path: "/etc/nginx/.htpasswd"
owner: www-data
group: www-data
mode: 0600
state: touch
- name: Set Login credentials
become: yes
shell:
cmd: "htpasswd -b /etc/nginx/.htpasswd prometheus {{ prometheus_pass }}"