]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Skipping some steps in ansible for rapid debugging (#92)
authorSebastin Santy <sebastinssanty@gmail.com>
Thu, 8 Jun 2017 17:37:52 +0000 (23:07 +0530)
committerDylan William Hardison <dylan@hardison.net>
Thu, 8 Jun 2017 17:37:52 +0000 (13:37 -0400)
* Adding --no-templates to checksetup

* my proposed changes

Vagrantfile
vagrant_support/apache.yml
vagrant_support/bmo-checksetup.j2
vagrant_support/checksetup.yml
vagrant_support/playbook.yml
vagrant_support/update.yml [new file with mode: 0644]

index 96faf13920c0e7f85d178de4212363058eafb82f..2a1c4e9c46d2747382a2428d1c96b74ef9dfbc5e 100644 (file)
@@ -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'
 
index e4399f6126d3a38d9b021090522ae7167425959d..c7159371c6efea651769fa90c7f3ebee530f4715 100644 (file)
@@ -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
index c35a323c355f5da8b126f13469933e2ebf96c956..a2695d0cf35abd8c7c0dd89e53a159bc40e53bad 100755 (executable)
@@ -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
index 6b54ef18d3d8617b1c67e84b96f2d9f288fcc99f..580cc9dd9f9f6e1e3f6cea536ec6eb45530ec87f 100644 (file)
@@ -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:
     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
index f89d5295e021c27ec79298b174521b21aa5d229d..f5ff7335a78952b42cdf16dbfa32d47e95e792b5 100644 (file)
         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 (file)
index 0000000..879345c
--- /dev/null
@@ -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