The guide below will help you to install latest version of JIRA (at the time of writing this article – version 7) in the VirtualBox VM, using Vagrant and Chef.
We won’t be creating any Chef cookbooks, we’ll just re-use the existing jira cookbook from the Chef supermarket.
We will also be using Berkshelf to handle the cookbook dependencies for us and Vagrant bento/centos-6.7 box that is available on hashicorp site, but you should be able to use any other Vagrant box as long as the jira cookbook supports it.

1. Install VirtualBox

  • I recommend using version 4.3 as version 5 still seems bit unstable to me.
  • You can disable VirtualBox updates to stay on 4.3. Use GUI or this:
    1
    
    VBoxManage setextradata global GUI/UpdateDate never

2. Install Vagrant

  • I recommend installation of the vagrant-vbguest plugin to recompile guest additions:
    1
    
    vagrant plugin install vagrant-vbguest
  • If you’re behind proxy, install also vagrant-proxyconf plugin:
    1
    
    vagrant plugin install vagrant-proxyconf

3. Install ChefDK (Berkshelf)
4. Install vagrant-berkshelf plugin:

1
vagrant plugin install vagrant-berkshelf

5. Create some directory and go to that directory:

1
2
mkdir jira
cd jira

6. Create Berksfile – jira/Berksfile:

1
2
source "https://supermarket.chef.io"
cookbook 'jira', '~> 2.7.0'

7. Create Vagrantfile – jira/Vagrantfile:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Vagrant.configure(2) do |config|
  # I am using centos-6.7 box, but others should work too...
  config.vm.box = "bento/centos-6.7" 
  config.vm.network "forwarded_port", guest: 8080, host: 8080
  config.vm.network "forwarded_port", guest: 443, host: 443
  config.vm.network "private_network", type: "dhcp"
  config.vm.provider "virtualbox" do |vb|
  # I am using 2GB of ram and 4 cpus as JIRA is resource hungry, adjust as needed
  # natdnshostresolver1 means that VirtualBox will use your host DNS to resolve hostnames
  vb.memory = 2048
     vb.cpus = 4
     vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  end
  # enable Berkshelf, the Chef dependency management
  config.berkshelf.enabled = true
  # use jira cookbook to provision this box
  # jira cookbook will also create mysql database by default
  # mysql server password is mandatory for jira cookbook, otherwise the provisioning will fail, change it if you need to or leave it as it is
  config.vm.provision "chef_solo" do |chef|
    chef.add_recipe "jira"
    chef.json = {
    "mysql" => {
      "server_root_password" => "mysql"
    }
  }
  end
  # if you're using proxy and you installed vagrant-proxyconf plugin, set it up here
  if Vagrant.has_plugin?("vagrant-proxyconf")
    config.proxy.http     = "http://someproxy:8080"
    config.proxy.https    = "http://someproxy:8080"
    config.proxy.no_proxy = "localhost,127.0.0.1"
  end
  # optional - ssh agent forwarding
  config.ssh.forward_agent = true
end

8. You should now have the following structure:

1
2
3
+ jira/
++ Berksfile
++ Vagrantfile

9. Run Vagrant and let the provisioning finish:

1
vagrant up

10. Open browser and navigate to http://localhost:8080 or https://localhost

Note:
If there a is problem with JIRA startup because of some plugin timeout, increase the plugin startup timeout in /opt/atlassian/jira/bin/setenv.sh:

1
JVM_SUPPORT_RECOMMENDED_ARGS="-Datlassian.plugins.enable.wait=300"

Enjoy!

, , , , , , , ,

Very interesting reading on Docker vs Chef:
https://blog.relateiq.com/why-docker-why-not-chef/

, , ,