Merge branch 'feature/vagrant-centos-7-9453'

resolves #9453
This commit is contained in:
Eric Lippmann 2015-07-22 13:35:18 +02:00
commit b8c2c33086
10 changed files with 73 additions and 35 deletions

View File

@ -3,7 +3,7 @@
set -e
if which puppet >/dev/null 2>&1; then
exit 0
exit 0
fi
RELEASEVER=$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release))
@ -20,7 +20,7 @@ esac
echo "Adding puppet repository.."
rpm --import "https://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs"
rpm -ivh $PUPPET >/dev/null
rpm -Uvh $PUPPET >/dev/null
echo "Installing puppet.."
yum install -y puppet >/dev/null

View File

@ -15,10 +15,10 @@
class epel {
yumrepo { 'epel':
mirrorlist => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=${::architecture}",
mirrorlist => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-${::operatingsystemmajrelease}&arch=${::architecture}",
enabled => '1',
gpgcheck => '0',
descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}"
descr => "Extra Packages for Enterprise Linux ${::operatingsystemmajrelease} - ${::architecture}"
}
}

View File

@ -39,4 +39,8 @@ class icinga2 {
}
icinga2::feature { [ 'statusdata', 'command', 'compatlog' ]: }
icinga2::feature { 'api':
ensure => absent,
}
}

View File

@ -8,7 +8,7 @@
#
class icinga_packages {
yumrepo { 'icinga_packages':
baseurl => 'http://packages.icinga.org/epel/6/snapshot/',
baseurl => "http://packages.icinga.org/epel/${::operatingsystemmajrelease}/snapshot/",
enabled => '1',
gpgcheck => '1',
gpgkey => 'http://packages.icinga.org/icinga.key',

View File

@ -1,6 +1,6 @@
# Class: mysql
#
# This class installs the mysql server and client software.
# This class installs the MySQL server and client software on a RHEL or CentOS
#
# Parameters:
#
@ -16,21 +16,39 @@ class mysql {
Exec { path => '/usr/bin' }
if versioncmp($::operatingsystemmajrelease, '7') >= 0 {
$client_package_name = 'mariadb'
$server_package_name = 'mariadb-server'
$server_service_name = 'mariadb'
$cnf = '/etc/my.cnf.d/server.cnf'
$log_error = '/var/log/mariadb/mariadb.log'
$pid_file = '/var/run/mariadb/mariadb.pid'
} else {
$client_package_name = 'mysql'
$server_package_name = 'mysql-server'
$server_service_name = 'mysqld'
$cnf = '/etc/my.cnf'
$log_error = '/var/log/mysqld.log'
$pid_file = '/var/run/mysqld/mysqld.pid'
}
package { [
'mysql', 'mysql-server'
$client_package_name, $server_package_name,
]:
ensure => latest,
}
service { 'mysqld':
ensure => running,
service { $server_service_name:
alias => 'mysqld',
enable => true,
require => Package['mysql-server']
ensure => running,
require => Package[$server_package_name],
}
file { '/etc/my.cnf':
file { $cnf:
content => template('mysql/my.cnf.erb'),
require => Package['mysql-server'],
notify => Service['mysqld']
notify => Service['mysqld'],
recurse => true,
require => Package[$server_package_name],
}
}

View File

@ -104,8 +104,8 @@ innodb_file_per_table
innodb_log_file_size = 64M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
log-error=<%= @log_error %>
pid-file=<%= @pid_file %>
# Increase the amount of open files allowed per process. Warning: Make
# sure you have set the global system limit high enough! The high value

View File

@ -25,7 +25,7 @@ define pgsql::database::create ($username, $password) {
unless => "psql -tAc \"SELECT 1 FROM pg_roles WHERE rolname='${username}'\" | grep -q 1",
command => "psql -c \"CREATE ROLE ${username} WITH LOGIN PASSWORD '${password}';\" && \
createdb -O ${username} -E UTF8 -T template0 ${name} && \
createlang plpgsql ${name}",
(createlang plpgsql ${name} || true)",
user => 'postgres',
require => Class['pgsql']
}

View File

@ -1,6 +1,6 @@
# Class: icinga2_dev
#
# This class installs Icinga 2 w/ MySQL and provides Icinga 2 test configuration.
# This class installs Icinga 2 w/ MySQL and PostgreSQL and provides Icinga 2 test configuration.
#
# Requires:
#
@ -19,7 +19,8 @@ class icinga2_dev {
include monitoring_test_config
icinga2::config { [
'conf.d/test-config', 'conf.d/commands', 'constants' ]:
'conf.d/test-config', 'conf.d/commands', 'constants',
]:
source => 'puppet:///modules/icinga2_dev',
}

View File

@ -1,23 +1,38 @@
Alias /<%= @web_path %> /vagrant/public
Alias /<%= @web_path %> "/vagrant/public"
<Directory "/vagrant/public/">
Options FollowSymLinks
<Directory "/vagrant/public">
Options SymLinksIfOwnerMatch
AllowOverride None
Order allow,deny
Allow from all
# SetEnv ICINGAWEB_CONFIGDIR <%= @config %>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAll>
Require all granted
</RequireAll>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order allow,deny
Allow from all
</IfModule>
SetEnv ICINGAWEB_CONFIGDIR <%= @config %>
EnableSendfile Off
RewriteEngine on
RewriteBase /<%= @web_path %>/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /<%= @web_path %>/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
php_value xdebug.idekey PHPSTORM
<IfModule !mod_rewrite.c>
DirectoryIndex error_norewrite.html
ErrorDocument 404 /error_norewrite.html
</IfModule>
</Directory>

4
Vagrantfile vendored
View File

@ -22,13 +22,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :shell, :path => ".puppet/manifests/puppet.sh"
config.vm.provider :virtualbox do |v, override|
override.vm.box = "puppetlabs/centos-6.6-64-puppet"
override.vm.box = "puppetlabs/centos-7.0-64-puppet"
v.customize ["modifyvm", :id, "--memory", "1024"]
end
config.vm.provider :parallels do |p, override|
override.vm.box = "parallels/centos-6.5"
override.vm.box = "parallels/centos-7.1"
p.name = "Icinga Web 2 Development"