-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeploy-influxdb.yml
60 lines (57 loc) · 1.68 KB
/
deploy-influxdb.yml
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
---
- name: Deploy influxdb to monitoring server
hosts: monitoring
become: true
gather_facts: False
vars_files:
- "vars/main.yml"
- "vars/credentials.yml"
tasks:
- name: Assures directories exists
file: path="{{item}}" state=directory
with_items:
- "/etc/influxdb"
- "/var/lib/influxdb"
tags:
- influxdb
- name: Copy configurations
template: src="config/influxdb/influxdb.conf"
dest="/etc/influxdb/influxdb.conf"
owner=root
group=root
tags:
- influxdb
- name: "Pull influxdb docker image"
docker_image:
state: present
name: "influxdb:1.7.6"
tag: "1.7.6"
tags:
- influxdb
- name: "Launch InfluxDB container"
docker_container:
name: influxdb
image: "influxdb:1.7.6"
command: influxd -config /etc/influxdb/influxdb.conf
state: started
restart_policy: always
log_driver: json-file
log_opt:
max-size: 50m
max-file: "1"
volumes:
- /var/lib/influxdb:/var/lib/influxdb
- /etc/influxdb/influxdb.conf:/etc/influxdb/influxdb.conf:ro
ports:
- "8083:8083"
- "8086:8086"
env:
INFLUXDB_ADMIN_USER: "{{influx_admin_user}}"
INFLUXDB_ADMIN_PASSWORD: "{{influx_admin_password}}"
INFLUXDB_USER: "{{influx_user}}"
INFLUXDB_USER_PASSWORD: "{{influx_user_password}}"
INFLUXDB_READ_USER: "{{influx_read_user}}"
INFLUXDB_READ_USER_PASSWORD: "{{influx_read_user_password}}"
INFLUXDB_DB: "{{influx_db_name}}"
tags:
- influxdb