#!/usr/bin/env ruby
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'
ENV['PATH'] = '/usr/bin:%s' % ENV['PATH']

Vagrant.configure('2') do |config|
  config.omnibus.chef_version = :latest
  config.berkshelf.enabled = true
  config.vm.define 'vagrant' do |node|
    node.vm.box = 'bento/ubuntu-14.04'
    node.vm.hostname = 'vagrant'
    node.vm.network :private_network, ip: '10.10.10.9'
    node.vm.provision :chef_solo do |chef|
      chef.log_level = :debug
      chef.json = {
        'logrotate' => {
          'policies' => {
            'dne' => false,
            'example' => {
              nil => { # global
                'size' => '1G',
                'compress' => nil,
                'delaycompress' => nil,
                'copytruncate' => nil,
                'notifempty' => nil,
                'missingok' => nil
              },
              '/var/log/example.log' => {
                'daily' => nil,
                'rotate' => 7,
              }
            }
          }
        }
      }
      chef.run_list = %w(
        recipe[apt]
        recipe[bjn_logrotate]
        recipe[minitest-handler]
      )
    end
  end
end