1
0
mirror of https://github.com/krislamo/vagrant-easyredmine synced 2024-12-16 15:30:34 +00:00

improve Ansible support for production vs vagrant installs

This commit is contained in:
Mark Heiges 2015-12-27 15:37:23 -05:00
parent 342ea54a6f
commit ba9c5049a1
6 changed files with 25 additions and 19 deletions

View File

@ -11,9 +11,13 @@ Once provisioned, Redmine should be available at http://redmine.vm.apidb.org/
## Requirements ## Requirements
- `rvm1-ansible` Ansible module - Vagrant installed on your local host
ansible-galaxy install rvm_io.rvm1-ruby - Ansible [installed on your local host](http://docs.ansible.com/ansible/intro_installation.html)
- `rvm1-ansible` Ansible module installed on your local host
$ ansible-galaxy install rvm_io.rvm1-ruby
- Vagrant `landrush` plugin - Vagrant `landrush` plugin
@ -21,7 +25,7 @@ Once provisioned, Redmine should be available at http://redmine.vm.apidb.org/
- `scratch/redmine_dump.sql.gz` - a mysql dump of our production - `scratch/redmine_dump.sql.gz` - a mysql dump of our production
database. _(One of the daily backups on our production Redmine server database. _(One of the daily backups on our production Redmine server
is suitable. See `/var/lib/mysql.backups/daily/redmine/`.)_ This is is suitable. See `/var/lib/mysql.backups/daily/easyredmine/`.)_ This is
optional. To have the redmine installer create an empty database, set optional. To have the redmine installer create an empty database, set
`do_redmine_db_import` to `False` in `config.yml` `do_redmine_db_import` to `False` in `config.yml`

9
Vagrantfile vendored
View File

@ -2,8 +2,7 @@ Vagrant.configure(2) do |config|
config.ssh.forward_agent = 'true' config.ssh.forward_agent = 'true'
config.vm.box = "ebrc/centos-7.1-64-nocm" config.vm.box = "ebrc/centos-7-64-puppet"
config.vm.box_url = 'http://software.apidb.org/vagrant/centos-7.1-64-nocm.json'
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'
@ -13,9 +12,9 @@ Vagrant.configure(2) do |config|
config.landrush.tld = 'vm.apidb.org' config.landrush.tld = 'vm.apidb.org'
end end
config.vm.provision 'bootstrap', type: 'ansible' do |ansible| # config.vm.provision 'bootstrap', type: 'ansible' do |ansible|
ansible.playbook = 'bootstrap.yml' # ansible.playbook = 'bootstrap.yml'
end # end
config.vm.provision 'deploy', type: 'ansible' do |ansible| config.vm.provision 'deploy', type: 'ansible' do |ansible|
ansible.playbook = 'playbook.yml' ansible.playbook = 'playbook.yml'

View File

@ -2,15 +2,16 @@
- hosts: all - hosts: all
sudo: false sudo: false
gather_facts: false gather_facts: false
#vars_files: vars_files:
# - production_config.yml #- production_config.yml
- config.yml
tasks: tasks:
# match uid with NFS server # match uid with NFS server
- name: Create user of Redmine installation - name: Create user of Redmine installation
user: name='{{ redmine_owner }}' user: name='{{ redmine_owner }}'
uid=1303 uid='{{ redmine_uid }}'
state=present state=present
ssh_key_file=.ssh/id_rsa ssh_key_file=.ssh/id_rsa

View File

@ -1,11 +1,12 @@
redmine_mail_alias: redmine@localhost redmine_mail_alias: redmine@localhost
redmine_owner: vagrant redmine_owner: vagrant
redmine_uid: ''
redmine_owner_ssh_pub_keys: redmine_owner_ssh_pub_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAvijH8y7CL9TxWCucjgXRa2q3l0Nc9JW7/SAFHVgt/FYClenS0DMN0nGm1I4z2mtftt8gHz5f6PNqyvfc3F0JcOqiuH9qP79FQ6c8rDmqQEqOuBrufPX11y/9IESIJ0aQ5feQP+WooR6bo/O7BFJS005S3foA/iLphf+smLrW44k= mheiges@sapote.local - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAvijH8y7CL9TxWCucjgXRa2q3l0Nc9JW7/SAFHVgt/FYClenS0DMN0nGm1I4z2mtftt8gHz5f6PNqyvfc3F0JcOqiuH9qP79FQ6c8rDmqQEqOuBrufPX11y/9IESIJ0aQ5feQP+WooR6bo/O7BFJS005S3foA/iLphf+smLrW44k= mheiges@sapote.local
- ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBKXyFF/K1AT52FGrq5Z27guGgHDELy8W8NInAgrDQZQP+U5ORs9wB8SsuD8vyhYy3G2Tz8xAKCxWcFHvuNDv4VIg8D6ge7VMdWHGtbS8UC153dK3mMQ+CMTgJsezqgk0j4/ot7LaQ6yurb8t27TOHeqEdHyB5O/eL6pYntsKqEWQ== mguidry@uga.edu - ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBKXyFF/K1AT52FGrq5Z27guGgHDELy8W8NInAgrDQZQP+U5ORs9wB8SsuD8vyhYy3G2Tz8xAKCxWcFHvuNDv4VIg8D6ge7VMdWHGtbS8UC153dK3mMQ+CMTgJsezqgk0j4/ot7LaQ6yurb8t27TOHeqEdHyB5O/eL6pYntsKqEWQ== mguidry@uga.edu
do_database_management: True # no import unless management == true do_database_management: True
do_redmine_db_import: True do_redmine_db_import: True # no import unless do_database_management is also true
do_redmine_installer: True do_redmine_installer: True
remote_scratch_path: /vagrant/scratch remote_scratch_path: /vagrant/scratch
nginx_pem: redmine.vm-rsa.pem nginx_pem: redmine.vm-rsa.pem

View File

@ -3,6 +3,7 @@
- include: system.yml tags=system - include: system.yml tags=system
- include: firewall.yml tags=firewall - include: firewall.yml tags=firewall
when: is_production_vm == True
- include: database.yml tags=database - include: database.yml tags=database
when: do_database_management == True when: do_database_management == True

View File

@ -41,12 +41,6 @@
mode=750 mode=750
sudo: no sudo: no
- name: add redmine IMAP fetch script
template: dest='{{ redmine_root_dir }}/script/redmine_receive_imap'
src=redmine_receive_imap.j2
mode=750
sudo: no
- name: delete contents of redmine root directory - name: delete contents of redmine root directory
file: path='{{ redmine_root_dir }}' file: path='{{ redmine_root_dir }}'
state=absent state=absent
@ -89,6 +83,12 @@
user='{{ redmine_owner }}' user='{{ redmine_owner }}'
sudo: yes sudo: yes
- name: add redmine IMAP fetch script
template: dest='{{ redmine_root_dir }}/script/redmine_receive_imap'
src=redmine_receive_imap.j2
mode=750
sudo: no
- name: adding redmine_receive_imap crontab - name: adding redmine_receive_imap crontab
cron: name="fetch from imap" cron: name="fetch from imap"
minute="*/5" minute="*/5"