Comment blocks now stay within three lines and explain only the non-obvious. Long histories, include examples, and commented-out code are gone. No task, key, or value changed; the only data change is comment text inside the generated unit files.
38 lines
936 B
YAML
38 lines
936 B
YAML
---
|
|
# The image runs as UID and GID 10001, so the data directory must be owned by 10001.
|
|
|
|
- name: Pull Loki image
|
|
docker_image:
|
|
name: "{{ loki_image }}"
|
|
source: pull
|
|
force_source: yes
|
|
|
|
- name: Ensure Loki Directory exists
|
|
file:
|
|
path: "{{ loki_directory }}"
|
|
state: directory
|
|
group: "{{ loki_user }}"
|
|
owner: "{{ loki_user }}"
|
|
mode: 0755
|
|
|
|
- name: Copy the Loki conf file
|
|
template:
|
|
src: "files/loki-config.yaml"
|
|
dest: "{{ loki_directory }}/loki-config.yaml"
|
|
group: "{{ loki_user }}"
|
|
owner: "{{ loki_user }}"
|
|
mode: 0644
|
|
|
|
- name: Create Loki container
|
|
docker_container:
|
|
name: "{{ loki_container }}"
|
|
image: "{{ loki_image }}"
|
|
state: started
|
|
restart_policy: "unless-stopped"
|
|
published_ports:
|
|
- "127.0.0.1:{{ loki_port }}:3100"
|
|
volumes:
|
|
- "{{ loki_directory }}:/mnt/config"
|
|
command:
|
|
- "-config.file=/mnt/config/loki-config.yaml"
|