mirror of
https://github.com/KevinMidboe/playbooks-retailor.git
synced 2026-01-06 01:15:45 +00:00
37 lines
792 B
YAML
37 lines
792 B
YAML
---
|
|
- name: Create a Docker network for loki
|
|
docker_network:
|
|
name: monitoring_network
|
|
state: present
|
|
|
|
- name: Pull loki Docker image
|
|
docker_image:
|
|
name: grafana/loki:latest
|
|
source: pull
|
|
|
|
- name: Create loki configuration file directory on host
|
|
file:
|
|
path: /etc/loki
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Create loki configuration file
|
|
template:
|
|
src: loki.yml.j2
|
|
dest: /etc/loki/config.yml
|
|
|
|
- name: Start loki container
|
|
docker_container:
|
|
name: loki
|
|
image: grafana/loki
|
|
state: started
|
|
restart: yes
|
|
command: -config.file=/etc/loki/config.yml
|
|
restart_policy: unless-stopped
|
|
published_ports:
|
|
- "3100:3100"
|
|
volumes:
|
|
- /etc/loki/config.yml:/etc/loki/config.yml
|
|
networks:
|
|
- name: monitoring_network
|