blob: 3a411dfc04b3e65ba653ea8231aed72e3049c9d8 (
plain)
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
|
---
# This controls images available on the system since
# we don't allow docker_container to do its own pulls
- name: Ensure docker build dir exists
file:
path: "{{elk_root}}"
state: directory
- name: Copy docker build files
copy:
src: "{{secrets_dir}}/files/elasticsearch/docker"
dest: "{{elk_root}}/"
- name: Ensure elk Dockerfile exists
template:
src: templates/Dockerfile.j2
dest: "{{elk_root}}/docker/Dockerfile"
- name: Build ELK image
docker_image:
name: "{{docker_image_elk_local}}"
path: "{{elk_root}}/docker"
force: yes
- name: Create docker container
docker_container:
name: "{{docker_container_elasticsearch_name}}"
image: "{{docker_image_elk_local}}"
state: started
log_driver: journald
restart_policy: unless-stopped
published_ports:
- "{{docker_port_elasticsearch}}:9200"
recreate: yes
volumes:
- "{{docker_elk_vol}}/data:/usr/share/elasticsearch/data"
env:
ES_JAVA_OPTS: "-Xms4g -Xmx4g"
ES_HEAP_SIZE: "16g"
LS_HEAP_SIZE: "16g"
- name: Wait for docker to start
wait_for:
port: "{{docker_port_elasticsearch}}"
delay: 10
|