You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

42 lines
1.2 KiB

---
{% from "app/logspout/map.jinja" import container, settings with context %}
logspout image:
docker_image.present:
- name: {{ container.image }}
- tag: {{ container.tag }}
logspout container:
docker_container.running:
- require:
- docker_image: logspout image
- image: {{ container.image }}:{{ container.tag }}
- name: {{ container.name | yaml_squote }}
- detach: true
- restart_policy: {{ container.restart | yaml_squote }}
{%- if container.args %}
- command: {{ container.args | yaml_squote }}
{%- else %}
{{ 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 %}
- binds:
- /var/run/docker.sock:/var/run/docker.sock:ro
{%- for mount in container.mounts | default([]) %}
- {{ mount }}
{%- endfor %}
{%- if container.publish %}
- port_bindings:
{%- for port_bind in container.publish %}
- {{ port_bind | yaml_squote }}
{%- endfor %}
{%- endif %}