Page MenuHomeDevCentral

No OneTemporary

diff --git a/roles/paas-docker/nginx/config.sls b/roles/paas-docker/nginx/config.sls
index 5ef8bf9..c56d149 100644
--- a/roles/paas-docker/nginx/config.sls
+++ b/roles/paas-docker/nginx/config.sls
@@ -1,70 +1,78 @@
# -------------------------------------------------------------
# Salt — Provision Docker engine
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2018-03-16
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{% from "map.jinja" import dirs with context %}
{% set containers = pillar.get('docker_containers', {}) %}
# -------------------------------------------------------------
# vhosts folder
#
# :: fallback when a domain isn't found
# :: server cover page
# :: containers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ dirs.etc }}/nginx/vhosts/000-fallback.conf:
file.managed:
- source: salt://roles/paas-docker/nginx/files/vhosts/base/fallback.conf
{{ dirs.etc }}/nginx/vhosts/001-server.conf:
file.managed:
- source: salt://roles/paas-docker/nginx/files/vhosts/base/server.conf
- template: jinja
- context:
fqdn: {{ grains['fqdn'] }}
ipv4: {{ grains['ipv4'] | join(" ") }}
ipv6: "{{ salt['node.get_ipv6_list']() }}"
/var/log/www/_server:
file.directory:
- user: nginx
- group: root
{% for service, instances in containers.items() %}
{% if salt["paas_docker"]["is_nginx_service"](instances) %}
/var/log/www/{{ service }}:
file.directory:
- user: nginx
- group: root
{% for instance, container in instances.items() %}
{% if 'host' in container %}
{% set vhost_config = salt["paas_docker.resolve_vhost_config_file"](service) %}
{{ dirs.etc }}/nginx/vhosts/{{ service }}/{{ instance }}.conf:
file.managed:
- source: salt://{{ vhost_config }}
- mode: 644
- makedirs: True
- template: jinja
- context:
service: {{ service }}
instance: {{ instance }}
fqdn: {{ container['host'] }}
app_port: {{ container['app_port'] }}
aliases: {{ container['aliases'] | default('', true) | join(" ") }}
# If the nginx configuration needs more key,
# pass directly the container dictionary.
args: {{ container }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
+
+# -------------------------------------------------------------
+# Log
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/etc/logrotate.d/nginx:
+ file.managed:
+ - source: salt://roles/paas-docker/nginx/files/logrotate/nginx.conf
diff --git a/roles/paas-docker/nginx/files/logrotate/nginx.conf b/roles/paas-docker/nginx/files/logrotate/nginx.conf
new file mode 100644
index 0000000..7b8025e
--- /dev/null
+++ b/roles/paas-docker/nginx/files/logrotate/nginx.conf
@@ -0,0 +1,27 @@
+# -------------------------------------------------------------
+# Salt — Logrotate configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/paas-docker/nginx/files/logrotate/nginx.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+/var/log/www/*/*.log {
+ daily
+ rotate 90
+ missingok
+ notifempty
+ compress
+ delaycompress
+ sharedscripts
+ postrotate
+ /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
+ endscript
+}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Nov 21, 16:26 (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3170894
Default Alt Text
(3 KB)

Event Timeline