--- /dev/null
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure(2) do |config|
+ # Define and configure SolrCloud cluster
+ cloudservers = {
+ "node1" => "192.168.2.4",
+ "node2" => "192.168.2.5",
+ "node3" => "192.168.2.6"
+ }
+
+ cloudservers.each do |server_name, server_ip|
+ config.vm.define server_name do |cloudconfig|
+ cloudconfig.vm.box = "debian/contrib-jessie64"
+ cloudconfig.vm.host_name = server_name.to_s
+ cloudconfig.vm.network "private_network", ip: server_ip
+ end
+ end
+
+ # Zookeeper node
+ config.vm.define "zookeeper" do |zookeeper|
+ zookeeper.vm.box = "debian/contrib-jessie64"
+ zookeeper.vm.host_name = "zookeeper"
+ zookeeper.vm.network "private_network", ip: "192.168.2.3"
+ end
+
+ # Load balancer node
+ config.vm.define "loadbalancer" do |loadbalancer|
+ loadbalancer.vm.box = "debian/contrib-jessie64"
+ loadbalancer.vm.host_name = "loadbalancer"
+ loadbalancer.vm.network "private_network", ip: "192.168.2.2"
+ end
+
+ # Disable the default shared folder, share out project folder as /vagrant for all boxes
+ config.vm.synced_folder ".", "/vagrant", disabled: true
+ config.vm.synced_folder "..", "/vagrant"
+
+ # 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