From bea33ce737eee9f89549c648ccb1d2dfa9148dd6 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Wed, 7 Feb 2018 16:53:40 -0500 Subject: [PATCH] common salt module - fix file perms for nginx --- salt/common/init.sls | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/salt/common/init.sls b/salt/common/init.sls index be119a651..d034cab5c 100644 --- a/salt/common/init.sls +++ b/salt/common/init.sls @@ -59,6 +59,19 @@ nginxconf: - template: jinja - source: salt://common/nginx/nginx.conf.{{ grains.role }} +nginxlogdir: + file.directory: + - name: /opt/so/log/nginx/ + - user: 939 + - group: 939 + +nginxtmp: + file.directory: + - name: /opt/so/tmp/nginx/tmp + - user: 939 + - group: 939 + - makedirs: True + # Start the core docker so-core: docker_container.running: @@ -68,8 +81,11 @@ so-core: - binds: - /opt/so:/opt/so:rw - /opt/so/conf/nginx/nginx.conf:/etc/nginx/nginx.conf:ro + - /opt/so/log/nginx/:/var/log/nginx:rw + - /opt/so/tmp/nginx/:/var/lib/nginx:rw + - /opt/so/tmp/nginx/:/run:rw - network_mode: so-elastic-net - cap_add: NET_BIND_SERVICE - - ports: - - 80 - - 443 + - port_bindings: + - 80:80 + - 443:443