Added nsswitch so that /etc/hosts file will work.

This commit is contained in:
Egon Rijpkema 2018-12-21 12:51:01 +01:00
parent 3bd13d018a
commit 7fc312e523
3 changed files with 11 additions and 2 deletions

View File

@ -30,8 +30,13 @@
- alerting.rules - alerting.rules
- targets.json - targets.json
tags: - name: Install nsswitch see https://github.com/jumanjiman/docker-ssllabs-scan/blob/6d9f48c9ac4f1df3eebef3ab28e2dd44a9ba4998/scanner/etc/nsswitch.conf
- service-files copy:
src: templates/etc/nsswitch.conf
dest: /srv/prometheus/etc/nsswitch.conf
mode: 644
owner: root
group: root
- name: Install service files. - name: Install service files.
template: template:

View File

@ -0,0 +1,3 @@
# https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
# https://golang.org/pkg/net/
hosts: files dns

View File

@ -11,6 +11,7 @@ ExecStartPre=-/usr/bin/docker rm %n
ExecStart=/usr/bin/docker run --name %n \ ExecStart=/usr/bin/docker run --name %n \
--network host \ --network host \
-v /srv/prometheus/prometheus:/prometheus \ -v /srv/prometheus/prometheus:/prometheus \
-v /srv/prometheus/etc/nsswitch.conf/etc/nsswitch.conf \
-v /srv/prometheus/etc/prometheus:/etc/prometheus \ -v /srv/prometheus/etc/prometheus:/etc/prometheus \
prom/prometheus:v2.6.0 \ prom/prometheus:v2.6.0 \
--storage.tsdb.retention 365d --config.file=/etc/prometheus/prometheus.yml \ --storage.tsdb.retention 365d --config.file=/etc/prometheus/prometheus.yml \