Browse Source

SYSLOG_HOSTNAME override for logspout

master
Sean Johnson 4 years ago
parent
commit
8194a1a191
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. 3
      app/logspout/defaults.yaml
  2. 7
      app/logspout/init.sls
  3. 1
      app/logspout/map.jinja

3
app/logspout/defaults.yaml

@ -8,3 +8,6 @@ container:
restart: always
mounts: []
publish: []
settings:
use_system_hostname: false

7
app/logspout/init.sls

@ -1,6 +1,6 @@
---
{% from "app/logspout/map.jinja" import container with context %}
{% from "app/logspout/map.jinja" import container, settings with context %}
logspout image:
docker_image.present:
@ -21,6 +21,11 @@ logspout container:
{{ raise("logspout:container:args is undefined") }}
{%- endif %}
- environment:
{%- if settings.use_system_hostname %}
- SYSLOG_HOSTNAME: "{{ grains['fqdn'] }}"
{%- else %}
- SYSLOG_HOSTNAME: "{{ '{{.Container.Config.Hostname}}' }}"
{%- endif %}
{%- for key, value in container.env.items() %}
- {{ key }}: {{ value | yaml_squote }}
{%- endfor %}

1
app/logspout/map.jinja

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

Loading…
Cancel
Save