-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprometheus.sls
66 lines (56 loc) · 1.86 KB
/
prometheus.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
install_nfs_utils:
pkg.installed:
- name: nfs-utils
/etc/fstab:
file.append:
- text: |
#Mount NetApp NFS SSD storage for Tesseract Prometheus
<<mountpoint1>> /mnt/prometheus nfs noatime,nfsvers=3,actimeo=1800,rsize=8192,wsize=8192,intr,tcp
/mnt/prometheus:
mount.mounted:
- name: /mnt/prometheus
- device: <<mountpoint1>>
- fstype: nfs
- opts: "noatime,vers=3,actimeo=1800,rsize=65535,wsize=65535,intr,tcp"
- persist: 'True'
- mkmnt: 'True'
/mnt/prometheus/{{ pillar['site'] }}_prom{{ pillar['prom_instance'] }}_data:
file.directory
/opt/prometheus:
file.directory
/opt/prometheus/prometheus:
file.managed:
- source:
- salt://prometheus/prometheus-{{ pillar['prom_version'] }}.linux-amd64/prometheus
- user: root
- group: root
- mode: 755
/opt/prometheus/prom_config.yml:
file.managed:
- source:
- salt://prometheus/configs/{{ pillar['site'] }}_prom{{ pillar['prom_instance'] }}_config.yml
- user: root
- group: root
- mode: 644
prometheus_systemd_unit:
file.managed:
- name: /etc/systemd/system/prometheus.service
- contents: |
[Unit]
Description=Prometheus Time-Seris Monitoring
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target blackbox.service
[Service]
Type=simple
ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prom_config.yml --storage.tsdb.path=/mnt/prometheus/{{ pillar['site'] }}_prom{{ pillar['prom_instance'] }}_data --log.level=debug --storage.tsdb.retention=12d
[Install]
WantedBy=multi-user.target
prometheus_daemonize:
module.run:
- name: service.systemctl_reload
- onchanges:
- file: prometheus_systemd_unit
prometheus_service:
service.running:
- name: prometheus
- enable: True