5 changed files with 67 additions and 52 deletions
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
#!jinja|yaml |
||||
--- |
||||
{% from "app/oauth2_proxy/map.jinja" import config, config_file with context %} |
||||
|
||||
{{ config_file }}: |
||||
file.serialize: |
||||
- formatter: toml |
||||
- dataset: {{ config | tojson }} |
||||
- makedirs: true |
||||
- user: root |
||||
- group: root |
||||
- mode: 0640 |
@ -1,55 +1,10 @@
@@ -1,55 +1,10 @@
|
||||
--- |
||||
--- |
||||
|
||||
{% from "app/oauth2_proxy/map.jinja" import container, settings with context %} |
||||
|
||||
{% set config_file = settings.conf_dir | path_join("settings.cfg") %} |
||||
|
||||
{{ config_file }}: |
||||
file.serialize: |
||||
- formatter: toml |
||||
- dataset: {{ settings | tojson }} |
||||
- makedirs: true |
||||
- user: root |
||||
- group: root |
||||
- mode: 0640 |
||||
|
||||
oauth2-proxy image: |
||||
docker_image.present: |
||||
- name: {{ container.image }} |
||||
- tag: {{ container.tag }} |
||||
{% from "app/oauth2_proxy/map.jinja" import settings with context %} |
||||
|
||||
oauth2-proxy container: |
||||
docker_container.running: |
||||
- require: |
||||
- docker_image: oauth2-proxy image |
||||
- watch: |
||||
- file: {{ config_file }} |
||||
- image: {{ container.image }}:{{ container.tag }} |
||||
- name: oauth2-proxy |
||||
- detach: true |
||||
- privileged: false |
||||
- shm_size: {{ container.shm_size }} |
||||
- restart_policy: "{{ container.restart }}" |
||||
{%- if container.log_options %} |
||||
- log_opt: |
||||
{%- for key, value in container.log_options.items() %} |
||||
- {{ key | yaml_squote }}: {{ value | yaml_dquote }} |
||||
{%- endfor %} |
||||
{% endif %} |
||||
- labels: |
||||
- appname=oauth2-proxy |
||||
- binds: |
||||
- {{ settings.conf_dir }}:/etc/oauth2-proxy:ro |
||||
{%- for bind in container.binds %} |
||||
- {{ bind }} |
||||
{%- endfor %} |
||||
{% if container.env %} |
||||
- environment: |
||||
{%- for key, value in container.env.items() %} |
||||
- {{ key }}: {{ value | yaml_squote }} |
||||
{%- endfor %} |
||||
{% endif %} |
||||
- command: > |
||||
--config=/etc/oauth2-proxy/settings.cfg |
||||
{% if settings.args %}{% for arg in settings.args %} {{ arg }} |
||||
{% endfor %}{% endif %} |
||||
include: |
||||
- .config |
||||
{% if settings.enabled is true %} |
||||
- .service |
||||
{% endif %} |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
#!jinja|yaml |
||||
--- |
||||
{% from "app/oauth2_proxy/map.jinja" import container, settings, config_file with context %} |
||||
|
||||
oauth2-proxy image: |
||||
docker_image.present: |
||||
- name: {{ container.image }} |
||||
- tag: {{ container.tag }} |
||||
|
||||
oauth2-proxy container: |
||||
docker_container.running: |
||||
- require: |
||||
- docker_image: oauth2-proxy image |
||||
- watch: |
||||
- file: {{ config_file }} |
||||
- image: {{ container.image }}:{{ container.tag }} |
||||
- name: oauth2-proxy |
||||
- detach: true |
||||
- privileged: false |
||||
- shm_size: {{ container.shm_size }} |
||||
- restart_policy: "{{ container.restart }}" |
||||
{%- if container.log_options %} |
||||
- log_opt: |
||||
{%- for key, value in container.log_options.items() %} |
||||
- {{ key | yaml_squote }}: {{ value | yaml_dquote }} |
||||
{%- endfor %} |
||||
{% endif %} |
||||
- labels: |
||||
- appname=oauth2-proxy |
||||
- binds: |
||||
- {{ settings.conf_dir }}:/etc/oauth2-proxy:ro |
||||
{%- for bind in container.binds %} |
||||
- {{ bind }} |
||||
{%- endfor %} |
||||
{% if container.env %} |
||||
- environment: |
||||
{%- for key, value in container.env.items() %} |
||||
- {{ key }}: {{ value | yaml_squote }} |
||||
{%- endfor %} |
||||
{% endif %} |
||||
- command: > |
||||
--config=/etc/oauth2-proxy/settings.cfg |
||||
{% if settings.args %}{% for arg in settings.args %} {{ arg }} |
||||
{% endfor %}{% endif %} |
Loading…
Reference in new issue