mirror of
https://github.com/krislamo/vagrant-easyredmine
synced 2024-11-10 06:50:35 +00:00
120 lines
3.6 KiB
YAML
120 lines
3.6 KiB
YAML
- name: install redmine package depdendencies
|
|
yum: name='{{ item }}'
|
|
become: yes
|
|
with_items:
|
|
- mysql-devel
|
|
- unzip
|
|
- rubygems
|
|
- ruby-devel
|
|
- zlib-devel
|
|
- openssl-devel
|
|
- gcc-c++
|
|
- ImageMagick-devel
|
|
- expect # for install_wrapper
|
|
- subversion # Repository integration
|
|
- git # Repository integration
|
|
|
|
- name: install bundler, redmine-installer gems
|
|
gem: name='{{ item }}'
|
|
user_install=no
|
|
executable=/usr/local/bin/gem # RVM's version
|
|
become: yes
|
|
with_items:
|
|
- bundler
|
|
- redmine-installer
|
|
|
|
- name: installer package is present?
|
|
stat: path='{{ installer_package_path }}'
|
|
register: has_installer_package
|
|
become: no
|
|
changed_when: false
|
|
|
|
- name: download installer
|
|
get_url: url='{{ installer_package_url }}'
|
|
dest='{{ remote_scratch_path }}'
|
|
mode=0640
|
|
force=no
|
|
when: has_installer_package.stat.exists == False
|
|
become: no
|
|
|
|
- name: add redmine installation wrapper script
|
|
template: dest='{{ _redmine_install_wrapper }}'
|
|
src=install_wrapper.j2
|
|
mode=750
|
|
become: no
|
|
|
|
- name: delete contents of redmine root directory
|
|
file: path='{{ redmine_root_dir }}'
|
|
state=absent
|
|
become: yes
|
|
when: redmine_db_created is defined and redmine_db_created|changed
|
|
|
|
- name: make installation directory
|
|
file: path='{{ redmine_root_dir }}'
|
|
state=directory
|
|
owner='{{ redmine_owner }}'
|
|
mode=755
|
|
become: yes
|
|
register: mk_redmine_root_dir
|
|
|
|
- name: run redmine installer
|
|
shell: 'source ~/.bash_profile && {{ _redmine_install_wrapper }} > ~/install.log'
|
|
when: mk_redmine_root_dir|changed and do_redmine_installer == True
|
|
register: installer_run
|
|
become: no
|
|
|
|
- copy: dest='/opt/easyredmine/lib/tasks/ebrc_settings.rake'
|
|
src='ebrc_settings.rake'
|
|
become: yes
|
|
|
|
- name: restrict config permissions
|
|
file: path='{{ redmine_root_dir }}/config'
|
|
mode=0770
|
|
|
|
- name: Configuring Redmine with eupath preferences
|
|
command: 'rake redmine:ebrc_settings RAILS_ENV=production'
|
|
args:
|
|
chdir: '{{ redmine_root_dir }}'
|
|
become: no
|
|
when: do_redmine_installer == True
|
|
|
|
- name: adding run_tasks crontab
|
|
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 }}'
|
|
become: yes
|
|
|
|
- name: add redmine IMAP fetch script
|
|
template: dest='{{ redmine_root_dir }}/script/redmine_receive_imap'
|
|
src=redmine_receive_imap.j2
|
|
mode=750
|
|
become: no
|
|
|
|
- name: add redmine repository fetch script
|
|
template: dest='{{ redmine_root_dir }}/script/redmine_fetch_changesets'
|
|
src=redmine_fetch_changesets.j2
|
|
mode=750
|
|
become: no
|
|
|
|
- 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 }}'
|
|
become: yes
|
|
|
|
- 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 }}'
|
|
become: yes
|
|
|
|
- name: set session cookie as secure
|
|
lineinfile: >
|
|
dest='{{ redmine_root_dir }}/config/application.rb'
|
|
regexp='^\s*config.session_store'
|
|
line=" config.session_store :cookie_store, :key => '_redmine_session', :secure => true"
|
|
notify: restart nginx
|