summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Vagrantfile8
-rw-r--r--vagrant_support/apache.yml2
-rwxr-xr-xvagrant_support/bmo-checksetup.j26
-rw-r--r--vagrant_support/checksetup.yml5
-rw-r--r--vagrant_support/playbook.yml4
-rw-r--r--vagrant_support/update.yml23
6 files changed, 43 insertions, 5 deletions
diff --git a/Vagrantfile b/Vagrantfile
index 96faf1392..2a1c4e9c4 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -36,7 +36,7 @@ Vagrant.configure('2') do |config|
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
- config.vm.provision 'ansible_local', run: 'always' do |ansible|
+ config.vm.provision 'main', type: 'ansible_local', run: 'always' do |ansible|
ansible.playbook = 'vagrant_support/playbook.yml'
ansible.extra_vars = {
WEB_IP: WEB_IP,
@@ -47,6 +47,12 @@ Vagrant.configure('2') do |config|
}
end
+ if ARGV.include? '--provision-with'
+ config.vm.provision 'update', type: 'ansible_local', run: 'never' do |update|
+ update.playbook = 'vagrant_support/update.yml'
+ end
+ end
+
config.vm.define 'db' do |db|
db.vm.box = 'centos/6'
diff --git a/vagrant_support/apache.yml b/vagrant_support/apache.yml
index e4399f612..c7159371c 100644
--- a/vagrant_support/apache.yml
+++ b/vagrant_support/apache.yml
@@ -4,9 +4,11 @@
src: apache.j2
dest: /etc/httpd/conf.d/bugzilla.conf
mode: 0644
+ when: LAZY == 0
- name: enable httpd
service: name=httpd enabled=yes
+ when: LAZY == 0
- name: restart httpd
service: name=httpd state=restarted
diff --git a/vagrant_support/bmo-checksetup.j2 b/vagrant_support/bmo-checksetup.j2
index c35a323c3..a2695d0cf 100755
--- a/vagrant_support/bmo-checksetup.j2
+++ b/vagrant_support/bmo-checksetup.j2
@@ -3,10 +3,10 @@
cd /vagrant
if [[ ! -f ~/localconfig || ! -f /data/params ]]; then
- perl checksetup.pl /home/vagrant/checksetup_answers.txt
- perl checksetup.pl /home/vagrant/checksetup_answers.txt
+ perl checksetup.pl "$@" /home/vagrant/checksetup_answers.txt
+ perl checksetup.pl "$@" /home/vagrant/checksetup_answers.txt
else
cp ~/localconfig /vagrant
- perl checksetup.pl < /dev/null
+ perl checksetup.pl "$@" < /dev/null
cp /vagrant/localconfig ~/
fi
diff --git a/vagrant_support/checksetup.yml b/vagrant_support/checksetup.yml
index 6b54ef18d..580cc9dd9 100644
--- a/vagrant_support/checksetup.yml
+++ b/vagrant_support/checksetup.yml
@@ -4,12 +4,14 @@
src: bmo-checksetup.j2
dest: /usr/local/bin/bmo-checksetup
mode: 0755
+ when: LAZY == 0
- name: bmo generate data script
template:
src: bmo-generate-data.j2
dest: /usr/local/bin/bmo-generate-data
mode: 0755
+ when: LAZY == 0
- name: bmo checksetup answers
template:
@@ -18,10 +20,11 @@
owner: vagrant
group: vagrant
mode: 0644
+ when: LAZY == 0
- name: run checksetup
become: false
- shell: sg apache -c '/usr/local/bin/bmo-checksetup'
+ shell: sg apache -c '/usr/local/bin/bmo-checksetup --no-templates'
- name: generate data
become: false
diff --git a/vagrant_support/playbook.yml b/vagrant_support/playbook.yml
index f89d5295e..f5ff7335a 100644
--- a/vagrant_support/playbook.yml
+++ b/vagrant_support/playbook.yml
@@ -168,11 +168,15 @@
mode: 0755
- include: checksetup.yml
+ vars:
+ LAZY: 0
- include: cron.yml
- include: jobqueue.yml
- include: push.yml
- include: email.yml
- include: apache.yml
+ vars:
+ LAZY: 0
- include: devtools.yml
- name: fix owner of /vagrant/template_cache
diff --git a/vagrant_support/update.yml b/vagrant_support/update.yml
new file mode 100644
index 000000000..879345c57
--- /dev/null
+++ b/vagrant_support/update.yml
@@ -0,0 +1,23 @@
+---
+- hosts: web
+ become: true
+ tasks:
+
+ - name: add local symlink
+ file: path=/vagrant/local src=/opt/bmo/local state=link force=true
+
+ - name: make bmo data dir
+ file: path=/data state=directory owner=vagrant group=apache mode=0775
+
+ - name: fix owner of /vagrant
+ file: path=/vagrant state=directory owner=vagrant group=apache recurse=yes
+
+ - name: add data symlink
+ file: path=/vagrant/data src=/data state=link force=true
+
+ - include: checksetup.yml
+ vars:
+ LAZY: 1
+ - include: apache.yml
+ vars:
+ LAZY: 1 \ No newline at end of file