From 2b52d319ef3f84f625b0965f1e70eae144a86ad5 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 4 May 2021 14:43:11 +0200 Subject: [PATCH] Refactoring, compatibility with redmine 4.2. --- defaults/main.yml | 31 +++++++++------ handlers/main.yml | 21 +--------- tasks/main.yml | 4 +- tasks/redmine-plugins.yml | 59 ++++++++++++++++++---------- tasks/redmine.yml | 54 +++++++++++++++++++------ tasks/unicorn.yml | 25 ++++++++---- templates/systemd_unicorn.service.j2 | 7 +++- templates/unicorn-redmine.default.j2 | 2 +- vars/main.yml | 6 ++- 9 files changed, 132 insertions(+), 77 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b3ca691..37be70a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,6 +2,8 @@ redmine_major_version: 4 redmine_minor_version: 2 redmine_patch_version: 0 +redmine_load_balanced: False +redmine_load_balanced_main_instance: True redmine_version: '{{ redmine_major_version }}.{{ redmine_minor_version }}.{{ redmine_patch_version }}' redmine_inst_name: redmine redmine_main_project: redmine @@ -28,9 +30,11 @@ redmine_systemd_service_name: 'unicorn@{{ redmine_inst_name }}.service' redmine_service_name: '{{ redmine_systemd_service_name }}' redmine_web_root: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/public' -nginx_frontend: '{{ redmine_nginx_frontend }}' -nginx_use_common_virthost: '{{ redmine_nginx_use_common_virthost }}' +redmine_nginx_behind_haproxy_settings: False +redmine_nginx_frontend: True +redmine_nginx_use_common_virthost: True nginx_virthosts: '{{ redmine_nginx_virthosts }}' +redmine_nginx_serveraliases: [] redmine_log_level: warn # Minutes, from 1 to 60 @@ -43,7 +47,8 @@ redmine_glob_user: redmine redmine_glob_group: redmine redmine_glob_users_home_base: /srv/redmine-home # Define it and point to an external directory to have it used -# redmine_storage_path: '/{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/files' +# redmine_storage_path_prefix: '/{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/files' +# redmine_storage_path: '/{{ redmine_storage_path_prefix }}/files' redmine_imap_sync: False redmine_imap_server: localhost @@ -59,11 +64,12 @@ redmine_imap_sync_additional_options: '' rm_ldap_auth: False rm_ldap_sync: False rm_ldap_synch: '{{ rm_ldap_sync }}' -rm_ldap_sync_url: 'https://github.com/thorin/redmine_ldap_sync.git' +rm_ldap_sync_url: 'https://github.com/adellam/redmine_ldap_sync.git' rm_better_gantt_plugin: False rm_better_gantt_url: 'https://github.com/tuanpembual/redmine_better_gantt_chart.git' rm_login_audit_plugin: False -rm_login_audit_url: 'https://github.com/martin-denizet/redmine_login_audit.git' +#rm_login_audit_url: 'https://github.com/martin-denizet/redmine_login_audit.git' +rm_login_audit_url: 'https://github.com/adellam/redmine_login_audit' rm_progressive_projects_plugin: False rm_progressive_projects_url: 'https://github.com/stgeneral/redmine-progressive-projects-list.git' rm_didyoumean_plugin: False @@ -91,9 +97,7 @@ rm_updatereminder_url: 'https://github.com/arkhitech/redmine_update_reminder' rm_updatereminder_plugin_freq_min: 0 rm_updatereminder_plugin_freq_hour: 5 rm_updatereminder_plugin_freq_weekday: 1 -rm_mention_plugin: False -#rm_mention_url: 'https://github.com/stpl/redmine_mention_plugin' -rm_mention_url: 'https://github.com/tainewoo/redmine_mentions' +rm_mentions_url: 'https://github.com/adellam/redmine_mentions' rm_mentions_plugin: False rm_defaultcustomquery_plugin: False rm_defaultcustomquery_url: 'https://github.com/hidakatsuya/redmine_default_custom_query' @@ -101,6 +105,8 @@ rm_closesresolvedissue_plugin: False rm_closesresolvedissue_url: 'https://github.com/Jogi1j/redmine_closes_resolved_issues' rm_defaultassign_url: 'https://github.com/giddie/redmine_default_assign' rm_defaultassign_plugin: False +rm_auto_watcher_from_groups_url: 'https://github.com/akuznecov/redmine_auto_watchers_from_groups' +rm_auto_watchers_from_groups: False rm_onceassignedeverwatcher_url: 'https://github.com/raafael911/redmine_once_assigned_ever_watcher' rm_onceassignedeverwatcher_plugin: False rm_clipboardimagepaste_url: 'https://github.com/peclik/clipboard_image_paste' @@ -121,12 +127,15 @@ rm_usability_plugin: False rm_mylynconnector_url: 'git://github.com/danmunn/redmine_mylyn_connector.git' rm_mylynconnector_plugin: False rm_addsubversionlinks_plugin: False -rm_addsubversionlinks_url: 'https://github.com/masamitsu-murase/redmine_add_subversion_links.git' +#rm_addsubversionlinks_url: 'https://github.com/masamitsu-murase/redmine_add_subversion_links.git' +rm_addsubversionlinks_url: 'https://github.com/adellam/redmine_add_subversion_links.git' rm_wiki_external_url: 'https://github.com/nutso/redmine-plugin-wiki-external.git' rm_wiki_external_plugin: False +rm_wiki_backlinks_url: 'https://github.com/bluezio/redmine_wiki_backlinks' +rm_wiki_backlinks_plugin: False rm_pastebin_url: 'https://github.com/commandprompt/redmine_pastebin.git' rm_pastebin_plugin: False -rm_issue_templates_url: 'https://github.com/akiko-pusu/redmine_issue_templates' +rm_issue_templates_url: 'https://github.com/adellam/redmine_issue_templates' rm_issue_templates_plugin: False # TODO lists plugin: https://redmine.org/plugins/redmine_issue_todo_lists rm_issue_todo_lists_url: 'https://github.com/canidas/redmine_issue_todo_lists' @@ -136,7 +145,7 @@ rm_issue_todo_lists_plugin: False ruby_use_mod_passenger: False ruby_use_unicorn: True # Redmine 2.x only -rm_involvement_url: 'https://github.com/commandprompt/redmine_involvement_filter.git' +rm_involvement_url: 'https://github.com/adellam/redmine_involvement_filter.git' rm_involvement_plugin: False rm_omniauth_url: 'https://github.com/arlin2050/redmine_omniauth_client.git' rm_omniauth_plugin: False diff --git a/handlers/main.yml b/handlers/main.yml index 29bc5a8..68d4b69 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,12 +1,4 @@ --- -- name: apache2 reload - service: name=apache2 state=reloaded - when: ruby_use_mod_passenger - -- name: apache2 reload when needed - service: name=apache2 state=reloaded - when: ruby_use_mod_passenger - - name: Reload unicorn service: name={{ redmine_sysvinit_service_name }} state=reloaded when: ansible_service_mgr != 'systemd' @@ -18,49 +10,38 @@ - name: Reload unicorn when needed service: name={{ redmine_sysvinit_service_name }} state=restarted when: - - ruby_use_unicorn - ansible_service_mgr != 'systemd' - name: Reload unicorn when needed service: name={{ redmine_systemd_service_name }} state=restarted when: - - ruby_use_unicorn - ansible_service_mgr == 'systemd' - name: Reconfigure redmine shell: cd {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}; bundle exec rake redmine:plugins:migrate RAILS_ENV=production notify: - - apache2 reload when needed - Reload unicorn when needed - name: Reconfigure agile plugin shell: cd {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}; bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production notify: - - apache2 reload when needed - Reload unicorn when needed - + - name: Bundle install shell: cd {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}; bundle install --without development test mysql RAILS_ENV=production notify: - - apache2 reload when needed - Reload unicorn when needed - name: Bundle install and reconfigure redmine shell: cd {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}; bundle install ; bundle exec rake redmine:plugins:migrate RAILS_ENV=production notify: - - apache2 reload when needed - Reload unicorn when needed - name: Remove a plugin and reconfigure redmine shell: cd {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}; bundle exec rake redmine:plugins:migrate NAME=redmine_plugin_name VERSION=0 RAILS_ENV=production notify: - - apache2 reload when needed - Reload unicorn when needed -- name: Generate the mod-passenger executable - shell: passenger-install-apache2-module -a - when: ruby_use_mod_passenger - - name: change the redmine permissions recursively shell: chown -R {{ redmine_user }}:{{ redmine_group }} {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/files {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/log {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/tmp {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/public/plugin_assets ignore_errors: True diff --git a/tasks/main.yml b/tasks/main.yml index cb79c1d..717171f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,7 +5,7 @@ when: ansible_distribution_file_variety == "Debian" - import_tasks: redmine.yml when: ansible_distribution_file_variety == "Debian" -#- import_tasks: redmine-plugins.yml -# when: ansible_distribution_file_variety == "Debian" +- import_tasks: redmine-plugins.yml + when: ansible_distribution_file_variety == "Debian" - import_tasks: unicorn.yml when: ansible_distribution_file_variety == "Debian" diff --git a/tasks/redmine-plugins.yml b/tasks/redmine-plugins.yml index c8edfbe..e19380e 100644 --- a/tasks/redmine-plugins.yml +++ b/tasks/redmine-plugins.yml @@ -17,11 +17,13 @@ tags: [ 'redmine', 'redmine_plugins' ] - name: Install the ldap sync plugin - git: repo={{ rm_ldap_sync_url }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_ldap_sync update=no - notify: - - Bundle install and reconfigure redmine + git: + repo: '{{ rm_ldap_sync_url }}' + dest: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_ldap_sync' + update: no + notify: Bundle install and reconfigure redmine when: rm_ldap_sync - tags: [ 'redmine', 'redmine_plugins', 'rm_ldap_synch' ] + tags: [ 'redmine', 'redmine_plugins', 'rm_ldap_sync' ] - name: Cron job that manages the ldap sync cron: @@ -32,22 +34,37 @@ cron_file: redmine-ldap-sync state: present when: rm_ldap_sync - tags: [ 'redmine', 'redmine_plugins', 'rm_ldap_synch' ] + tags: [ 'redmine', 'redmine_plugins', 'rm_ldap_sync' ] - name: Redmine login audit plugin - git: repo={{ rm_login_audit_url }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_login_audit update=no + git: + repo: '{{ rm_login_audit_url }}' + dest: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_login_audit' + update: no notify: - - Reconfigure redmine + - Bundle install and reconfigure redmine when: rm_login_audit_plugin - tags: [ 'redmine', 'redmine_plugins' ] + tags: [ 'redmine', 'redmine_plugins', 'rm_audit_plugin' ] + +- name: Redmine auto_watcher_from_groups plugin + git: + repo: '{{ rm_auto_watcher_from_groups_url }}' + dest: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_auto_watchers_from_groups' + update: no + notify: + - Bundle install and reconfigure redmine + when: rm_auto_watchers_from_groups + tags: [ 'redmine', 'redmine_plugins', 'rm_auto_watchers_plugin' ] - name: Redmine subversion links plugin - git: repo={{ rm_addsubversionlinks_url }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_add_subversion_links update=no + git: + repo: '{{ rm_addsubversionlinks_url }}' + dest: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_add_subversion_links' + update: no when: rm_addsubversionlinks_plugin notify: - - apache2 reload when needed - Reload unicorn when needed - tags: [ 'redmine', 'redmine_plugins' ] + tags: [ 'redmine', 'redmine_plugins', 'rm_addsubversionlinks_plugin' ] - name: Progressive projects list plugin git: repo={{ rm_progressive_projects_url }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/progressive_projects_list update=no @@ -128,13 +145,6 @@ when: rm_updatereminder_plugin tags: [ 'redmine', 'redmine_plugins', 'redmine_plugins_updatereminder' ] -- name: Install the mention plugin - git: repo={{ rm_mention_url }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_mention_plugin update=no - when: rm_mention_plugin - notify: - - Bundle install and reconfigure redmine - tags: [ 'redmine', 'redmine_plugins', 'redmine_plugins_mention' ] - - name: Install the default custom query plugin git: repo={{ rm_defaultcustomquery_url }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_default_custom_query update=no when: rm_defaultcustomquery_plugin @@ -213,7 +223,7 @@ tags: [ 'redmine', 'redmine_plugins', 'redmine_plugins_mylynconnector' ] - name: Install the mentions plugin - git: repo={{ rm_mention_url }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_mentions update=no + git: repo={{ rm_mentions_url }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_mentions update=no when: rm_mentions_plugin notify: - Bundle install and reconfigure redmine @@ -225,6 +235,15 @@ notify: Bundle install and reconfigure redmine tags: [ 'redmine', 'redmine_plugins', 'redmine_plugins_wiki_external' ] +- name: Install the wiki backlinks + git: + repo: '{{ rm_wiki_backlinks_url }}' + dest: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_wiki_backlinks' + update: no + when: rm_wiki_backlinks_plugin + notify: Bundle install and reconfigure redmine + tags: [ 'redmine', 'redmine_plugins', 'redmine_plugins_wiki_backlinks' ] + - name: Install the paste plugin git: repo={{ rm_pastebin_url }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_pastebin update=no when: rm_pastebin_plugin @@ -241,7 +260,7 @@ - name: Install the issue_todo_lists plugin git: - repo: '{{ rm_involvement_url }}' + repo: '{{ rm_issue_todo_lists_url }}' dest: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_issue_todo_lists' update: no when: rm_issue_todo_lists_plugin diff --git a/tasks/redmine.yml b/tasks/redmine.yml index c270aeb..fb4806b 100644 --- a/tasks/redmine.yml +++ b/tasks/redmine.yml @@ -21,7 +21,13 @@ when: not redmine_install_from_subversion - name: Unarchive the redmine {{ redmine_version }} archive - unarchive: src={{ redmine_glob_root_dir }}/redmine-{{ redmine_version }}.tar.gz dest={{ redmine_glob_root_dir }} copy=no owner=root group=root creates={{ redmine_glob_root_dir }}/redmine-{{ redmine_version }}/Rakefile + unarchive: + src: '{{ redmine_glob_root_dir }}/redmine-{{ redmine_version }}.tar.gz' + dest: '{{ redmine_glob_root_dir }}' + copy: no + owner: root + group: root + creates: '{{ redmine_glob_root_dir }}/redmine-{{ redmine_version }}/Rakefile' register: redmine_install when: not redmine_install_from_subversion @@ -47,17 +53,31 @@ when: redmine_install_from_subversion - name: Create the right path for the application when installing from subversion - file: src={{ redmine_glob_root_dir }}/redmine-{{ redmine_major_version }}.{{ redmine_minor_version }} dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }} state=link + file: + src: '{{ redmine_glob_root_dir }}/redmine-{{ redmine_major_version }}.{{ redmine_minor_version }}' + dest: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}' + state: link when: redmine_install_from_subversion - - name: Create the directory for logs and static files + - name: Create the prefix directory that will store static files + file: + dest: '{{ redmine_storage_path_prefix }}' + state: directory + owner: '{{ redmine_user }}' + group: '{{ redmine_group }}' + recurse: yes + when: redmine_storage_path_prefix is defined + + - name: Create the directory that will store the static files, if not nfs file: dest: '{{ redmine_storage_path }}' state: directory owner: '{{ redmine_user }}' group: '{{ redmine_group }}' recurse: yes - when: redmine_storage_path is defined + when: + - redmine_storage_path is defined + - autofs_client_mountpoint is defined and not autofs_client_mountpoint - name: Link the logs directory under /var/log file: @@ -66,12 +86,22 @@ state: link - name: Install the database configuration - template: src=redmine-database.yml.j2 dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/database.yml owner=root group={{ redmine_group }} mode=0440 + template: + src: redmine-database.yml.j2 + dest: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/database.yml' + owner: root + group: '{{ redmine_group }}' + mode: '0440' notify: - Reload unicorn when needed - name: Install the configuration file. Needed to send email - template: src=redmine-configuration.yml.j2 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: - Reload unicorn when needed @@ -103,12 +133,14 @@ shell: cd {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}; RAILS_ENV=production rake db:migrate && touch {{ redmine_glob_root_dir }}/.{{ redmine_inst_dir }}.db_initialized args: creates: '{{ redmine_glob_root_dir }}/.{{ redmine_inst_dir }}.db_initialized' + when: redmine_load_balanced_main_instance tags: [ 'redmine', 'redmine_db_init' ] - name: Install the defauld DB data shell: cd {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}; RAILS_ENV=production REDMINE_LANG=en rake redmine:load_default_data && touch {{ redmine_glob_root_dir }}/.{{ redmine_inst_dir }}.db_data_loaded args: creates: '{{ redmine_glob_root_dir }}/.{{ redmine_inst_dir }}.db_data_loaded' + when: redmine_load_balanced_main_instance tags: [ 'redmine', 'redmine_db_init' ] - name: Install the packages needed by plugins or to build plugins required gems @@ -140,10 +172,11 @@ template: src=redmine-logrotate.j2 dest=/etc/logrotate.d/redmine-{{ redmine_inst_name }} owner=root group=root mode=0444 tags: [ 'redmine', 'logrotate' ] + tags: [redmine] + +- block: - name: Install a script that syncs the email to redmine reading from a imap account template: src=redmine-imap-sync.j2 dest=/usr/local/bin/redmine-imap-sync owner=root group={{ redmine_user }} mode=0750 - when: redmine_imap_sync | bool - tags: [ 'redmine', 'redmine_imap' ] - name: Install a cron job that configures the task that reads emails via imap cron: @@ -154,7 +187,6 @@ minute: '*/10' name: 'Redmine update tasks by email' state: present - when: redmine_imap_sync | bool - tags: [ 'redmine', 'redmine_imap' ] - tags: redmine + when: redmine_imap_sync | bool + tags: [ 'redmine', 'redmine_imap' ] diff --git a/tasks/unicorn.yml b/tasks/unicorn.yml index df383f2..0745c0c 100644 --- a/tasks/unicorn.yml +++ b/tasks/unicorn.yml @@ -10,14 +10,14 @@ tags: [ 'ruby', 'redmine', 'unicorn' ] when: ansible_distribution_version is version_compare('18.04', '==') -- block: +- block: - name: Create the unicorn log directory file: dest={{ unicorn_log_dir }} state=directory owner={{ redmine_user }} group={{ redmine_user }} mode=0750 - + - name: Install the unicorn defaults file template: src=unicorn-redmine.default.j2 dest=/etc/default/unicorn-{{ redmine_inst_name }} owner=root group=root mode=0644 notify: Reload unicorn when needed - + - name: Install the unicorn logrotate file template: src=unicorn-logrotate.j2 dest=/etc/logrotate.d/unicorn-{{ redmine_inst_name }} owner=root group=root mode=0644 @@ -25,15 +25,24 @@ template: src=unicorn.conf.rb.j2 dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/unicorn.conf.rb owner=root group=root mode=0644 - name: Install the systemd unit that globally manages the unicorn service - template: src=systemd_unicorn.service.j2 dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/unicorn@.service + template: + src: systemd_unicorn.service.j2 + dest: '/lib/systemd/system/unicorn@.service' + #dest: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/unicorn@.service' notify: Reload systemd after the system unit installation - - name: Link the systemd unit that globally manages the unicorn service - file: src={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/unicorn@.service dest=/etc/systemd/system/multi-user.target.wants/unicorn@.service state=link - notify: Reload systemd after the system unit installation + # - name: Link the systemd unit that globally manages the unicorn service + # file: + # src: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/unicorn@.service' + # dest: '/lib/systemd/system/unicorn@.service' + # state: link + # notify: Reload systemd after the system unit installation - name: Add the systemd instance for the specific service - file: src={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/unicorn@.service dest=/etc/systemd/system/multi-user.target.wants/unicorn@{{ redmine_inst_name }}.service state=link + file: + src: '{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/unicorn@.service' + dest: '/lib/systemd/system/unicorn@{{ redmine_inst_name }}.service' + state: link notify: Reload systemd after the system unit installation - name: Reload systemd after the system unit installation diff --git a/templates/systemd_unicorn.service.j2 b/templates/systemd_unicorn.service.j2 index 0d05e68..abd2e5d 100644 --- a/templates/systemd_unicorn.service.j2 +++ b/templates/systemd_unicorn.service.j2 @@ -3,20 +3,23 @@ # each application reads its settings from /etc/default/unicorn_appone, /etc/default/unicorn_apptwo Description=Unicorn serving %I app After=syslog.target +After=network.target [Service] -Restart=always +Restart=on-failure RestartSec=10 Type=forking User={{ redmine_user }} Group={{ redmine_group }} WorkingDirectory=/srv/redmine/%I -EnvironmentFile=/etc/default/unicorn-%I +EnvironmentFile=/etc/default/unicorn_%I SyslogIdentifier=unicorn-%I PIDFile={{ unicorn_pid_file }} KillMode=mixed KillSignal=SIGQUIT ExecStart=/usr/bin/bundle exec "${DAEMON} ${DAEMON_OPTS}" +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=30 [Install] WantedBy=multi-user.target diff --git a/templates/unicorn-redmine.default.j2 b/templates/unicorn-redmine.default.j2 index 95a176e..c4f25b6 100644 --- a/templates/unicorn-redmine.default.j2 +++ b/templates/unicorn-redmine.default.j2 @@ -1,7 +1,7 @@ APP={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }} APP_ROOT={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }} USER={{ redmine_user }} -DAEMON=unicorn +DAEMON=/usr/local/bin/unicorn DAEMON_OPTS="-c {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/config/unicorn.conf.rb -E production -D -l {{ unicorn_listen_address }}:3999" NAME=unicorn DESC="Unicorn app for $USER" diff --git a/vars/main.yml b/vars/main.yml index eb498f2..b9f7fff 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -49,12 +49,14 @@ redmine_base_apache_modules: - rewrite - expires -redmine_nginx_frontend: True -redmine_nginx_use_common_virthost: True +nginx_frontend: '{{ redmine_nginx_frontend }}' +nginx_use_common_virthost: '{{ redmine_nginx_use_common_virthost }}' +nginx_behind_haproxy_settings: '{{ redmine_nginx_behind_haproxy_settings}}' redmine_nginx_virthosts: - virthost_name: '{{ ansible_fqdn }}' listen: '{{ http_port }}' server_name: '{{ ansible_fqdn }}' + serveraliases: '{{ redmine_nginx_serveraliases }}' ssl_enabled: True ssl_only: True ssl_letsencrypt_certs: '{{ nginx_letsencrypt_managed }}'