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

Commit

Permalink
Replace VirtualBox base box with 'bento/centos-7.3'
Browse files Browse the repository at this point in the history
Explicitly disable SELinux.

refs #17
  • Loading branch information
Michael Friedrich committed Apr 25, 2017
1 parent 40148ee commit a4a570e
Show file tree
Hide file tree
Showing 23 changed files with 457 additions and 197 deletions.
44 changes: 19 additions & 25 deletions dev/icinga1x-dev/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,27 @@ else
Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION
end

# inspired by https://github.com/lbetz/vagrant-icinga-book/blob/master/Vagrantfile
nodes = { 'icinga1-dev' => {
:box => 'centos/7',
:mac => '020027000099',
:net => 'icinga1-dev.demo.local',
:hostonly => '192.168.33.190',
:memory => '2048',
:cpu => '2',
:fowarded => {
'443' => '8443',
'80' => '8082',
'22' => '2082'
}
:box_virtualbox => 'bento/centos-7.3',
:box_parallels => 'parallels/centos-7.3',
:box_libvirt => 'centos/7',
:net => 'dev.local',
:hostonly => '192.168.33.190',
:memory => '2048',
:cpu => '2',
: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]
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]
Expand All @@ -47,7 +48,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

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

p.name = "Icinga 2: #{name.to_s}"
Expand All @@ -63,11 +64,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# provider: virtualbox
node_config.vm.provider :virtualbox do |vb, override|
unless Vagrant.has_plugin?("vagrant-vbguest")
raise 'vagrant-vbguest is not installed! Run "vagrant plugin install vagrant-vbguest"'
end
node_config.vbguest.auto_update = true
node_config.vm.synced_folder '.', '/vagrant', :type => 'virtualbox' # avoid rsync
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]
Expand All @@ -78,17 +74,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
"--audio", "none",
"--usb", "on",
"--usbehci", "off",
"--natdnshostresolver1", "on",
#"--nic2", "intnet",
#"--intnet2", options[:net],
#"--macaddress2". options[:mac]
"--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
Expand All @@ -100,11 +94,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
node_config.vm.provision "shell", inline: "service network restart", run: "always"

# provisioner: install requirements
node_config.vm.provision :shell, :path => "../../scripts/shell_provisioner.sh" # icinga1x-dev specific modification
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" # icinga1x-dev specific modification
puppet.module_path = "../../modules" # MODIFY
puppet.manifests_path = "manifests"
puppet.hiera_config_path = "hiera.yaml"
#puppet.options = "--verbose --debug --parser=future"
Expand Down
4 changes: 4 additions & 0 deletions dev/icinga1x-dev/manifests/default.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
include icinga_rpm
include monitoring_plugins

class { 'selinux':
mode => 'disabled'
}

####################################
# Database
####################################
Expand Down
4 changes: 0 additions & 4 deletions dev/icinga1x-dev/manifests/finalize.sh

This file was deleted.

26 changes: 0 additions & 26 deletions dev/icinga1x-dev/manifests/puppet.sh

This file was deleted.

4 changes: 2 additions & 2 deletions dev/icinga2x-freebsd/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ end
nodes = { 'icinga2-freebsd' => {
:box => 'freebsd/FreeBSD-11.0-STABLE',
:mac => '080027D14C66',
:net => 'icinga2-freebsd.demo.local',
:net => 'dev.local',
:hostonly => '192.168.33.9',
:memory => '2048',
:cpu => '2',
:cpu => '2',
:fowarded => {
'443' => '8443',
'80' => '8082',
Expand Down
93 changes: 93 additions & 0 deletions dev/icinga2x-icingadb/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"
VAGRANT_REQUIRED_VERSION = "1.6.5"

# 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

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

servers = { 'icinga2' => '192.168.33.199'
}
http_port = { 'icinga2' => 8082
}
ssh_port = { 'icinga2' => 2082
}
redis_port = { 'icinga2' => 6082
}

servers.each do |server_name, server_ip|
config.vm.define server_name do |app_config|

# network config
app_config.vm.hostname = "#{server_name.to_s}"
#app_config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", disabled: true
app_config.vm.network :forwarded_port, guest: 22, host: ssh_port[server_name], auto_correct: true
app_config.vm.network :forwarded_port, guest: 80, host: http_port[server_name], auto_correct: true
app_config.vm.network :forwarded_port, guest: 6379, host: redis_port[server_name], auto_correct: true
app_config.vm.network :private_network, ip: "#{server_ip}"

app_config.vm.provision :shell, :path => "manifests/puppet.sh"

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

# parallels
app_config.vm.provider :parallels do |p, override|
override.vm.box = "parallels/centos-7.2"

p.name = "Icinga 2: #{server_name.to_s}"

# Update Parallels Tools automatically
p.update_guest_tools = false

override.vm.boot_timeout = 600

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

p.memory = 2048
p.cpus = 2
end

# virtualbox
app_config.vm.provider :virtualbox do |v, override|
override.vm.box = "centos-71-x64-vbox"
override.vm.box_url = "http://boxes.icinga.com/centos-71-x64-vbox.box"

v.customize ["modifyvm", :id, "--memory", "2048"]
v.customize ["modifyvm", :id, "--cpus", "2"]
# Using the host's resolver as a DNS proxy in NAT mode
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end

app_config.vm.provider :libvirt do |l, override|
override.vm.box = "centos/7"

l.memory = 2048
l.cpus = 2
end

# provisioner
app_config.vm.provision :puppet do |puppet|
puppet.module_path = "../../modules"
puppet.manifests_path = "manifests"
puppet.hiera_config_path = "hiera.yaml"
#puppet.options = "--verbose --debug --parser=future"
puppet.options = "--parser=future"
end
app_config.vm.provision :shell, :path => "manifests/finalize.sh"
end
end
end

9 changes: 9 additions & 0 deletions dev/icinga2x-icingadb/hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
:backends:
- yaml

:hierarchy:
- "common"

:yaml:
:datadir: '/vagrant/hiera'
4 changes: 4 additions & 0 deletions dev/icinga2x-icingadb/hiera/settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
servers:
- hostname: icinga2
ipaddress: 192.168.33.5
Loading

0 comments on commit a4a570e

Please sign in to comment.