1
0
mirror of https://github.com/krislamo/vagrant-easyredmine synced 2025-09-14 07:49:29 +00:00

Compare commits

...

11 Commits

13 changed files with 71 additions and 34 deletions

4
Vagrantfile vendored
View File

@@ -4,7 +4,7 @@ Vagrant.configure(2) do |config|
config.vm.box_url = 'http://software.apidb.org/vagrant/centos-7-64-puppet.json' config.vm.box_url = 'http://software.apidb.org/vagrant/centos-7-64-puppet.json'
config.vm.box = 'ebrc/centos-7-64-puppet' config.vm.box = 'ebrc/centos-7-64-puppet'
config.vm.hostname = 'redmine.vm.apidb.org' config.vm.hostname = 'redmine.vm.apidb.org'
config.vm.network :private_network, type: 'dhcp' config.vm.network :private_network, type: 'dhcp'
@@ -22,7 +22,7 @@ Vagrant.configure(2) do |config|
# end # end
config.vm.provision 'deploy', type: 'ansible' do |ansible| config.vm.provision 'deploy', type: 'ansible' do |ansible|
ansible.playbook = 'playbook.yml' ansible.playbook = 'vagrant-playbook.yml'
ansible.galaxy_role_file = 'requirements.yml' ansible.galaxy_role_file = 'requirements.yml'
ansible.galaxy_roles_path = 'roles' ansible.galaxy_roles_path = 'roles'
end end

View File

@@ -1,4 +1,3 @@
easyredmine_login_bg_img: login-bg-58894778db89f0c55f5aa371eff62b7475325258f4308e9c286f988a37e0e44b.jpg
redmine_mail_alias: redmine@localhost redmine_mail_alias: redmine@localhost
redmine_owner: vagrant redmine_owner: vagrant
redmine_uid: '' redmine_uid: ''
@@ -14,9 +13,9 @@ do_redmine_installer: yes
do_imap_fetch: yes # install the redmine_receive_imap template script do_imap_fetch: yes # install the redmine_receive_imap template script
remote_scratch_path: /vagrant/scratch remote_scratch_path: /vagrant/scratch
nginx_pem: redmine.vm-rsa.pem nginx_pem: redmine.vm-rsa.pem
installer_package_name: easyredmine_2016_stable_u2072_vVersion_10_2_0.zip installer_package_name: installation-package_latest_43921320-9957-4066-9e2c-bfb611968507_2021-03-10.zip
installer_package_path: '{{ remote_scratch_path }}/{{ installer_package_name }}' installer_package_path: '{{ remote_scratch_path }}/{{ installer_package_name }}'
installer_package_url: 'http://software.apidb.org/source/easyredmine/{{ installer_package_name }}' installer_package_url: 'https://software.apidb.org/source/easyredmine/{{ installer_package_name }}'
redmine_db_dump_file: '{{ remote_scratch_path }}/redmine_dump.sql.gz' redmine_db_dump_file: '{{ remote_scratch_path }}/redmine_dump.sql.gz'
redmine_root_dir: /opt/easyredmine redmine_root_dir: /opt/easyredmine
mysql_admin_login: root mysql_admin_login: root
@@ -37,7 +36,7 @@ smtp_authentication: plain
smtp_enable_starttls: yes smtp_enable_starttls: yes
smtp_openssl_verify_mode: peer smtp_openssl_verify_mode: peer
swap_add_mb: 512 swap_add_mb: 512
ruby_version: 2.7.1 ruby_version: 2.6.6
is_production_vm: no is_production_vm: no
redmine_files_nfs_mount: '' # /mnt/redminefiles redmine_files_nfs_mount: '' # /mnt/redminefiles
redmine_files_nfs_source: '' # 171.26.20.75:/srv/easyredmine redmine_files_nfs_source: '' # 171.26.20.75:/srv/easyredmine
@@ -45,6 +44,10 @@ _redmine_db_import_file: /tmp/redmine_dump.sql
_redmine_db_import_success: /tmp/redmine_db_import_success _redmine_db_import_success: /tmp/redmine_db_import_success
_redmine_install_wrapper: '/home/{{ redmine_owner }}/install_wrapper' _redmine_install_wrapper: '/home/{{ redmine_owner }}/install_wrapper'
firewall_addrs:
- 192.168.0.0/16
- 172.16.0.0/16
# rvm1-ansible module vars # rvm1-ansible module vars
rvm1_rubies: rvm1_rubies:
- 'ruby-{{ ruby_version }}' - 'ruby-{{ ruby_version }}'
@@ -52,3 +55,10 @@ rvm1_bundler_install: yes
rvm1_install_path: '/home/{{ redmine_owner }}/.rvm' rvm1_install_path: '/home/{{ redmine_owner }}/.rvm'
rvm1_rvm_check_for_updates: no rvm1_rvm_check_for_updates: no
rvm1_user: '{{ redmine_owner }}' rvm1_user: '{{ redmine_owner }}'
# Unprioritize dead key server, see: https://github.com/rvm/rvm1-ansible/issues/228
rvm1_gpg_key_servers:
- hkp://pgp.mit.edu
- hkp://keyserver.pgp.com
- '{{ rvm1_gpg_key_server }}'
#- hkp://ipv4.pool.sks-keyservers.net

View File

@@ -2,8 +2,6 @@
- hosts: all - hosts: all
become: yes become: yes
gather_facts: yes gather_facts: yes
vars_files:
- config.yml
roles: roles:
- { role: rvm.ruby, tags: ruby, become: yes } - { role: rvm.ruby, tags: ruby, become: yes }

View File

@@ -1,6 +1,20 @@
- name: install mysql, mariadb packages - name: Download MariaDB installation script
get_url:
url: https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
dest: '{{ remote_scratch_path }}/mariadb_repo_setup'
mode: '0700'
- name: Install MariaDB repo via script
shell: '{{ remote_scratch_path }}/mariadb_repo_setup'
args:
creates: /etc/yum.repos.d/mariadb.repo
become: yes
- name: Install MariaDB
yum: yum:
name: ['mysql-devel', 'mariadb-server', 'MySQL-python'] name: ['mysql-devel', 'MariaDB-server', 'MySQL-python', 'MariaDB-shared']
state: present
update_cache: yes
become: yes become: yes
- name: manage MySql/MariaDB database service - name: manage MySql/MariaDB database service
@@ -42,6 +56,8 @@
target: '{{ _redmine_db_import_file }}' target: '{{ _redmine_db_import_file }}'
login_user: '{{ mysql_admin_login }}' login_user: '{{ mysql_admin_login }}'
login_password: '{{ mysql_admin_password }}' login_password: '{{ mysql_admin_password }}'
login_unix_socket: '/var/lib/mysql/mysql.sock'
become: yes
register: redmine_db_import register: redmine_db_import
when: do_redmine_db_import == True and (redmine_db_import_done.stat.exists == False or redmine_db_created is changed) when: do_redmine_db_import == True and (redmine_db_import_done.stat.exists == False or redmine_db_created is changed)

View File

@@ -27,11 +27,7 @@
rich_rule: 'rule service name="ssh" family="ipv4" source address="{{ item }}" accept' rich_rule: 'rule service name="ssh" family="ipv4" source address="{{ item }}" accept'
permanent: true permanent: true
state: enabled state: enabled
with_items: with_items: "{{ firewall_addrs }}"
- 128.192.75.0/24
- 192.168.0.0/16
- 172.16.0.0/16
- 128.91.49.0/24
become: yes become: yes
notify: restart firewalld notify: restart firewalld
when: is_production_vm == True when: is_production_vm == True

View File

@@ -10,12 +10,12 @@
tags: database tags: database
when: do_database_management == True when: do_database_management == True
- import_tasks: redmine.yml - import_tasks: redmine.yml
tags: redmine tags: redmine
- import_tasks: nginx.yml - import_tasks: nginx.yml
tags: nginx tags: nginx
- import_tasks: attachments_storage.yml - import_tasks: attachments_storage.yml
tags: attachments_storage tags: attachments_storage
when: is_production_vm == True when: is_production_vm == True and do_nfs_storage == True

View File

@@ -68,6 +68,7 @@
src: '{{ nginx_pem }}' src: '{{ nginx_pem }}'
become: yes become: yes
notify: restart nginx notify: restart nginx
when: not is_production_vm
- name: manage Nginx service - name: manage Nginx service
service: service:

View File

@@ -1,8 +1,14 @@
- name: install redmine package depdendencies - name: install redmine package dependencies
yum: yum:
name: ['mysql-devel', 'unzip', 'rubygems', 'ruby-devel', 'libuuid-devel', name: ['mysql-devel', 'unzip', 'rubygems', 'ruby-devel', 'libuuid-devel',
'zlib-devel', 'openssl-devel', 'gcc-c++', 'ImageMagick-devel', 'zlib-devel', 'openssl-devel', 'gcc-c++', 'ImageMagick-devel',
'expect', 'subversion', 'git'] 'expect', 'subversion', 'git', 'epel-release']
become: yes
- name: install javascript runtime
yum:
name: 'nodejs'
update_cache: yes
become: yes become: yes
# these gems are not user_install but the RVM path is for local redmine # these gems are not user_install but the RVM path is for local redmine
@@ -96,17 +102,6 @@
when: do_redmine_installer == True when: do_redmine_installer == True
become: yes become: yes
- name: install custom login background image
copy:
dest: '{{ item }}'
src: '{{ easyredmine_login_bg_img }}'
owner: '{{ redmine_owner }}'
with_items:
- '{{ redmine_root_dir }}/public/plugin_assets/easy_extensions/images/login-bg.jpg'
- '{{ redmine_root_dir }}/public/assets/{{ easyredmine_login_bg_img }}'
when: do_redmine_installer == True
become: yes
- name: create maintenance dir - name: create maintenance dir
file: file:
path: '/usr/share/nginx/html/easyredmine' path: '/usr/share/nginx/html/easyredmine'

View File

@@ -1,6 +1,14 @@
- import_tasks: addswap.yml - import_tasks: addswap.yml
# Temporary workaround for outdated vagrant box base
- name: upgrade all packages
yum:
name: '*'
state: latest
update_cache: yes
become: yes
- name: install system tools - name: install system tools
yum: yum:
name: ['rsync', 'strace', 'nmap', 'yum-utils', 'sendmail', name: ['rsync', 'strace', 'nmap', 'yum-utils', 'sendmail',

View File

@@ -7,6 +7,6 @@ cd {{ redmine_root_dir }}
[[ -s "{{ rvm1_install_path }}/scripts/rvm" ]] && \ [[ -s "{{ rvm1_install_path }}/scripts/rvm" ]] && \
source "{{ rvm1_install_path }}/scripts/rvm" source "{{ rvm1_install_path }}/scripts/rvm"
{{ rvm1_install_path }}/gems/ruby-{{ ruby_version }}/bin/bundle exec rake \ {{ rvm1_install_path }}/rubies/ruby-{{ ruby_version }}/bin/bundle exec rake \
eupathdb:fetch_changesets \ eupathdb:fetch_changesets \
RAILS_ENV="production" RAILS_ENV="production"

View File

@@ -5,11 +5,11 @@ cd {{ redmine_root_dir }}
[[ -s "{{ rvm1_install_path }}/scripts/rvm" ]] && \ [[ -s "{{ rvm1_install_path }}/scripts/rvm" ]] && \
source "{{ rvm1_install_path }}/scripts/rvm" source "{{ rvm1_install_path }}/scripts/rvm"
{{ rvm1_install_path }}/gems/ruby-{{ ruby_version }}/bin/bundle exec rake \ {{ rvm1_install_path }}/rubies/ruby-{{ ruby_version }}/bin/bundle exec rake \
redmine:email:receive_imap \ redmine:email:receive_imap \
RAILS_ENV="production" \ RAILS_ENV="production" \
project=sysdba \ project=sysdba \
allow_override=project,assigned_to,tracker,priority,category,status \ allow_override=project,assigned_to,tracker,priority,category,status,"VEuPathDB Team","Type of support","Component DB","Support source" \
host=imap.gmail.com \ host=imap.gmail.com \
port=993 ssl=SSL \ port=993 ssl=SSL \
username={{ smtp_username }} \ username={{ smtp_username }} \

13
vagrant-playbook.yml Normal file
View File

@@ -0,0 +1,13 @@
---
- hosts: all
become: yes
gather_facts: yes
vars_files:
- config.yml
roles:
- { role: rvm.ruby, tags: ruby, become: yes }
- { role: rvm.ruby.patch, tags: ruby, become: yes }
- { role: easyredmine, become: no }
tasks: