2015-12-04 21:54:18 +00:00
|
|
|
# Tasks to do only on the production server.
|
|
|
|
|
|
|
|
# Setup NFS mounts where file attachments will be stored.
|
|
|
|
# This is so files are backed up on the NFS host; when hosting
|
|
|
|
# redmine on a VM without a backup client.
|
|
|
|
#
|
|
|
|
# Be sure the UID for the redmine user matches with the
|
|
|
|
# NFS server
|
|
|
|
|
2018-03-20 17:04:30 +00:00
|
|
|
- name: ensure NFS mount dir for Redmine files
|
|
|
|
file:
|
2017-12-21 03:47:20 +00:00
|
|
|
path: '{{ redmine_files_nfs_mount }}'
|
|
|
|
state: directory
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-12-04 21:54:18 +00:00
|
|
|
|
2018-03-20 17:04:30 +00:00
|
|
|
- name: mount dir for Redmine files
|
|
|
|
mount:
|
2017-12-21 03:47:20 +00:00
|
|
|
name: '{{ redmine_files_nfs_mount }}'
|
|
|
|
src: '{{ redmine_files_nfs_source }}'
|
|
|
|
fstype: nfs
|
|
|
|
opts: rsize=32768,wsize=32768,tcp,hard,nointr
|
|
|
|
state: mounted
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-12-04 21:54:18 +00:00
|
|
|
|
|
|
|
- name: set attachments_storage_path in configuration.yml
|
2017-12-21 03:47:20 +00:00
|
|
|
lineinfile:
|
|
|
|
dest: '{{ redmine_root_dir }}/config/configuration.yml'
|
|
|
|
regexp: '\s*attachments_storage_path:'
|
2018-05-10 14:05:21 +00:00
|
|
|
line: ' attachments_storage_path: {{ redmine_files_nfs_mount }}/uploads'
|
2015-12-04 21:54:18 +00:00
|
|
|
notify: restart nginx
|