From 950e8e4d27df4ea79290f79d8322d2b11fb4158f Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 27 Sep 2017 20:46:33 +0200 Subject: [PATCH] redmine: set the secret token, configure the log level. --- redmine/defaults/main.yml | 1 + redmine/tasks/redmine.yml | 9 ++++++++- .../redmine-configuration.yml.j2} | 4 +++- redmine/templates/redmine_additional_environment.rb.j2 | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) rename redmine/{files/redmine-configuration.yml => templates/redmine-configuration.yml.j2} (94%) create mode 100644 redmine/templates/redmine_additional_environment.rb.j2 diff --git a/redmine/defaults/main.yml b/redmine/defaults/main.yml index c7afb2e3..c45f17c7 100644 --- a/redmine/defaults/main.yml +++ b/redmine/defaults/main.yml @@ -14,6 +14,7 @@ redmine_db_host: localhost redmine_inst_dir: redmine redmine_user: redmine redmine_group: redmine +redmine_log_level: warn # Minutes, from 1 to 60 redmine_ldap_sync_freq: 10 # users, groups, all diff --git a/redmine/tasks/redmine.yml b/redmine/tasks/redmine.yml index ba7be0b1..ead0f3b8 100644 --- a/redmine/tasks/redmine.yml +++ b/redmine/tasks/redmine.yml @@ -57,7 +57,14 @@ tags: redmine - name: Install the configuration file. Needed to send email - copy: src=redmine-configuration.yml dest=/{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/configuration.yml owner=root group={{ redmine_group }} mode=0440 + template: src=redmine-configuration.yml.j2 dest=/{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/configuration.yml owner=root group={{ redmine_group }} mode=0440 + notify: + - apache2 reload when needed + - Reload unicorn when needed + tags: redmine + +- name: Install the additional environment file + template: src=redmine_additional_environment.rb.j2 dest=/{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/additional_environment.rb owner=root group={{ redmine_group }} mode=0440 notify: - apache2 reload when needed - Reload unicorn when needed diff --git a/redmine/files/redmine-configuration.yml b/redmine/templates/redmine-configuration.yml.j2 similarity index 94% rename from redmine/files/redmine-configuration.yml rename to redmine/templates/redmine-configuration.yml.j2 index e1dffeb6..beceb014 100644 --- a/redmine/files/redmine-configuration.yml +++ b/redmine/templates/redmine-configuration.yml.j2 @@ -34,7 +34,9 @@ production: # # If you have a load-balancing Redmine cluster, you have to use the # same secret token on each machine. -#secret_token: 'change it to a long random string' +{% if redmine_secret_token is defined %} +secret_token: '{{ redmine_secret_token }}' +{% endif %} # specific configuration options for development environment # that overrides the default ones diff --git a/redmine/templates/redmine_additional_environment.rb.j2 b/redmine/templates/redmine_additional_environment.rb.j2 new file mode 100644 index 00000000..ed6f3093 --- /dev/null +++ b/redmine/templates/redmine_additional_environment.rb.j2 @@ -0,0 +1,3 @@ + +config.action_controller.allow_forgery_protection = false +config.log_level = :{{ redmine_log_level }}