Commit e1b75cb2 authored by Georgios Ouzounis's avatar Georgios Ouzounis
Browse files

Dynamically configure max upload file size in ansible

parent c682d231
---
- name: Include variables from other roles
include_vars: "roles/service-vm/vars/main.yml"
- name: Fetch url for nodejs.
shell: "curl --silent --location https://deb.nodesource.com/setup_0.12 | bash -"
tags:
......
......@@ -43,6 +43,7 @@ module.exports = function(environment) {
ENV.redirect_delay = 3000;
ENV.message_dismiss = 4000;
ENV.button_delay = 10000;
ENV.max_upload_file_Size = {{max_upload_file_size}};
if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
......
......@@ -79,8 +79,7 @@
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# limit request body size to 500MB
LimitRequestBody 524288000
LimitRequestBody {{max_upload_file_size}}
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
......
......@@ -6,3 +6,4 @@ repository_download_path: /var/www
repository_url: https://github.com/grnet/okeanos-LoD.git
repository_branch: devel
central_vm_host: "https://lambda.grnet.gr"
max_upload_file_size: 268435456 # 256MB
from jinja2 import Environment, FileSystemLoader
import socket
import os
import yaml
if __name__ == '__main__':
env = Environment(loader=FileSystemLoader('../ansible/roles/ember/templates'))
template = env.get_template('environment.js.j2')
ansible_hostname = socket.gethostname()
settings = template.render(ansible_hostname=ansible_hostname)
variables_file = open("../ansible/roles/service-vm/vars/main.yml")
max_upload_file_size = yaml.load_all(variables_file).next()['max_upload_file_size']
settings = template.render(ansible_hostname=ansible_hostname,
max_upload_file_size=max_upload_file_size)
if not os.path.exists('config'):
os.mkdir('config')
with open('config/environment.js', 'w') as f:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment