Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #mot web frontend profile
- class profile::frontend {
- include ::profile::global
- include ::profile::php
- include ::stdlib
- $external_url = hiera('environment::external_url')
- $api_url = hiera('profile::frontend::api_url')
- $openam_hostname = hiera('environment::openam::server::hostname')
- $openam_port = hiera('environment::openam::server::port')
- $openam_server = "${openam_hostname}:${openam_port}"
- $amadmin_pw = hiera('environment::openam::amadmin_pw')
- $mysql_server = hiera('environment::mysql::servername')
- $motdbuser_password = hiera('environment::mysql::user::motdbuser::password')
- $openam_url = hiera('openam::site_url', 'http://openam/sso')
- $openam_cookie_domain = hiera('profile::frontend::openam_cookie_domain')
- $google_analytics_id = hiera('profile::frontend::google_analytics_id')
- $memcached_save_path = hiera('profile::frontend::elasticache::server')
- $feature_toggle_jasper_async = hiera('profile::feature_toggles::jasper_async')
- $feature_toggle_password_expiry = hiera('profile::feature_toggles::password_expiry')
- $feature_toggle_vts_risk_score = hiera('profile::feature_toggles::vts_risk_score')
- $feature_toggle_2fa_method_visible = hiera('profile::feature_toggles::2fa_method_visible', false)
- $feature_toggle_infinity_contingency = hiera('profile::feature_toggles::infinity_contingency', true)
- $feature_toggle_new_person_profile = hiera('profile::feature_toggles::new_person_profile', false)
- $password_expiry_grace_period = hiera('profile::password_expiry_grace_period')
- $memcache_type = hiera('profile::frontend::memcache_type', 'elasicache')
- $new_person_profile = hiera('profile::frontend::new_person_profile', false)
- $opchache_validate_timestamps = hiera('profile::php::opcache_validate_timestamps', '0')
- file { '/var/log/dvsa':
- ensure => directory,
- owner => 'apache',
- group => 'apache',
- }
- file { [ '/etc/dvsa', '/etc/dvsa/mot-web-frontend' ]:
- ensure => directory,
- owner => 'apache',
- group => 'apache',
- mode => '0700',
- }
- file { '/opt/rh/php55/root/etc/php.ini':
- ensure => present,
- owner => 'root',
- group => 'root',
- mode => '0644',
- content => template('profile/frontend/php.ini.erb'),
- require => Package['php55'],
- notify => Exec['remove web-frontend cache'],
- }
- file { '/opt/rh/php55/root/etc/php.d/opcache.ini':
- ensure => present,
- owner => 'root',
- group => 'root',
- mode => '0644',
- content => template('profile/php/opcache.ini.erb'),
- require => Package['php55-php-opcache'],
- notify => Exec['remove web-frontend cache'],
- }
- file { '/opt/rh/php55/root/etc/php.d/z-memcached.ini':
- ensure => absent,
- notify => Exec['remove web-frontend cache'],
- }
- file { '/opt/rh/php55/root/etc/php.d/memcached.ini':
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- content => template('profile/frontend/php.d/memcached.ini.erb'),
- require => Package['php55'],
- notify => Exec['remove web-frontend cache'],
- }
- # Web frontend configuration files
- file { '/etc/dvsa/mot-web-frontend/global.php':
- ensure => file,
- owner => 'apache',
- group => 'apache',
- mode => '0400',
- content => template('profile/frontend/mot-web-frontend/global.php.erb'),
- notify => Exec['remove web-frontend cache'],
- require => File['/etc/dvsa/mot-web-frontend'],
- }
- file { '/etc/dvsa/mot-web-frontend/production.php':
- ensure => absent,
- notify => Exec['remove web-frontend cache'],
- require => File['/etc/dvsa/mot-web-frontend'],
- }
- file { '/etc/dvsa/mot-web-frontend/testing.php':
- ensure => absent,
- notify => Exec['remove web-frontend cache'],
- require => File['/etc/dvsa/mot-web-frontend'],
- }
- file { '/etc/dvsa/mot-web-frontend/development.php':
- ensure => absent,
- notify => Exec['remove web-frontend cache'],
- require => File['/etc/dvsa/mot-web-frontend'],
- }
- file { '/etc/dvsa/mot-web-frontend/features.local.php':
- ensure => absent,
- notify => Exec['remove web-frontend cache'],
- require => File['/etc/dvsa/mot-web-frontend'],
- }
- file { '/etc/dvsa/mot-web-frontend/z.dvsalogger.development.php.dist.opt':
- ensure => absent,
- notify => Exec['remove web-frontend cache'],
- require => File['/etc/dvsa/mot-web-frontend'],
- }
- file { '/etc/dvsa/mot-web-frontend/zenddevelopertools.development.php':
- ensure => absent,
- notify => Exec['remove web-frontend cache'],
- require => File['/etc/dvsa/mot-web-frontend'],
- }
- ensure_resource('selboolean', 'httpd_can_network_connect', { 'value' => 'on', 'persistent' => true })
- ensure_resource('selboolean', 'httpd_can_network_relay', { 'value' => 'on', 'persistent' => true })
- selboolean { 'httpd_execmem':
- value => on,
- persistent => true,
- }
- case $memcache_type {
- 'memcached': {
- package { 'memcached':
- ensure => present,
- }
- ->
- service { 'memcached':
- ensure => running,
- enable => true,
- }
- }
- default: {
- package { 'memcached':
- ensure => absent,
- }
- }
- }
- exec { 'remove web-frontend cache':
- command => 'rm -rf /tmp/*.php',
- path => '/usr/local/bin/:/bin/',
- notify => Service['httpd'],
- refreshonly => true,
- }
- package { 'mot-common-web-module':
- ensure => hiera('profile::frontend::mot-common-web-module::ensure', 'latest'),
- before => Service['httpd'],
- notify => Exec['remove web-frontend cache'],
- }
- package { 'wkhtmltox':
- ensure => present,
- }
- package { 'mot-web-frontend':
- ensure => hiera('profile::frontend::mot-web-frontend::ensure', 'latest'),
- before => Service['httpd'],
- notify => Exec['remove web-frontend cache'],
- }
- package { 'amazon-elasticache':
- ensure => hiera('profile::frontend::amazon-elasticache::ensure', 'latest'),
- before => Service['httpd'],
- notify => Exec['remove web-frontend cache'],
- }
- if ($::environment == 'vagrant'){
- file { '/opt/rh/php55/root/etc/php.d/xdebug.ini':
- ensure => present,
- owner => 'root',
- group => 'root',
- mode => '0644',
- content => template('profile/php/xdebug.ini.erb'),
- require => File['/opt/rh/php55/root/etc/php.ini'],
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement