From a4a570e2dbe8014319177aabbdb738a27dda15f8 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 25 Apr 2017 14:28:58 +0200 Subject: [PATCH] Replace VirtualBox base box with 'bento/centos-7.3' Explicitly disable SELinux. refs #17 --- dev/icinga1x-dev/Vagrantfile | 44 ++--- dev/icinga1x-dev/manifests/default.pp | 4 + dev/icinga1x-dev/manifests/finalize.sh | 4 - dev/icinga1x-dev/manifests/puppet.sh | 26 --- dev/icinga2x-freebsd/Vagrantfile | 4 +- dev/icinga2x-icingadb/Vagrantfile | 93 ++++++++++ dev/icinga2x-icingadb/hiera.yaml | 9 + dev/icinga2x-icingadb/hiera/settings.yaml | 4 + dev/icinga2x-icingadb/manifests/default.pp | 174 ++++++++++++++++++ icinga2x-cluster/Vagrantfile | 36 ++-- icinga2x-cluster/manifests/default.pp | 4 + icinga2x-elastic/Vagrantfile | 41 ++--- .../icinga2/features-available/logstash.conf | 12 ++ icinga2x-elastic/manifests/default.pp | 4 + icinga2x-graylog/Vagrantfile | 46 ++--- icinga2x-graylog/manifests/default.pp | 4 + icinga2x-ha-cluster/Vagrantfile | 46 +++-- icinga2x-ha-cluster/manifests/default.pp | 4 + icinga2x-influxdb/Vagrantfile | 41 ++--- icinga2x-influxdb/manifests/default.pp | 4 + icinga2x/Vagrantfile | 42 ++--- icinga2x/hiera/settings.yaml | 4 + icinga2x/manifests/default.pp | 4 + 23 files changed, 457 insertions(+), 197 deletions(-) delete mode 100644 dev/icinga1x-dev/manifests/finalize.sh delete mode 100644 dev/icinga1x-dev/manifests/puppet.sh create mode 100644 dev/icinga2x-icingadb/Vagrantfile create mode 100644 dev/icinga2x-icingadb/hiera.yaml create mode 100644 dev/icinga2x-icingadb/hiera/settings.yaml create mode 100644 dev/icinga2x-icingadb/manifests/default.pp create mode 100644 icinga2x-elastic/files/etc/icinga2/features-available/logstash.conf create mode 100644 icinga2x/hiera/settings.yaml diff --git a/dev/icinga1x-dev/Vagrantfile b/dev/icinga1x-dev/Vagrantfile index ca610e8a..ff7e34e6 100644 --- a/dev/icinga1x-dev/Vagrantfile +++ b/dev/icinga1x-dev/Vagrantfile @@ -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] @@ -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}" @@ -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] @@ -78,10 +74,7 @@ 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] @@ -89,6 +82,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # 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 @@ -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" diff --git a/dev/icinga1x-dev/manifests/default.pp b/dev/icinga1x-dev/manifests/default.pp index 78a1f078..a62a8f94 100644 --- a/dev/icinga1x-dev/manifests/default.pp +++ b/dev/icinga1x-dev/manifests/default.pp @@ -2,6 +2,10 @@ include icinga_rpm include monitoring_plugins +class { 'selinux': + mode => 'disabled' +} + #################################### # Database #################################### diff --git a/dev/icinga1x-dev/manifests/finalize.sh b/dev/icinga1x-dev/manifests/finalize.sh deleted file mode 100644 index da759612..00000000 --- a/dev/icinga1x-dev/manifests/finalize.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "The Icinga 1 Dev Vagrant VM has finished installing." -echo "Navigate to http://192.168.33.21" -echo "More details in the README.md file." diff --git a/dev/icinga1x-dev/manifests/puppet.sh b/dev/icinga1x-dev/manifests/puppet.sh deleted file mode 100644 index 01463be5..00000000 --- a/dev/icinga1x-dev/manifests/puppet.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -set -e - -if which puppet >/dev/null 2>&1; then - exit 0 -fi - -RELEASEVER=$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)) - -case $RELEASEVER in - 6|7) - PUPPET="http://yum.puppetlabs.com/puppetlabs-release-el-${RELEASEVER}.noarch.rpm" - ;; - *) - echo "Unknown release version: $RELEASEVER" >&2 - exit 1 - ;; -esac - -echo "Adding puppet repository.." -rpm --import "https://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs" -rpm -Uvh $PUPPET >/dev/null - -echo "Installing puppet.." -yum install -y puppet >/dev/null diff --git a/dev/icinga2x-freebsd/Vagrantfile b/dev/icinga2x-freebsd/Vagrantfile index c9055099..9558c2b5 100644 --- a/dev/icinga2x-freebsd/Vagrantfile +++ b/dev/icinga2x-freebsd/Vagrantfile @@ -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', diff --git a/dev/icinga2x-icingadb/Vagrantfile b/dev/icinga2x-icingadb/Vagrantfile new file mode 100644 index 00000000..f6a4cefd --- /dev/null +++ b/dev/icinga2x-icingadb/Vagrantfile @@ -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 + diff --git a/dev/icinga2x-icingadb/hiera.yaml b/dev/icinga2x-icingadb/hiera.yaml new file mode 100644 index 00000000..adbfcd27 --- /dev/null +++ b/dev/icinga2x-icingadb/hiera.yaml @@ -0,0 +1,9 @@ +--- +:backends: + - yaml + +:hierarchy: + - "common" + +:yaml: + :datadir: '/vagrant/hiera' diff --git a/dev/icinga2x-icingadb/hiera/settings.yaml b/dev/icinga2x-icingadb/hiera/settings.yaml new file mode 100644 index 00000000..558b9ef2 --- /dev/null +++ b/dev/icinga2x-icingadb/hiera/settings.yaml @@ -0,0 +1,4 @@ +--- +servers: + - hostname: icinga2 + ipaddress: 192.168.33.5 diff --git a/dev/icinga2x-icingadb/manifests/default.pp b/dev/icinga2x-icingadb/manifests/default.pp new file mode 100644 index 00000000..a25fd7bc --- /dev/null +++ b/dev/icinga2x-icingadb/manifests/default.pp @@ -0,0 +1,174 @@ +include icinga_rpm +include epel +include icinga2 +include icinga2_ido_mysql +include icingaweb2 +include icingaweb2_internal_db_mysql +include monitoring_plugins + +#################################### +# Database +#################################### + +$mysql_server_override_options = {} + +class { '::mysql::server': + root_password => 'icingar0xx', + remove_default_accounts => true, + override_options => $mysql_server_override_options +} + +#################################### +# Webserver +#################################### + +class {'apache': + # don't purge php, icingaweb2, etc configs + purge_configs => false, + default_vhost => false +} + +class {'::apache::mod::php': } + +apache::vhost { 'vagrant-demo.icinga.com': + priority => 5, + port => '80', + docroot => '/var/www/html', + rewrites => [ + { + rewrite_rule => ['^/$ /icingaweb2 [NE,L,R=301]'], + }, + ], +} + +apache::vhost { 'vagrant-demo.icinga.com-ssl': + priority => 5, + port => '443', + docroot => '/var/www/html', + ssl => true, + add_listen => false, #prevent duplicate listen entries + rewrites => [ + { + rewrite_rule => ['^/$ /icingaweb2 [NE,L,R=301]'], + }, + ], +} +include '::php::cli' +include '::php::mod_php5' + +php::ini { '/etc/php.ini': + display_errors => 'On', + memory_limit => '256M', + date_timezone => 'Europe/Berlin', + session_save_path => '/var/lib/php/session' +} + +#################################### +# Misc +#################################### +# fix puppet warning. +# https://ask.puppetlabs.com/question/6640/warning-the-package-types-allow_virtual-parameter-will-be-changing-its-default-value-from-false-to-true-in-a-future-release/ +if versioncmp($::puppetversion,'3.6.1') >= 0 { + $allow_virtual_packages = hiera('allow_virtual_packages',false) + Package { + allow_virtual => $allow_virtual_packages, + } +} + +package { [ 'mailx', 'tree', 'gdb', 'git', 'bash-completion', 'screen', 'htop' ]: + ensure => 'installed', + require => Class['epel'] +} + +@user { vagrant: ensure => present } +User<| title == vagrant |>{ + groups +> ['icinga', 'icingacmd'], + require => Package['icinga2'] +} + +file { '/etc/motd': + source => 'puppet:////vagrant/files/etc/motd', + owner => root, + group => root +} + +file { '/etc/profile.d/env.sh': + source => 'puppet:////vagrant/files/etc/profile.d/env.sh' +} + +# Required by vim-icinga2 +class { 'vim': + opt_bg_shading => 'light', +} + +#################################### +# Icinga 2 General +#################################### + +file { '/etc/icinga2': + ensure => 'directory', + require => Package['icinga2'] +} + +#file { '/etc/icinga2/icinga2.conf': +# owner => icinga, +# group => icinga, +# source => "puppet:////vagrant/files/etc/icinga2/icinga2.conf", +# require => File['/etc/icinga2'], +# notify => Service['icinga2'] +#} +# +#file { "/etc/icinga2/zones.conf": +# owner => icinga, +# group => icinga, +# source => "puppet:////vagrant/files/etc/icinga2/zones.conf", +# require => Package['icinga2'], +# notify => Service['icinga2'] +#} +# +## enable the command pipe +#icinga2::feature { 'command': } +# +#file { '/etc/icinga2/conf.d/hosts.conf': +# owner => icinga, +# group => icinga, +# source => 'puppet:////vagrant/files/etc/icinga2/conf.d/hosts.conf', +# require => Package['icinga2'], +# notify => Service['icinga2'] +#} +# +#file { '/etc/icinga2/conf.d/additional_services.conf': +# owner => icinga, +# group => icinga, +# source => 'puppet:////vagrant/files/etc/icinga2/conf.d/additional_services.conf', +# require => Package['icinga2'], +# notify => Service['icinga2'] +#} + +# api +exec { 'enable-icinga2-api': + path => '/bin:/usr/bin:/sbin:/usr/sbin', + command => 'icinga2 api setup', + require => Package['icinga2'], + notify => Service['icinga2'] +} + +file { '/etc/icinga2/conf.d/api-users.conf': + owner => icinga, + group => icinga, + content => template("icinga2/api-users.conf.erb"), + require => [ Package['icinga2'], Exec['enable-icinga2-api'] ], + notify => Service['icinga2'] +} + +#################################### +# Icinga Web 2 +#################################### + + + +#################################### +# Icinga Web 2 +#################################### + + diff --git a/icinga2x-cluster/Vagrantfile b/icinga2x-cluster/Vagrantfile index f803729f..940450d2 100644 --- a/icinga2x-cluster/Vagrantfile +++ b/icinga2x-cluster/Vagrantfile @@ -15,14 +15,15 @@ else Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION end -# inspired by https://github.com/lbetz/vagrant-icinga-book/blob/master/Vagrantfile nodes = { 'icinga2a' => { - :box => 'centos/7', - :mac => '020027000100', - :net => 'icinga2a.demo.local', + :box_virtualbox => 'bento/centos-7.3', + :box_parallels => 'parallels/centos-7.3', + :box_libvirt => 'centos/7', + :mac => '020027001000', + :net => 'cluster.local', :hostonly => '192.168.33.10', :memory => '1024', - :cpu => '2', + :cpu => '2', :fowarded => { '443' => '8445', '80' => '8085', @@ -30,12 +31,14 @@ nodes = { 'icinga2a' => { } }, 'icinga2b' => { - :box => 'centos/7', - :mac => '020027000101', - :net => 'icinga2b.demo.local', + :box_virtualbox => 'bento/centos-7.3', + :box_parallels => 'parallels/centos-7.3', + :box_libvirt => 'centos/7', + :mac => '020027002000', + :net => 'cluster.local', :hostonly => '192.168.33.20', :memory => '1024', - :cpu => '2', + :cpu => '2', :fowarded => { '443' => '8446', '80' => '8086', @@ -47,7 +50,7 @@ nodes = { 'icinga2a' => { 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] @@ -60,7 +63,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}" @@ -76,11 +79,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] @@ -91,10 +89,7 @@ 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] @@ -102,6 +97,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # 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 diff --git a/icinga2x-cluster/manifests/default.pp b/icinga2x-cluster/manifests/default.pp index 430c4921..37a03cff 100644 --- a/icinga2x-cluster/manifests/default.pp +++ b/icinga2x-cluster/manifests/default.pp @@ -8,6 +8,10 @@ include icingaweb2_internal_db_mysql include monitoring_plugins +class { 'selinux': + mode => 'disabled' +} + icingaweb2::module { [ 'businessprocess', 'pnp' ]: builtin => false } diff --git a/icinga2x-elastic/Vagrantfile b/icinga2x-elastic/Vagrantfile index c3f936a5..056869fd 100644 --- a/icinga2x-elastic/Vagrantfile +++ b/icinga2x-elastic/Vagrantfile @@ -15,26 +15,28 @@ else Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION end -# inspired by https://github.com/lbetz/vagrant-icinga-book/blob/master/Vagrantfile nodes = { 'icinga2-elastic' => { - :box => 'centos/7', - :mac => '020027000110', - :net => 'icinga2-elastic.demo.local', - :hostonly => '192.168.33.7', - :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 => 'demo.local', + :hostonly => '192.168.33.7', + :memory => '2048', + :cpu => '2', + :mac => '020027000900', + :fowarded => { + '443' => '8443', + '80' => '8082', + '22' => '2082', + '8003' => '8082' } + } } 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] @@ -47,7 +49,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}" @@ -63,11 +65,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] @@ -78,10 +75,7 @@ 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] @@ -89,6 +83,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # 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 diff --git a/icinga2x-elastic/files/etc/icinga2/features-available/logstash.conf b/icinga2x-elastic/files/etc/icinga2/features-available/logstash.conf new file mode 100644 index 00000000..2904160a --- /dev/null +++ b/icinga2x-elastic/files/etc/icinga2/features-available/logstash.conf @@ -0,0 +1,12 @@ +/** + * The LogstashWriter type writes check result metrics and + * performance data to a TCP or UDP socket. + */ + +library "perfdata" + +object LogstashWriter "logstash" { + host = "127.0.0.1" + port = 5555 +} + diff --git a/icinga2x-elastic/manifests/default.pp b/icinga2x-elastic/manifests/default.pp index a4b6a804..8fe7b865 100644 --- a/icinga2x-elastic/manifests/default.pp +++ b/icinga2x-elastic/manifests/default.pp @@ -6,6 +6,10 @@ include icingaweb2_internal_db_mysql include monitoring_plugins +class { 'selinux': + mode => 'disabled' +} + #################################### # Database #################################### diff --git a/icinga2x-graylog/Vagrantfile b/icinga2x-graylog/Vagrantfile index 8e126678..fa4523fb 100644 --- a/icinga2x-graylog/Vagrantfile +++ b/icinga2x-graylog/Vagrantfile @@ -15,29 +15,30 @@ else Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION end -# inspired by https://github.com/lbetz/vagrant-icinga-book/blob/master/Vagrantfile nodes = { 'icinga2-graylog' => { - :box => 'centos/7', - :mac => '020027000111', - :net => 'icinga2-graylog.demo.local', - :hostonly => '192.168.33.6', - :memory => '2048', - :cpu => '2', - :fowarded => { - '443' => '8443', - '80' => '8082', - '22' => '2082', - '9000' => '9000', - '12201' => '12201', - '12900' => '12900' - } + :box_virtualbox => 'bento/centos-7.3', + :box_parallels => 'parallels/centos-7.3', + :box_libvirt => 'centos/7', + :net => 'demo.local', + :hostonly => '192.168.33.6', + :memory => '2048', + :cpu => '2', + :mac => '020027000600', + :fowarded => { + '443' => '8443', + '80' => '8082', + '22' => '2082', + '9000' => '9000', + '12201' => '12201', + '12900' => '12900' } + } } 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] @@ -50,7 +51,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}" @@ -66,11 +67,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] @@ -81,10 +77,7 @@ 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] @@ -92,6 +85,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # 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 diff --git a/icinga2x-graylog/manifests/default.pp b/icinga2x-graylog/manifests/default.pp index fc0151ad..9479ac70 100644 --- a/icinga2x-graylog/manifests/default.pp +++ b/icinga2x-graylog/manifests/default.pp @@ -8,6 +8,10 @@ $graylog_version = "1.2" $elasticsearch_version = "" +class { 'selinux': + mode => 'disabled' +} + # basic stuff # fix puppet warning. # https://ask.puppetlabs.com/question/6640/warning-the-package-types-allow_virtual-parameter-will-be-changing-its-default-value-from-false-to-true-in-a-future-release/ diff --git a/icinga2x-ha-cluster/Vagrantfile b/icinga2x-ha-cluster/Vagrantfile index 1d311667..0b7f72b6 100644 --- a/icinga2x-ha-cluster/Vagrantfile +++ b/icinga2x-ha-cluster/Vagrantfile @@ -15,14 +15,15 @@ else Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION end -# inspired by https://github.com/lbetz/vagrant-icinga-book/blob/master/Vagrantfile nodes = { 'icinga2a' => { - :box => 'centos/7', - :mac => '020027000102', - :net => 'icinga2a.demo.local', + :box_virtualbox => 'bento/centos-7.3', + :box_parallels => 'parallels/centos-7.3', + :box_libvirt => 'centos/7', + :mac => '020027001010', + :net => 'cluster.local', :hostonly => '192.168.33.101', :memory => '1024', - :cpu => '1', + :cpu => '2', :fowarded => { '443' => '8445', '80' => '8085', @@ -30,12 +31,14 @@ nodes = { 'icinga2a' => { } }, 'icinga2b' => { - :box => 'centos/7', - :mac => '020027000103', - :net => 'icinga2b.demo.local', + :box_virtualbox => 'bento/centos-7.3', + :box_parallels => 'parallels/centos-7.3', + :box_libvirt => 'centos/7', + :mac => '020027001020', + :net => 'cluster.local', :hostonly => '192.168.33.102', :memory => '1024', - :cpu => '1', + :cpu => '2', :fowarded => { '443' => '8446', '80' => '8086', @@ -43,12 +46,14 @@ nodes = { 'icinga2a' => { } }, 'icinga2c' => { - :box => 'centos/7', - :mac => '020027000104', - :net => 'icinga2c.demo.local', + :box_virtualbox => 'bento/centos-7.3', + :box_parallels => 'parallels/centos-7.3', + :box_libvirt => 'centos/7', + :mac => '020027001030', + :net => 'cluster.local', :hostonly => '192.168.33.103', :memory => '1024', - :cpu => '1', + :cpu => '2', :fowarded => { '443' => '8447', '80' => '8087', @@ -60,7 +65,7 @@ nodes = { 'icinga2a' => { 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] @@ -73,7 +78,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}" @@ -89,11 +94,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] @@ -104,10 +104,7 @@ 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] @@ -115,6 +112,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # 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 diff --git a/icinga2x-ha-cluster/manifests/default.pp b/icinga2x-ha-cluster/manifests/default.pp index 4ac3ea74..cc8fc240 100644 --- a/icinga2x-ha-cluster/manifests/default.pp +++ b/icinga2x-ha-cluster/manifests/default.pp @@ -9,6 +9,10 @@ include icingaweb2_internal_db_mysql include monitoring_plugins +class { 'selinux': + mode => 'disabled' +} + #################################### # Database #################################### diff --git a/icinga2x-influxdb/Vagrantfile b/icinga2x-influxdb/Vagrantfile index 9f37b6a4..7766d068 100644 --- a/icinga2x-influxdb/Vagrantfile +++ b/icinga2x-influxdb/Vagrantfile @@ -15,26 +15,28 @@ else Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION end -# inspired by https://github.com/lbetz/vagrant-icinga-book/blob/master/Vagrantfile nodes = { 'icinga2-influxdb' => { - :box => 'centos/7', - :mac => '020027000112', - :net => 'icinga2-influxdb.demo.local', - :hostonly => '192.168.33.8', - :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 => 'demo.local', + :hostonly => '192.168.33.8', + :memory => '2048', + :cpu => '2', + :mac => '020027000199', + :fowarded => { + '443' => '8443', + '80' => '8082', + '22' => '2082', + '8003' => '8082' } + } } 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] @@ -47,7 +49,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}" @@ -63,11 +65,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] @@ -78,10 +75,7 @@ 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] @@ -89,6 +83,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # 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 diff --git a/icinga2x-influxdb/manifests/default.pp b/icinga2x-influxdb/manifests/default.pp index da50de99..482499ce 100644 --- a/icinga2x-influxdb/manifests/default.pp +++ b/icinga2x-influxdb/manifests/default.pp @@ -6,6 +6,10 @@ include icingaweb2_internal_db_mysql include monitoring_plugins +class { 'selinux': + mode => 'disabled' +} + #################################### # Database #################################### diff --git a/icinga2x/Vagrantfile b/icinga2x/Vagrantfile index 09882ef5..523c1459 100644 --- a/icinga2x/Vagrantfile +++ b/icinga2x/Vagrantfile @@ -15,27 +15,28 @@ else Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION end -# inspired by https://github.com/lbetz/vagrant-icinga-book/blob/master/Vagrantfile nodes = { 'icinga2' => { - :box => 'centos/7', - :mac => '020027000099', - :net => 'icinga2.demo.local', - :hostonly => '192.168.33.5', - :memory => '2048', - :cpu => '2', - :fowarded => { - '443' => '8443', - '80' => '8082', - '22' => '2082', - '8003' => '8082' - } + :box_virtualbox => 'bento/centos-7.3', + :box_parallels => 'parallels/centos-7.3', + :box_libvirt => 'centos/7', + :net => 'demo.local', + :hostonly => '192.168.33.5', + :memory => '2048', + :cpu => '2', + :mac => '020027000500', + :fowarded => { + '443' => '8443', + '80' => '8082', + '22' => '2082', + '8003' => '8082' } + } } 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] @@ -48,7 +49,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}" @@ -64,11 +65,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] @@ -79,10 +75,7 @@ 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] @@ -90,6 +83,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # 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 diff --git a/icinga2x/hiera/settings.yaml b/icinga2x/hiera/settings.yaml new file mode 100644 index 00000000..558b9ef2 --- /dev/null +++ b/icinga2x/hiera/settings.yaml @@ -0,0 +1,4 @@ +--- +servers: + - hostname: icinga2 + ipaddress: 192.168.33.5 diff --git a/icinga2x/manifests/default.pp b/icinga2x/manifests/default.pp index de4198cf..9ab746ed 100644 --- a/icinga2x/manifests/default.pp +++ b/icinga2x/manifests/default.pp @@ -6,6 +6,10 @@ include icingaweb2_internal_db_mysql include monitoring_plugins +#class { 'selinux': +# mode => 'disabled' +#} + #################################### # Database ####################################