diff --git a/.gitignore b/.gitignore index ac45c2a9f..a4593f761 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ # Exclude all hidden files .* -# But not .gitignore and .vagrant-puppet +# But not .gitignore, .vagrant-puppet and .htaccess !.gitignore !.vagrant-puppet +!public/.htaccess build/ test/js/npm-debug.log diff --git a/.vagrant-puppet/files/etc/httpd/conf.d/icinga2-web.conf b/.vagrant-puppet/files/etc/httpd/conf.d/icinga2-web.conf new file mode 100644 index 000000000..ff3c96e69 --- /dev/null +++ b/.vagrant-puppet/files/etc/httpd/conf.d/icinga2-web.conf @@ -0,0 +1,8 @@ + + Options -Indexes + + AllowOverride All + + Order allow,deny + Allow from all + diff --git a/.vagrant-puppet/manifests/default.pp b/.vagrant-puppet/manifests/default.pp index a4559eef6..0139979ed 100644 --- a/.vagrant-puppet/manifests/default.pp +++ b/.vagrant-puppet/manifests/default.pp @@ -285,7 +285,7 @@ exec { 'install npm/mocha': exec { 'install npm/mocha-cobertura-reporter': command => 'npm install -g mocha-cobertura-reporter', - creates => '/usr/lib/node_modules/cobertura', + creates => '/usr/lib/node_modules/mocha-cobertura-reporter', require => Exec['install npm/mocha'] } @@ -318,16 +318,35 @@ package { 'boost-devel': } cmmi { 'icinga2': - url => 'http://sourceforge.net/projects/icinga/files/icinga2/0.0.1/icinga2-0.0.1.tar.gz/download', - output => 'icinga2-0.0.1.tar.gz', - flags => '--prefix=/usr/local/icinga2', - creates => '/usr/local/icinga2', - make => 'make && make install', - require => Package['boost-devel'], - timeout => 600 + url => 'http://sourceforge.net/projects/icinga/files/icinga2/0.0.1/icinga2-0.0.1.tar.gz/download', + output => 'icinga2-0.0.1.tar.gz', + flags => '--prefix=/usr/local/icinga2', + creates => '/usr/local/icinga2', + make => 'make && make install', + require => Package['boost-devel'], + make_timeout => 600 } file { 'icinga2-web-public': - ensure => '/vagrant/public', - path => '/var/www/html/icinga2-web' + ensure => '/vagrant/public', + path => '/var/www/html/icinga2-web', + require => Class['apache'] +} + +file { '/etc/httpd/conf.d/icinga2-web.conf': + source => 'puppet:////vagrant/.vagrant-puppet/files/etc/httpd/conf.d/icinga2-web.conf', + require => Class['apache'] +} + +exec { 'install php-ZendFramework-Db-Adapter-Pdo-Mysql': + command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework-Db-Adapter-Pdo-Mysql', + unless => 'rpm -qa | grep php-ZendFramework-Db-Adapter-Pdo-Mysql', + require => Exec['install ZendFramework'] +} + +file { ['/etc/icinga2-web/', + '/etc/icinga2-web/enabledModules/']: + ensure => 'directory', + owner => 'apache', + group => 'apache' } diff --git a/.vagrant-puppet/modules/cmmi/manifests/init.pp b/.vagrant-puppet/modules/cmmi/manifests/init.pp index f7069a010..225045c85 100644 --- a/.vagrant-puppet/modules/cmmi/manifests/init.pp +++ b/.vagrant-puppet/modules/cmmi/manifests/init.pp @@ -6,12 +6,12 @@ # *Note* make sure to install build essentials before running cmmi. # # Parameters: -# [*url*] - fetch archive via wget from this url. -# [*output*] - filename to fetch the archive into. -# [*flags*] - configure options. -# [*creates*] - target directory the software will install to. -# [*make* ] - command to make and make install the software. -# [*timeout* ] - timeout for the make command. +# [*url*] - fetch archive via wget from this url. +# [*output*] - filename to fetch the archive into. +# [*flags*] - configure options. +# [*creates*] - target directory the software will install to. +# [*make* ] - command to make and make install the software. +# [*make_timeout* ] - timeout for the make command. # # Actions: # @@ -20,11 +20,12 @@ # Sample Usage: # # cmmi { 'example-software': -# url => 'http://example-software.com/download/', -# output => 'example-software.tar.gz', -# flags => '--prefix=/opt/example-software', -# creates => '/opt/example-software', -# make => 'make && make install' +# url => 'http://example-software.com/download/', +# output => 'example-software.tar.gz', +# flags => '--prefix=/opt/example-software', +# creates => '/opt/example-software', +# make => 'make && make install' +# make_timeout => 600 # } # define cmmi( @@ -33,7 +34,7 @@ define cmmi( $flags, $creates, $make, - $timeout=300 + $make_timeout=300 ) { Exec { path => '/bin:/usr/bin' } @@ -46,7 +47,6 @@ define cmmi( cwd => $cwd, command => "wget -q ${url} -O ${output}", creates => "${cwd}/${output}", - timeout => 120, require => Class['wget'] } @@ -73,6 +73,6 @@ define cmmi( command => $make, creates => $creates, require => Exec["configure-${name}"], - timeout => $timeout + timeout => $make_timeout } } diff --git a/Vagrantfile b/Vagrantfile index 564aa4c53..5a6eaf508 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -56,6 +56,12 @@ 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 = "-v -d" + #puppet.options = "-v -d" + end + + # The npm module jquery won't install via puppet because of an mysterious error + # when node-gyp rebuilding the dependent contextify module + config.vm.provision :shell do |shell| + shell.inline = "[ -d /usr/lib/node_modules/jquery ] || npm install --silent -g jquery" end end diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 000000000..2563d17aa --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,11 @@ +SetEnv APPLICATION_ENV development + +RewriteEngine on +RewriteCond %{REQUEST_FILENAME} -s [OR] +RewriteCond %{REQUEST_FILENAME} -l [OR] +RewriteCond %{REQUEST_FILENAME} -d +RewriteRule ^.*$ - [NC,L] +RewriteRule ^.*$ index.php [NC,L] + +php_flag short_open_tag on +php_value short_open_tag 1