Skip to content
Snippets Groups Projects

Clean up skadereg module

Merged Alexander Olofsson requested to merge handover-prepare into production
1 file
+ 57
59
Compare changes
  • Side-by-side
  • Inline
+ 57
59
# Class: skadereg
# ===========================
#
# Full description of class skadereg here.
#
# Parameters
# ----------
#
# Document parameters here.
#
# * `sample parameter`
# Explanation of what this parameter affects and what it defaults to.
# e.g. "Specify one or more upstream ntp servers as an array."
#
# Variables
# ----------
#
# Here you should define a list of variables that this module would require.
# [*mysql_password*]
# The password for the MySQL user
#
# * `sample variable`
# Explanation of how this variable affects the function of this class and if
# it has a default. e.g. "The parameter enc_ntp_servers must be set by the
# External Node Classifier as a comma separated list of hostnames." (Note,
# global variables should be avoided in favor of class parameters as
# of Puppet 2.6.)
#
# Examples
# --------
#
# @example
# class { 'skadereg':
# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
# }
# [*mysql_backup_password*]
# The password for the user used for MySQL backups
#
# Authors
# -------
#
# Alexander Olofsson <alexander.olofsson@liu.se>
# Andreas Alvarsson <andal699@student.liu.se>
#
# Copyright
# ---------
#
# Copyright 2016 Andreas Alvarsson
# Copyright © Linköpings Universitet
#
class skadereg(
$mysql_password, $mysql_backup_password
String $mysql_password,
String $mysql_backup_password,
){
::users::liu_user { 'andal699':
commonname => 'Andreas Alvarsson',
shell => '/bin/bash',
sshkey => 'AAAAB3NzaC1yc2EAAAADAQABAAACAQDCdb9hWgucRRTpDEH1ozBsWXfC+zTnZEO8rrnuqLlwIy23vEaUK7pJ9tQ7AzdR3+fp6yhWBNOlWC9UT70TnVClS1NfXGXHep0J0yWqNnyXcKviKpVB/p9TOVOULrRX9o3oczYxQa4Bi+eYUfk/en2V6O8tIfYtx5AdWUoofdLYNSpCyrHD1xoH7k1/c+OfW0S3fR5f12n/5u8JTHrztDnpy79CfEtwgMr1pCMjOaiM+OIDYlhNJMvlBo5C6mcDls93snctUR1Zef+sJEznb739uw91f5Yqf5FUBLxXCBi3eveJacBVRVg++ZPzyZ9VHIlBz3OPZ1W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fwCxni8YJKp40BmfWT/fpY9Pmup71adhaPxPHnELGOeVG/fGw==';
'adrpa878':
commonname => 'Adrian Palmquist',
shell => '/bin/bash',
sshkey => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDZHpLQZ6T5tKhYXK/Mq3BGhAjqUMyb0LfxlTLSn3rpYvsyddLOhHio2tjd1dYL0HhjmV9QbkEL8Qycs9acNJq9qY/Q+hWxvIRaqWXJodSYdOeOBOeGNM6LhNMTup4Y7a/Fn1LlnBXMJgskDjQ6ReP3Lyyba5M8jjb1GaoWJqsQ3Us3WYFwe8BgpWJKZ2fesctrbae+6eP8PFi0OHEnqqpIFZzdLvp9kgEhEbO6mjFXFqvHLNWwWuKsyfJ38nl4yaS9o6hkElM7KIdXawqHpcFWDSI9eo6nQ1mivAMVjBlBE7/qvZh11hJAe/eJSe0ccGtKjVTWAoH9UhxxpgbjYW0X';
}
group { 'skadereg':
ensure => present,
members => [
'andal699',
'adrpa878',
'apache',
],
require => [
::Users::Liu_user['andal699'],
::Users::Liu_user['adrpa878'],
],
}
include skadereg::firewall
include ::skadereg::firewall
include ::yum::centos_scl
include ::apache
class { '::apache::mod::php':
package_name => 'php55-php'
package_name => 'php55-php',
}
include ::apache::mod::rewrite
@@ -76,26 +73,26 @@ class skadereg(
file { '/etc/httpd/modules/libphp5.so':
ensure => link,
target => '/opt/rh/httpd24/root/usr/lib64/httpd/modules/libphp55-php5.so',
before => Service['httpd']
before => Service['httpd'],
}
include ::certdist
$cert = "/etc/pki/tls/certs/cert-${::fqdn}.pem"
$chain = "/etc/pki/tls/certs/chain-${::fqdn}.pem"
$key = "/etc/pki/tls/private/${::fqdn}.key"
$cert = "/etc/pki/tls/certs/cert-${facts['networking']['fqdn']}.pem"
$chain = "/etc/pki/tls/certs/chain-${facts['networking']['fqdn']}.pem"
$key = "/etc/pki/tls/private/${facts['networking']['fqdn']}.key"
apache::vhost { 'default:80':
servername => $::fqdn,
servername => $facts['networking']['fqdn'],
default_vhost => true,
port => '80',
docroot => '/var/www/html',
redirect_status => 'permanent',
redirect_dest => "https://${::fqdn}/",
redirect_dest => "https://${facts['networking']['fqdn']}/",
}
apache::vhost { "${::fqdn}:443":
servername => $::fqdn,
apache::vhost { "${facts['networking']['fqdn']}:443":
servername => $facts['networking']['fqdn'],
port => '443',
ssl => true,
ssl_cert => $cert,
@@ -109,29 +106,30 @@ class skadereg(
allow_override => [ 'ALL' ],
directoryindex => 'index.php',
}
]
],
}
file { '/var/www/skadereg/':
ensure => directory,
owner => 'andal699',
group => 'apache',
owner => 'apache',
group => 'skadereg',
mode => '0770',
recurse => true
}->
recurse => true,
}
vcsrepo { '/var/www/skadereg':
-> vcsrepo { '/var/www/skadereg':
ensure => latest,
before => File['/var/www/skadereg/public'],
provider => git,
source => 'ssh://git@gitlab.it.liu.se:29418/andal699/laravel.git',
user => 'andal699'
}->
user => 'apache',
group => 'skadereg',
}
file { '/var/www/skadereg/.env':
-> file { '/var/www/skadereg/.env':
ensure => file,
owner => 'andal699',
group => 'apache',
owner => 'apache',
group => 'skadereg',
mode => '0660',
content => template("${module_name}/dotenv.erb"),
}
@@ -142,7 +140,7 @@ class skadereg(
'homestead' => {
ensure => present,
charset => 'utf8',
}
},
},
grants => {
'root@%/*.*' => {
@@ -151,14 +149,14 @@ class skadereg(
privileges => ['ALL'],
table => '*.*',
user => 'root@%',
}
},
},
override_options => {
mysqld => {
'bind-address' => '0.0.0.0',
port => 33060,
}
}
},
},
}
class { '::mysql::server::backup':
Loading