Browse Source

Add logspout app

master
Sean Johnson 4 years ago
parent
commit
75514e00ee
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 9FA15B87469EA850
  1. 8
      app/logspout/defaults.sls
  2. 21
      app/logspout/init.sls
  3. 3
      app/logspout/map.jinja
  4. 1
      top.sls

8
app/logspout/defaults.sls

@ -0,0 +1,8 @@
---
container:
image: gliderlabs/logspout
tag: latest
name: logspout
env: {}
restart: always

21
app/logspout/init.sls

@ -0,0 +1,21 @@
---
{% from "app/logspout/map.jinja" import container with context %}
pull logspout container:
docker_image.present:
- name: {{ container.image }}
- tag: {{ container.tag }}
run logspout container:
docker_container.running:
- image: {{ container.image }}:{{ container.tag }}
- name: {{ container.name | yaml_squote }}
- detach: true
- restart_policy: {{ container.restart | yaml_squote }}
- environment:
{%- for key, value in container.env.items() %}
- {{ key }}: {{ value | yaml_squote }}
{%- endfor %}
- binds:
- /var/run/docker.sock:/var/run/docker.sock:ro

3
app/logspout/map.jinja

@ -0,0 +1,3 @@
{% import_yaml "app/logspout/defaults.yaml" as defaults %}
{% set container = salt.pillar.get("logspout:container", default=defaults["container"], merge=True) %}

1
top.sls

@ -21,6 +21,7 @@ base:
'roles:docker_host':
- match: grain
- app.docker
- app.logspout
'roles:grainsrv':
- match: grain

Loading…
Cancel
Save