Skip to content
Snippets Groups Projects
Commit 388e751a authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Clean up skadereg module

In preparation for handover to the new main developer
parent 1f4c7c9e
No related branches found
No related tags found
No related merge requests found
# Class: skadereg # Class: skadereg
# =========================== # ===========================
# #
# Full description of class skadereg here.
#
# Parameters # Parameters
# ---------- # ----------
# #
# Document parameters here. # [*mysql_password*]
# # The password for the MySQL user
# * `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.
# #
# * `sample variable` # [*mysql_backup_password*]
# Explanation of how this variable affects the function of this class and if # The password for the user used for MySQL backups
# 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' ],
# }
# #
# Authors # Authors
# ------- # -------
# #
# Alexander Olofsson <alexander.olofsson@liu.se>
# Andreas Alvarsson <andal699@student.liu.se> # Andreas Alvarsson <andal699@student.liu.se>
# #
# Copyright # Copyright
# --------- # ---------
# #
# Copyright 2016 Andreas Alvarsson # Copyright © Linköpings Universitet
# #
class skadereg( class skadereg(
$mysql_password, $mysql_backup_password String $mysql_password,
String $mysql_backup_password,
){ ){
::users::liu_user { 'andal699': ::users::liu_user {
commonname => 'Andreas Alvarsson', 'andal699':
shell => '/bin/bash', commonname => 'Andreas Alvarsson',
sshkey => 'AAAAB3NzaC1yc2EAAAADAQABAAACAQDCdb9hWgucRRTpDEH1ozBsWXfC+zTnZEO8rrnuqLlwIy23vEaUK7pJ9tQ7AzdR3+fp6yhWBNOlWC9UT70TnVClS1NfXGXHep0J0yWqNnyXcKviKpVB/p9TOVOULrRX9o3oczYxQa4Bi+eYUfk/en2V6O8tIfYtx5AdWUoofdLYNSpCyrHD1xoH7k1/c+OfW0S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GixHiIRByw4BEhFVJWNN/DBT88qd61StuIvWEawZ4WiTGNYfh2SVDIy9Jrcp7Nfg1knK1OtYr+wnjO9OrJtePfo0oo9xwQ3GfwCxni8YJKp40BmfWT/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 ::yum::centos_scl
include ::apache include ::apache
class { '::apache::mod::php': class { '::apache::mod::php':
package_name => 'php55-php' package_name => 'php55-php',
} }
include ::apache::mod::rewrite include ::apache::mod::rewrite
...@@ -76,26 +73,26 @@ class skadereg( ...@@ -76,26 +73,26 @@ class skadereg(
file { '/etc/httpd/modules/libphp5.so': file { '/etc/httpd/modules/libphp5.so':
ensure => link, ensure => link,
target => '/opt/rh/httpd24/root/usr/lib64/httpd/modules/libphp55-php5.so', target => '/opt/rh/httpd24/root/usr/lib64/httpd/modules/libphp55-php5.so',
before => Service['httpd'] before => Service['httpd'],
} }
include ::certdist include ::certdist
$cert = "/etc/pki/tls/certs/cert-${::fqdn}.pem" $cert = "/etc/pki/tls/certs/cert-${facts['networking']['fqdn']}.pem"
$chain = "/etc/pki/tls/certs/chain-${::fqdn}.pem" $chain = "/etc/pki/tls/certs/chain-${facts['networking']['fqdn']}.pem"
$key = "/etc/pki/tls/private/${::fqdn}.key" $key = "/etc/pki/tls/private/${facts['networking']['fqdn']}.key"
apache::vhost { 'default:80': apache::vhost { 'default:80':
servername => $::fqdn, servername => $facts['networking']['fqdn'],
default_vhost => true, default_vhost => true,
port => '80', port => '80',
docroot => '/var/www/html', docroot => '/var/www/html',
redirect_status => 'permanent', redirect_status => 'permanent',
redirect_dest => "https://${::fqdn}/", redirect_dest => "https://${facts['networking']['fqdn']}/",
} }
apache::vhost { "${::fqdn}:443": apache::vhost { "${facts['networking']['fqdn']}:443":
servername => $::fqdn, servername => $facts['networking']['fqdn'],
port => '443', port => '443',
ssl => true, ssl => true,
ssl_cert => $cert, ssl_cert => $cert,
...@@ -109,29 +106,30 @@ class skadereg( ...@@ -109,29 +106,30 @@ class skadereg(
allow_override => [ 'ALL' ], allow_override => [ 'ALL' ],
directoryindex => 'index.php', directoryindex => 'index.php',
} }
] ],
} }
file { '/var/www/skadereg/': file { '/var/www/skadereg/':
ensure => directory, ensure => directory,
owner => 'andal699', owner => 'apache',
group => 'apache', group => 'skadereg',
mode => '0770', mode => '0770',
recurse => true recurse => true,
}-> }
vcsrepo { '/var/www/skadereg': -> vcsrepo { '/var/www/skadereg':
ensure => latest, ensure => latest,
before => File['/var/www/skadereg/public'], before => File['/var/www/skadereg/public'],
provider => git, provider => git,
source => 'ssh://git@gitlab.it.liu.se:29418/andal699/laravel.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, ensure => file,
owner => 'andal699', owner => 'apache',
group => 'apache', group => 'skadereg',
mode => '0660', mode => '0660',
content => template("${module_name}/dotenv.erb"), content => template("${module_name}/dotenv.erb"),
} }
...@@ -142,7 +140,7 @@ class skadereg( ...@@ -142,7 +140,7 @@ class skadereg(
'homestead' => { 'homestead' => {
ensure => present, ensure => present,
charset => 'utf8', charset => 'utf8',
} },
}, },
grants => { grants => {
'root@%/*.*' => { 'root@%/*.*' => {
...@@ -151,14 +149,14 @@ class skadereg( ...@@ -151,14 +149,14 @@ class skadereg(
privileges => ['ALL'], privileges => ['ALL'],
table => '*.*', table => '*.*',
user => 'root@%', user => 'root@%',
} },
}, },
override_options => { override_options => {
mysqld => { mysqld => {
'bind-address' => '0.0.0.0', 'bind-address' => '0.0.0.0',
port => 33060, port => 33060,
} },
} },
} }
class { '::mysql::server::backup': class { '::mysql::server::backup':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment