From 4783cb07060eec34e2f0d310ed48190ebdd893a7 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 3 Jun 2013 11:22:24 +0200 Subject: [PATCH] Vagrant: Forward port 80 to 8080 refs #4232 --- .vagrant-puppet/manifests/default.pp | 7 ++++++- Vagrantfile | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.vagrant-puppet/manifests/default.pp b/.vagrant-puppet/manifests/default.pp index 0de643207..f627664b2 100644 --- a/.vagrant-puppet/manifests/default.pp +++ b/.vagrant-puppet/manifests/default.pp @@ -3,7 +3,7 @@ include php include mysql include pgsql -Exec { path => '/bin:/usr/bin' } +Exec { path => '/bin:/usr/bin:/sbin' } exec { 'create-mysql-icinga-db': unless => 'mysql -uicinga -picinga icinga', @@ -154,3 +154,8 @@ file { '/usr/local/icinga-pgsql/etc/modules/idoutils.cfg': require => Cmmi['icinga-pgsql'], notify => [Service['icinga-pgsql'], Service['ido2db-pgsql']] } + +exec { 'iptables-allow-http': + unless => 'grep -Fxqe "-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables', + command => 'iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT && iptables-save > /etc/sysconfig/iptables' +} diff --git a/Vagrantfile b/Vagrantfile index 8b07ab184..c8d2836c0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -29,7 +29,7 @@ Vagrant::Config.run do |config| # Forward a port from the guest to the host, which allows for outside # computers to access the VM, whereas host only networking does not. - # config.vm.forward_port 80, 8080 + config.vm.forward_port 80, 8080 # An example Puppet manifest to provision the message of the day: # @@ -47,7 +47,7 @@ Vagrant::Config.run do |config| # Share an additional folder to the guest VM. The first argument is # an identifier, the second is the path on the guest to mount the # folder, and the third is the path on the host to the actual folder. - # # config.vm.share_folder "puppet-templates", "/tmp/vagrant-puppet/templates", "templates" + config.vm.share_folder "v-icinga2-web-pub", "/var/www/html/icinga2-web", "./pub", :owner => "apache", :group => "apache" # Enable provisioning with Puppet stand alone. Puppet manifests # are contained in a directory path relative to this Vagrantfile. @@ -56,7 +56,6 @@ Vagrant::Config.run do |config| config.vm.provision :puppet do |puppet| puppet.module_path = ".vagrant-puppet/modules" puppet.manifests_path = ".vagrant-puppet/manifests" - # # puppet.options = ["--templatedir", "/tmp/vagrant-puppet/templates"] puppet.options = "-v -d" end end