parent
8d3ff94696
commit
3242156301
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
installJquery () {
|
installJquery () {
|
||||||
# The npm module jquery won't install via puppet because of an mysterious error
|
# The npm module jquery won't install via puppet because of an mysterious error
|
||||||
# when node-gyp rebuilding the dependent contextify module
|
# when node-gyp rebuilding the dependent contextify module
|
||||||
|
@ -10,8 +12,17 @@ installJquery () {
|
||||||
|
|
||||||
mountIcinga2webConfd () {
|
mountIcinga2webConfd () {
|
||||||
# Remount /vagrant/config with appropriate permissions since the group apache is missing initially
|
# Remount /vagrant/config with appropriate permissions since the group apache is missing initially
|
||||||
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g apache`,dmode=775,fmode=775 v-icinga2web-conf.d /vagrant/config
|
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g apache`,dmode=775,fmode=775 /vagrant/config /vagrant/config
|
||||||
|
}
|
||||||
|
|
||||||
|
startServicesWithNonLSBCompliantExitStatusCodes () {
|
||||||
|
# Unfortunately the ido2db init script is not LSB compliant and hence not started via puppet
|
||||||
|
service ido2db-mysql start || true
|
||||||
|
service ido2db-pgsql start || true
|
||||||
}
|
}
|
||||||
|
|
||||||
installJquery
|
installJquery
|
||||||
mountIcinga2webConfd
|
mountIcinga2webConfd
|
||||||
|
startServicesWithNonLSBCompliantExitStatusCodes
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
|
|
||||||
## Vagrant
|
## Vagrant
|
||||||
|
|
||||||
|
|
||||||
|
> **Note** that the deployment of the virtual machine is tested against Vagrant starting with version 1.1.
|
||||||
|
> Unfortunately older versions will not work.
|
||||||
|
|
||||||
The Icinga 2 Web project ships with a Vagrant virtual machine that integrates
|
The Icinga 2 Web project ships with a Vagrant virtual machine that integrates
|
||||||
the source code with various services and example data in a controlled
|
the source code with various services and example data in a controlled
|
||||||
environment. This enables developers and users to test Livestatus, status.dat,
|
environment. This enables developers and users to test Livestatus, status.dat,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- mode: ruby -*-
|
# -*- mode: ruby -*-
|
||||||
# vi: set ft=ruby :
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
Vagrant::Config.run do |config|
|
Vagrant.configure("2") do |config|
|
||||||
# All Vagrant configuration is done here. The most common configuration
|
# All Vagrant configuration is done here. The most common configuration
|
||||||
# options are documented and commented below. For a complete reference,
|
# options are documented and commented below. For a complete reference,
|
||||||
# please see the online documentation at vagrantup.com.
|
# please see the online documentation at vagrantup.com.
|
||||||
|
@ -13,24 +13,59 @@ Vagrant::Config.run do |config|
|
||||||
# doesn't already exist on the user's system.
|
# doesn't already exist on the user's system.
|
||||||
config.vm.box_url = "http://vagrant-boxes.icinga.org/centos-64-x64-vbox4212.box"
|
config.vm.box_url = "http://vagrant-boxes.icinga.org/centos-64-x64-vbox4212.box"
|
||||||
|
|
||||||
# Boot with a GUI so you can see the screen. (Default is headless)
|
# Create a forwarded port mapping which allows access to a specific port
|
||||||
# config.vm.boot_mode = :gui
|
# within the machine from a port on the host machine. In the example below,
|
||||||
|
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||||
|
config.vm.network :forwarded_port, guest: 80, host: 8080,
|
||||||
|
# Port collision auto-correction must be manually enabled for each forwarded port,
|
||||||
|
# since it is often surprising when it occurs and can lead the Vagrant user to
|
||||||
|
# think that the port wasn't properly forwarded. During a vagrant up or vagrant reload,
|
||||||
|
# Vagrant will output information about any collisions detections and auto corrections made,
|
||||||
|
# so you can take notice and act accordingly.
|
||||||
|
auto_correct: true
|
||||||
|
|
||||||
# Assign this VM to a host-only network IP, allowing you to access it
|
# Create a private network, which allows host-only access to the machine
|
||||||
# via the IP. Host-only networks can talk to the host machine as well as
|
# using a specific IP.
|
||||||
# any other machines on the same network, but cannot be accessed (through this
|
# config.vm.network :private_network, ip: "192.168.33.10"
|
||||||
# network interface) by any external networks.
|
|
||||||
# config.vm.network :hostonly, "192.168.33.10"
|
|
||||||
|
|
||||||
# Assign this VM to a bridged network, allowing you to connect directly to a
|
# Create a public network, which generally matched to bridged network.
|
||||||
# network using the host's network device. This makes the VM appear as another
|
# Bridged networks make the machine appear as another physical device on
|
||||||
# physical device on your network.
|
# your network.
|
||||||
# config.vm.network :bridged
|
# config.vm.network :public_network
|
||||||
|
|
||||||
# Forward a port from the guest to the host, which allows for outside
|
# If true, then any SSH connections made will enable agent forwarding.
|
||||||
# computers to access the VM, whereas host only networking does not.
|
# Default value: false
|
||||||
config.vm.forward_port 80, 8080
|
# config.ssh.forward_agent = true
|
||||||
|
|
||||||
|
# Share an additional folder to the guest VM. The first argument is
|
||||||
|
# the path on the host to the actual folder. The second argument is
|
||||||
|
# the path on the guest to mount the folder. And the optional third
|
||||||
|
# argument is a set of non-required options.
|
||||||
|
config.vm.synced_folder "./config", "/vagrant/config"
|
||||||
|
|
||||||
|
# Provider-specific configuration so you can fine-tune various
|
||||||
|
# backing providers for Vagrant. These expose provider-specific options.
|
||||||
|
# Example for VirtualBox:
|
||||||
|
#
|
||||||
|
# config.vm.provider :virtualbox do |vb|
|
||||||
|
# # Don't boot with headless mode
|
||||||
|
# vb.gui = true
|
||||||
|
#
|
||||||
|
# # Use VBoxManage to customize the VM. For example to change memory:
|
||||||
|
# vb.customize ["modifyvm", :id, "--memory", "1024"]
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# View the documentation for the provider you're using for more
|
||||||
|
# information on available options.
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant/config", "1"]
|
||||||
|
end
|
||||||
|
|
||||||
|
# Enable provisioning with Puppet stand alone. Puppet manifests
|
||||||
|
# are contained in a directory path relative to this Vagrantfile.
|
||||||
|
# You will need to create the manifests directory and a manifest in
|
||||||
|
# the file base.pp in the manifests_path directory.
|
||||||
|
#
|
||||||
# An example Puppet manifest to provision the message of the day:
|
# An example Puppet manifest to provision the message of the day:
|
||||||
#
|
#
|
||||||
# # group { "puppet":
|
# # group { "puppet":
|
||||||
|
@ -43,17 +78,11 @@ Vagrant::Config.run do |config|
|
||||||
# # content => "Welcome to your Vagrant-built virtual machine!
|
# # content => "Welcome to your Vagrant-built virtual machine!
|
||||||
# # Managed by Puppet.\n"
|
# # Managed by Puppet.\n"
|
||||||
# # }
|
# # }
|
||||||
|
#
|
||||||
# Share an additional folder to the guest VM. The first argument is
|
# config.vm.provision :puppet do |puppet|
|
||||||
# an identifier, the second is the path on the guest to mount the
|
# puppet.manifests_path = "manifests"
|
||||||
# folder, and the third is the path on the host to the actual folder.
|
# puppet.manifest_file = "init.pp"
|
||||||
config.vm.share_folder "v-icinga2web-conf.d", "/vagrant/config", "./config"
|
# end
|
||||||
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-icinga2web-conf.d", "1"]
|
|
||||||
|
|
||||||
# Enable provisioning with Puppet stand alone. Puppet manifests
|
|
||||||
# are contained in a directory path relative to this Vagrantfile.
|
|
||||||
# You will need to create the manifests directory and a manifest in
|
|
||||||
# the file default.pp in the manifests_path directory.
|
|
||||||
config.vm.provision :puppet do |puppet|
|
config.vm.provision :puppet do |puppet|
|
||||||
puppet.module_path = ".vagrant-puppet/modules"
|
puppet.module_path = ".vagrant-puppet/modules"
|
||||||
puppet.manifests_path = ".vagrant-puppet/manifests"
|
puppet.manifests_path = ".vagrant-puppet/manifests"
|
||||||
|
|
Loading…
Reference in New Issue