Skip to content

Commit

Permalink
Merge pull request #16 from maeda-m/redmine6-ubuntu24
Browse files Browse the repository at this point in the history
Redmine 6.0 に対応する
  • Loading branch information
maeda-m authored Nov 26, 2024
2 parents e67c734 + 76534c1 commit 923af7f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Ansibleを使ってRedmineを自動インストールするためのプレイブ
## システム構成

* Ansible 2.17.5
* Redmine 5.1
* Redmine 6.0
* Ubuntu Server 24.04 LTS
* PostgreSQL
* Apache
Expand Down
5 changes: 4 additions & 1 deletion group_vars/redmine-servers
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
db_passwd_redmine: Must_be_changed!
# ----------------------------------------------------------------------

# Redmineにアクセスするときのサブディレクトリ名
redmine_relative_url_root: /redmine

# Redmineのチェックアウト元URL
redmine_svn_url: https://svn.redmine.org/redmine/branches/5.1-stable
redmine_svn_url: https://svn.redmine.org/redmine/branches/6.0-stable

# Redmineのデプロイ先ディレクトリ
redmine_dir: /var/lib/redmine
Expand Down
6 changes: 3 additions & 3 deletions roles/apache/templates/redmine.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
Require all granted
</Directory>

Alias /redmine {{ redmine_dir }}/public
<Location /redmine>
PassengerBaseURI /redmine
Alias {{ redmine_relative_url_root }} {{ redmine_dir }}/public
<Location {{ redmine_relative_url_root }}>
PassengerBaseURI {{ redmine_relative_url_root }}
PassengerAppRoot {{ redmine_dir }}
</Location>

Expand Down
21 changes: 17 additions & 4 deletions roles/redmine/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,14 @@
when:
result_database_yml is changed

- name: farend_basicテーマのダウンロード
- name: farend_basicテーマのダウンロードと展開
become: yes
git:
repo=https://github.com/farend/redmine_theme_farend_basic.git
dest={{ redmine_dir }}/public/themes/farend_basic
shell: |
wget -O {{ work_dir }}/farend_basic.tar.gz https://github.com/farend/redmine_theme_farend_basic/archive/refs/tags/1.5.tar.gz
mkdir -p {{ redmine_dir }}/themes/farend_basic
tar xzf {{ work_dir }}/farend_basic.tar.gz -C {{ redmine_dir }}/themes/farend_basic --strip-components=1
when:
result_database_yml is changed

- name: テーマをfarend_basicに切り替え
become: yes
Expand Down Expand Up @@ -172,3 +175,13 @@
RAILS_ENV: production
when:
result_database_yml is changed

- name: CSS や JavaScript、画像などを public/assets ディレクトリ配置
become: yes
command:
bundle exec rake assets:clobber assets:precompile
chdir={{ redmine_dir }}
environment:
PATH: "/usr/local/bin:{{ ansible_env.PATH }}"
RAILS_ENV: production
RAILS_RELATIVE_URL_ROOT: "{{ redmine_relative_url_root }}"
2 changes: 1 addition & 1 deletion site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
post_tasks:
- name: 完了
debug:
msg='インストールが完了しました。 http://{{ ansible_default_ipv4.address }}/redmine/ にアクセスしてください。'
msg='インストールが完了しました。 http://{{ ansible_default_ipv4.address }}{{ redmine_relative_url_root }}/ にアクセスしてください。'

0 comments on commit 923af7f

Please sign in to comment.