2015-11-18 23:02:49 +00:00
|
|
|
- name: install redmine package depdendencies
|
|
|
|
yum: name='{{ item }}'
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-11-12 04:14:03 +00:00
|
|
|
with_items:
|
2015-11-30 15:08:24 +00:00
|
|
|
- mysql-devel
|
2015-11-12 04:14:03 +00:00
|
|
|
- unzip
|
|
|
|
- rubygems
|
|
|
|
- ruby-devel
|
|
|
|
- zlib-devel
|
|
|
|
- openssl-devel
|
|
|
|
- gcc-c++
|
|
|
|
- ImageMagick-devel
|
|
|
|
- expect # for install_wrapper
|
2016-01-14 19:46:58 +00:00
|
|
|
- subversion # Repository integration
|
|
|
|
- git # Repository integration
|
2015-11-12 04:14:03 +00:00
|
|
|
|
2015-11-18 23:02:49 +00:00
|
|
|
- name: install bundler, redmine-installer gems
|
|
|
|
gem: name='{{ item }}'
|
|
|
|
user_install=no
|
2015-11-30 15:08:24 +00:00
|
|
|
executable=/usr/local/bin/gem # RVM's version
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-11-12 04:14:03 +00:00
|
|
|
with_items:
|
|
|
|
- bundler
|
|
|
|
- redmine-installer
|
|
|
|
|
2015-11-22 02:47:57 +00:00
|
|
|
- name: installer package is present?
|
|
|
|
stat: path='{{ installer_package_path }}'
|
2015-11-12 04:14:03 +00:00
|
|
|
register: has_installer_package
|
2016-07-14 03:15:07 +00:00
|
|
|
become: no
|
2015-11-22 02:47:57 +00:00
|
|
|
changed_when: false
|
2015-11-12 04:14:03 +00:00
|
|
|
|
|
|
|
- name: download installer
|
|
|
|
get_url: url='{{ installer_package_url }}'
|
2015-11-30 15:08:24 +00:00
|
|
|
dest='{{ remote_scratch_path }}'
|
2015-11-12 04:14:03 +00:00
|
|
|
mode=0640
|
|
|
|
force=no
|
|
|
|
when: has_installer_package.stat.exists == False
|
2016-07-14 03:15:07 +00:00
|
|
|
become: no
|
2015-11-12 04:14:03 +00:00
|
|
|
|
2015-11-22 02:47:57 +00:00
|
|
|
- name: add redmine installation wrapper script
|
|
|
|
template: dest='{{ _redmine_install_wrapper }}'
|
2015-11-12 04:14:03 +00:00
|
|
|
src=install_wrapper.j2
|
|
|
|
mode=750
|
2016-07-14 03:15:07 +00:00
|
|
|
become: no
|
2015-11-12 04:14:03 +00:00
|
|
|
|
|
|
|
- name: delete contents of redmine root directory
|
|
|
|
file: path='{{ redmine_root_dir }}'
|
|
|
|
state=absent
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
|
|
|
when: redmine_db_created is defined and redmine_db_created|changed
|
2015-11-12 04:14:03 +00:00
|
|
|
|
2015-11-22 02:47:57 +00:00
|
|
|
- name: make installation directory
|
|
|
|
file: path='{{ redmine_root_dir }}'
|
2015-11-12 04:14:03 +00:00
|
|
|
state=directory
|
2015-11-22 02:47:57 +00:00
|
|
|
owner='{{ redmine_owner }}'
|
2015-11-12 04:14:03 +00:00
|
|
|
mode=755
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-11-12 04:14:03 +00:00
|
|
|
register: mk_redmine_root_dir
|
|
|
|
|
|
|
|
- name: run redmine installer
|
2016-07-14 03:15:07 +00:00
|
|
|
shell: 'source ~/.bash_profile && {{ _redmine_install_wrapper }} > ~/install.log'
|
2015-11-18 23:02:49 +00:00
|
|
|
when: mk_redmine_root_dir|changed and do_redmine_installer == True
|
2015-11-30 15:08:24 +00:00
|
|
|
register: installer_run
|
2016-07-14 03:15:07 +00:00
|
|
|
become: no
|
2015-11-22 03:03:08 +00:00
|
|
|
|
2016-08-24 22:17:39 +00:00
|
|
|
- name: install ebrc_settings.rake
|
2016-08-25 01:25:10 +00:00
|
|
|
copy: dest='{{ redmine_root_dir }}/lib/tasks/ebrc_settings.rake'
|
2015-11-22 03:03:08 +00:00
|
|
|
src='ebrc_settings.rake'
|
2016-08-24 22:17:39 +00:00
|
|
|
owner='{{ redmine_owner }}'
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-11-22 03:03:08 +00:00
|
|
|
|
2016-08-24 22:17:39 +00:00
|
|
|
- name: install additional_environment.rb
|
2016-08-25 01:25:10 +00:00
|
|
|
copy: dest='{{ redmine_root_dir }}/config/additional_environment.rb'
|
2016-08-24 22:17:39 +00:00
|
|
|
src='additional_environment.rb'
|
|
|
|
owner='{{ redmine_owner }}'
|
|
|
|
become: yes
|
|
|
|
notify: restart nginx
|
|
|
|
|
2016-08-25 14:40:09 +00:00
|
|
|
- name: create public/assets dir
|
|
|
|
file: path='{{ redmine_root_dir }}/public/assets'
|
|
|
|
state=directory
|
|
|
|
owner='{{ redmine_owner }}'
|
|
|
|
mode=0755
|
|
|
|
become: yes
|
|
|
|
|
2016-08-25 01:25:10 +00:00
|
|
|
- name: install custom login background image
|
2016-08-25 19:00:59 +00:00
|
|
|
copy: dest='{{ item }}'
|
2016-08-25 01:25:10 +00:00
|
|
|
src='{{ easyredmine_login_bg_img }}'
|
|
|
|
owner='{{ redmine_owner }}'
|
2016-08-25 19:00:59 +00:00
|
|
|
with_items:
|
|
|
|
- '{{ redmine_root_dir }}/public/plugin_assets/easy_extensions/images/login-bg.jpg'
|
|
|
|
- '{{ redmine_root_dir }}/public/assets/{{ easyredmine_login_bg_img }}'
|
|
|
|
become: yes
|
|
|
|
|
|
|
|
- name: create maintenance dir
|
|
|
|
file: path='/usr/share/nginx/html/easyredmine'
|
|
|
|
state=directory
|
|
|
|
owner='{{ redmine_owner }}'
|
|
|
|
mode=0755
|
|
|
|
become: yes
|
|
|
|
- name: install maintenance.html
|
|
|
|
copy: dest=/usr/share/nginx/html/easyredmine/maintenance.html_
|
|
|
|
src=maintenance.html_
|
|
|
|
owner='{{ redmine_owner }}'
|
2016-08-25 01:25:10 +00:00
|
|
|
become: yes
|
|
|
|
|
2015-11-30 15:08:24 +00:00
|
|
|
- name: restrict config permissions
|
|
|
|
file: path='{{ redmine_root_dir }}/config'
|
|
|
|
mode=0770
|
2015-12-23 18:02:36 +00:00
|
|
|
|
2015-11-22 03:03:08 +00:00
|
|
|
- name: Configuring Redmine with eupath preferences
|
|
|
|
command: 'rake redmine:ebrc_settings RAILS_ENV=production'
|
|
|
|
args:
|
|
|
|
chdir: '{{ redmine_root_dir }}'
|
2016-07-14 03:15:07 +00:00
|
|
|
become: no
|
2015-11-30 15:08:24 +00:00
|
|
|
when: do_redmine_installer == True
|
|
|
|
|
2015-12-23 18:02:36 +00:00
|
|
|
- name: adding run_tasks crontab
|
2015-11-30 15:08:24 +00:00
|
|
|
cron: name="redmine tasks"
|
|
|
|
minute="*/15"
|
|
|
|
job='cd {{ redmine_root_dir }} && /usr/local/bin/bundle exec rake easyproject:scheduler:run_tasks RAILS_ENV=production > /dev/null'
|
|
|
|
user='{{ redmine_owner }}'
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-12-23 18:02:36 +00:00
|
|
|
|
2015-12-27 20:37:23 +00:00
|
|
|
- name: add redmine IMAP fetch script
|
|
|
|
template: dest='{{ redmine_root_dir }}/script/redmine_receive_imap'
|
|
|
|
src=redmine_receive_imap.j2
|
|
|
|
mode=750
|
2016-07-14 03:15:07 +00:00
|
|
|
become: no
|
2015-12-27 20:37:23 +00:00
|
|
|
|
2016-01-14 19:46:58 +00:00
|
|
|
- name: add redmine repository fetch script
|
|
|
|
template: dest='{{ redmine_root_dir }}/script/redmine_fetch_changesets'
|
|
|
|
src=redmine_fetch_changesets.j2
|
|
|
|
mode=750
|
2016-07-14 03:15:07 +00:00
|
|
|
become: no
|
2016-01-14 19:46:58 +00:00
|
|
|
|
2015-12-23 18:02:36 +00:00
|
|
|
- name: adding redmine_receive_imap crontab
|
|
|
|
cron: name="fetch from imap"
|
|
|
|
minute="*/5"
|
|
|
|
job="({{ redmine_root_dir }}/script/redmine_receive_imap 2>&1 | sed '/install RDoc/d') >> {{ redmine_root_dir }}/log/redmine_receive_imap"
|
|
|
|
user='{{ redmine_owner }}'
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-12-23 18:02:36 +00:00
|
|
|
|
2016-01-14 19:46:58 +00:00
|
|
|
- name: adding redmine_fetch_changesets crontab
|
|
|
|
cron: name="fetch from repository"
|
|
|
|
minute="*/5"
|
|
|
|
job="({{ redmine_root_dir }}/script/redmine_fetch_changesets 2>&1 | sed '/install RDoc/d') >> {{ redmine_root_dir }}/log/redmine_fetch_changesets"
|
|
|
|
user='{{ redmine_owner }}'
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2016-10-10 17:10:03 +00:00
|
|
|
|
|
|
|
- name: adding logrotate
|
|
|
|
template: dest='/etc/logrotate.d/redmine'
|
|
|
|
src=redmine_logrotate.j2
|
|
|
|
mode=0644
|
|
|
|
become: yes
|