Changeset - 48fc6c243b24
[Not reviewed]
0 4 0
Branko Majic (branko) - 6 years ago 2020-05-07 22:38:58
branko@majic.rs
MAR-149: Use the .items() method instead of .iteritems() on dicts in Jinja2 templates.
4 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
roles/php_website/templates/fpm_site.conf.j2
Show inline comments
 
@@ -18,15 +18,15 @@ pm = dynamic
 
pm.max_children = 5
 
pm.start_servers = 2
 
pm.min_spare_servers = 1
 
pm.max_spare_servers = 3
 

	
 
; Chdir to this directory at the start.
 
chdir = /
 

	
 
; Redirect worker stdout/stder into main error log. This will also allow Nginx
 
; to log errors in site-specific log file.
 
catch_workers_output = yes
 

	
 
{% for var, val in additional_fpm_config.iteritems() %}
 
{% for var, val in additional_fpm_config.items() %}
 
{{ var }} = {{ val }}
 
{% endfor %}
roles/wsgi_website/templates/environment.sh.j2
Show inline comments
 
{% for var, val in environment_variables.iteritems() %}
 
{% for var, val in environment_variables.items() %}
 
export {{ var }}='{{ val }}'
 
{% endfor %}
roles/wsgi_website/templates/nginx_site.j2
Show inline comments
 
@@ -50,25 +50,25 @@ server {
 
        try_files $uri $uri/ =404;
 
    }
 
    {% endfor -%}
 
    {% endif %}
 

	
 
    # Pass remaining requests to the WSGI server.
 
    location / {
 
        proxy_set_header X-Forwarded-Proto $scheme;
 
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 
        proxy_set_header Host $http_host;
 
        proxy_redirect off;
 

	
 
    {% for header, value in proxy_headers.iteritems() -%}
 
    {% for header, value in proxy_headers.items() -%}
 
    proxy_set_header {{ header }} {{ value }};
 
    {% endfor -%}
 

	
 
        proxy_pass http://unix:/run/wsgi/{{ fqdn }}.sock;
 
    }
 

	
 
    {% if environment_indicator -%}
 
    # Show environment indicator on HTML pages.
 
    sub_filter_types text/html;
 
    sub_filter_once on;
 
    sub_filter "</body>" "<div id='website-environment' style='background-color: {{ environment_indicator.background_colour }}; width: 100%; text-align: center; position: fixed; bottom: 5px; color: {{ environment_indicator.text_colour }}; font-weight: bold; z-index: 999999;'>{{ environment_indicator.text }}</div></body>";
 
    {% endif -%}
roles/wsgi_website/templates/systemd_wsgi_website.service.j2
Show inline comments
 
[Unit]
 
Description=Website {{ fqdn }}
 
Requires={{ fqdn }}.socket
 
After=network.target
 

	
 
[Service]
 
User={{ user }}
 
Group={{ user }}
 
WorkingDirectory={{ home }}/code
 
ExecStart={{ home }}/virtualenv/bin/gunicorn --bind unix:/run/wsgi/{{ fqdn }}.sock {% if use_paste %}--paste {{home}}/code/{{ wsgi_application }}{% else %}{{ wsgi_application }}{% endif %}
 

	
 
{% for var, val in environment_variables.iteritems() %}
 
{% for var, val in environment_variables.items() %}
 
Environment="{{ var }}={{ val }}"
 
{% endfor %}
 

	
 
ExecReload=/bin/kill -s HUP $MAINPID
 
ExecStop=/bin/kill -s TERM $MAINPID
 
PrivateTmp=true
 
UMask=0007
 

	
 
[Install]
 
WantedBy=multi-user.target
0 comments (0 inline, 0 general)