# # Class for a Drupal 8 development website # class nodo::role::dev::drupal8( $project = 'drupal', $project_folder = '/srv/kvmx', # '/vagrant' $project_user = 'user', # 'vagrant' ) { include nodo::role::dev::virtual include apache include nodo::utils::development::web include nodo::utils::development::php include php::series7 include database include drupal # In case you want to use sqlite3 db package { 'sqlite3': ensure => installed, } # In case you use makefiles package { 'make': ensure => present, } # Xdebug config # https://www.drupal.org/node/2488300 #file { '/etc/php5/apache2/conf.d/20-xdebug-levels.ini': #file { '/etc/php/5.6/apache2/conf.d/20-xdebug-levels.ini': file { '/etc/php/7.0/apache2/conf.d/20-xdebug-levels.ini': ensure => present, owner => 'root', group => 'root', mode => '0644', content => "[xdebug]\nxdebug.max_nesting_level=256\n", require => Package['php'], notify => Service['apache2'], } $default_db = hiera('websites::default_db', 'drupal') $default_db_password = hiera('websites::default_db::password', 'hackme') # Do not use this password on production machines database::instance { $default_db: password => $default_db_password, } # We could simply using one symlink, but it might incur in # performance penalties by drush recursivelly searching for # plugins in the whole project tree. #file { "${::apache::www_folder}/drupal-8/sites/default": # ensure => $project_folder, # force => true, #} #file { "${::apache::www_folder}/drupal-8/sites/${project}": # ensure => $project_folder, # force => true, #} file { "${::apache::www_folder}/drupal-8/sites/default": ensure => directory, owner => root, group => root, mode => '0755', force => true, } file { "${::apache::www_folder}/drupal-8/sites/${project}": ensure => "${::apache::www_folder}/drupal-8/sites/default", force => true, require => File["${::apache::www_folder}/drupal-8/sites/default"], } file { "${::apache::www_folder}/drupal-8/sites/default/settings.php": ensure => "${project_folder}/settings.php", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-8/sites/default"], } file { "${::apache::www_folder}/drupal-8/sites/default/services.yml": ensure => "${project_folder}/services.yml", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-8/sites/default"], } file { "${::apache::www_folder}/drupal-8/sites/default/files": ensure => "${project_folder}/files", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-8/sites/default"], } file { "${::apache::www_folder}/drupal-8/sites/default/config": ensure => "${project_folder}/config", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-8/sites/default"], } file { "${::apache::www_folder}/drupal-8/sites/default/themes": ensure => "${project_folder}/themes", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-8/sites/default"], } file { "${::apache::www_folder}/drupal-8/sites/default/modules": ensure => "${project_folder}/modules", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-8/sites/default"], } file { "${::apache::www_folder}/drupal-8/sites/default/libraries": ensure => "${project_folder}/libraries", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-8/sites/default"], } file { "${project_folder}": ensure => directory, owner => $project_user, group => $project_user, mode => '0755', } file { "${project_folder}/vendor": ensure => directory, owner => $project_user, group => $project_user, mode => '0755', require => File["${project_folder}"], } # Symlink to aid development file { "${project_folder}/vendor/drupal-8": ensure => "${::apache::www_folder}/drupal-8", require => File["${project_folder}/vendor"], } apache::site { "localhost": ensure => present, docroot => "${::apache::www_folder}/drupal-8", server_alias => "localhost ${project}", mpm_user => $project_user, mpm_group => $project_user, manage_user => false, use => [ 'Drupal 8' ], } }