Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Dev: Add Amazon Linux box for rpm build tests #72

Merged
merged 1 commit into from
May 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev/icinga2x-awslinux/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vagrant
9 changes: 9 additions & 0 deletions dev/icinga2x-awslinux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Development box for building RPMS on Amazon Linux

More details inside https://github.com/Icinga/icinga2/blob/master/INSTALL.md


Required changes:

- https://github.com/Icinga/icinga2/pull/5304
- https://github.com/Icinga/icinga2/pull/5303
119 changes: 119 additions & 0 deletions dev/icinga2x-awslinux/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"
VAGRANT_REQUIRED_VERSION = "1.6.5"
VAGRANT_REQUIRED_LINKED_CLONE_VERSION = "1.8.4"

# Require 1.6.5 at least
if ! defined? Vagrant.require_version
if Gem::Version.new(Vagrant::VERSION) < Gem::Version.new(VAGRANT_REQUIRED_VERSION)
puts "Vagrant >= " + VAGRANT_REQUIRED_VERSION + " required. Your version is " + Vagrant::VERSION
exit 1
end
else
Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION
end

nodes = { 'icinga2x-awslinux' => {
:box_virtualbox => 'mvbcoding/awslinux',
:box_parallels => 'mvbcoding/awslinux',
:box_libvirt => 'mvbcoding/awslinux',
:net => 'dev.local',
:hostonly => '192.168.33.192',
:memory => '4096',
:cpus => '4',
:mac => '020027001900',
:fowarded => {
'443' => '8443',
'80' => '8082',
'22' => '2082'
}
}
}

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
nodes.each_pair do |name, options|
config.vm.define name do |node_config|
node_config.vm.box = options[:box_virtualbox]
node_config.vm.hostname = name
node_config.vm.box_url = options[:url] if options[:url]
if options[:forwarded]
options[:forwarded].each_pair do |guest, local|
node_config.vm.network "forwarded_port", guest: guest, host: local
end
end

node_config.vm.network :private_network, ip: options[:hostonly] if options[:hostonly]

# provider: parallels
node_config.vm.provider :parallels do |p, override|
override.vm.box = options[:box_parallels]
override.vm.boot_timeout = 600

p.name = "Icinga 2: #{name.to_s}"
p.update_guest_tools = false
p.linked_clone = true if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new(VAGRANT_REQUIRED_LINKED_CLONE_VERSION)

# Set power consumption mode to "Better Performance"
p.customize ["set", :id, "--longer-battery-life", "off"]

p.memory = options[:memory] if options[:memory]
p.cpus = options[:cpus] if options[:cpus]
end

# provider: virtualbox
node_config.vm.provider :virtualbox do |vb, override|
if Vagrant.has_plugin?("vagrant-vbguest")
node_config.vbguest.auto_update = false
end
vb.linked_clone = true if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new(VAGRANT_REQUIRED_LINKED_CLONE_VERSION)
vb.name = name
vb.gui = options[:gui] if options[:gui]
vb.customize ["modifyvm", :id,
"--groups", "/Icinga Vagrant/" + options[:net],
"--memory", "512",
"--cpus", "1",
"--audio", "none",
"--usb", "on",
"--usbehci", "off",
"--natdnshostresolver1", "on"
]
vb.memory = options[:memory] if options[:memory]
vb.cpus = options[:cpus] if options[:cpus]
end

# provider: libvirt
node_config.vm.provider :libvirt do |lv, override|
override.vm.box = options[:box_libvirt]
lv.memory = options[:memory] if options[:memory]
lv.cpus = options[:cpus] if options[:cpus]
end

# provisioner: ensure that hostonly network is up
#
# workaround for Vagrant >1.8.4-1.9.1 not bringing up eth1 properly
# https://github.com/mitchellh/vagrant/issues/8096
node_config.vm.provision "shell", inline: "service network restart", run: "always"

# provisioner: install requirements
# node_config.vm.provision :shell, :path => "../../scripts/shell_provisioner.sh" # MODIFY

# provisioner: install box using puppet manifest
# node_config.vm.provision :puppet do |puppet|
# puppet.module_path = "../../modules" # MODIFY
# puppet.manifests_path = "manifests"
# puppet.hiera_config_path = "hiera.yaml"
# #puppet.options = "--verbose --debug --parser=future"
# puppet.options = "--parser=future"
# end

# print a friendly message
node_config.vm.provision "shell", inline: <<-SHELL
echo "Finished installing the Vagrant box '#{name}'."
echo "Navigate to http://#{options[:hostonly]}"
SHELL
end
end
end