65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
---
|
|
- include_vars: vars/secrets.yml
|
|
|
|
- file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: 0777
|
|
with_items:
|
|
- /srv/prometheus/etc/prometheus
|
|
- /srv/prometheus/prometheus
|
|
|
|
- name: Install prometheus.yml
|
|
template:
|
|
src: templates/etc/{{ item }}
|
|
dest: /srv/prometheus/etc/prometheus/{{ item }}
|
|
mode: 644
|
|
owner: root
|
|
group: root
|
|
with_items:
|
|
- prometheus.yml
|
|
|
|
- name: Install other settings files.
|
|
copy:
|
|
src: templates/etc/{{ item }}
|
|
dest: /srv/prometheus/etc/prometheus/{{ item }}
|
|
mode: 644
|
|
owner: root
|
|
group: root
|
|
with_items:
|
|
- alerting.rules
|
|
- targets.json
|
|
|
|
- name: Install nsswitch see https://github.com/jumanjiman/docker-ssllabs-scan/blob/6d9f48c9ac4f1df3eebef3ab28e2dd44a9ba4998/scanner/etc/nsswitch.conf
|
|
copy:
|
|
src: templates/etc/nsswitch.conf
|
|
dest: /srv/prometheus/etc/nsswitch.conf
|
|
mode: 644
|
|
owner: root
|
|
group: root
|
|
|
|
- name: Install service files.
|
|
template:
|
|
src: templates/prometheus.service
|
|
dest: /etc/systemd/system/prometheus.service
|
|
mode: 644
|
|
owner: root
|
|
group: root
|
|
tags:
|
|
- service-files
|
|
|
|
- name: install service files
|
|
command: systemctl daemon-reload
|
|
|
|
- name: enable service at boot
|
|
systemd:
|
|
name: prometheus.service
|
|
enabled: yes
|
|
|
|
- name: make sure servcies are started.
|
|
systemd:
|
|
name: prometheus.service
|
|
state: restarted
|
|
tags:
|
|
- start-service
|