--- /dev/null
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure(2) do |config|
+ # Target platform is Debian/jessie
+ config.vm.box = "debian/contrib-jessie64"
+
+ # Set up a forwarded port for testing
+ config.vm.network "forwarded_port", guest: 8983, host: 8983
+
+ config.vm.provision "ansible" do |ansible|
+ ansible.playbook = "dev-deploy.yml"
+ end
+end
--- /dev/null
+---
+- hosts: default
+
+ vars:
+
+ tasks:
+ - name: Update apt-cache
+ become: yes
+ apt: update-cache=yes
+
+ - name: Install dependencies from apt
+ become: yes
+ apt: name={{ item }} state=present
+ with_items:
+ - openjdk-7-jdk
+
+ - name: Create deployment environment
+ become: yes
+ file: path={{ item }} state=directory
+ with_items:
+ - /usr/share/masterkey/lui
+ - /var/lib/masterkey/lui/data/lui
+ - /var/log/masterkey/lui
+ - /etc/masterkey
+
+ - name: Create lui-solr account
+ become: yes
+ user: name=lui-solr state=present system=yes home=/var/lib/masterkey/lui
+
+ - name: Update permissions on deployment directories
+ become: yes
+ file: path={{ item }} owner=lui-solr recurse=yes
+ with_items:
+ - /var/lib/masterkey/lui
+ - /var/log/masterkey/lui
+
+ - name: Link Solr configuration
+ become: yes
+ file: src=/vagrant/conf path=/etc/masterkey/lui state=link
+
+ - name: Link Solr defaults
+ become: yes
+ file: src=/etc/masterkey/lui/lui-solr.in.sh path=/etc/default/lui-solr.in.sh state=link
+
+ - name: Install Solr binary
+ become: yes
+ command: /vagrant/dist/install_solr_service.sh /vagrant/dist/solr-5.5.1.tgz -d /var/lib/masterkey/lui -i /usr/share/masterkey/lui -s lui-solr -u lui-solr -f creates=/usr/share/masterkey/lui/solr-5.5.1
+
+ - name: Remove extra files created by Solr install
+ become: yes
+ file: path={{ item }} state=absent
+ with_items:
+ - /var/lib/masterkey/lui/log4j.properties
+ - /var/lib/masterkey/lui/logs
+ - /var/lib/masterkey/lui/data/solr.xml