# # Class for a Drupal 7 development website # class nodo::role::dev::drupal7( $project = 'drupal', $project_folder = '/srv/shared', # '/vagrant', '/srv/kvmx' $project_user = 'user', # 'vagrant' $db_name = 'drupal', $db_password = 'hackme', ) { 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, } # Do not use this password on production machines database::instance { $db_name: password => $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-7/sites/default": # ensure => $project_folder, # force => true, #} #file { "${::apache::www_folder}/drupal-7/sites/${project}": # ensure => $project_folder, # force => true, #} file { "${::apache::www_folder}/drupal-7/sites/default": ensure => directory, owner => root, group => root, mode => '0755', require => Exec['drupal-download-7.x'], force => true, } file { "${::apache::www_folder}/drupal-7/sites/${project}": ensure => "${::apache::www_folder}/drupal-7/sites/default", force => true, require => File["${::apache::www_folder}/drupal-7/sites/default"], } file { "${::apache::www_folder}/drupal-7/sites/default/settings.php": ensure => "${project_folder}/settings.php", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-7/sites/default"], } file { "${::apache::www_folder}/drupal-7/sites/default/services.yml": ensure => "${project_folder}/services.yml", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-7/sites/default"], } file { "${::apache::www_folder}/drupal-7/sites/default/files": ensure => "${project_folder}/files", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-7/sites/default"], } file { "${::apache::www_folder}/drupal-7/sites/default/config": ensure => "${project_folder}/config", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-7/sites/default"], } file { "${::apache::www_folder}/drupal-7/sites/default/themes": ensure => "${project_folder}/themes", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-7/sites/default"], } file { "${::apache::www_folder}/drupal-7/sites/default/modules": ensure => "${project_folder}/modules", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-7/sites/default"], } file { "${::apache::www_folder}/drupal-7/sites/default/libraries": ensure => "${project_folder}/libraries", owner => root, group => root, force => true, require => File["${::apache::www_folder}/drupal-7/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-7": ensure => "${::apache::www_folder}/drupal-7", require => File["${project_folder}/vendor"], } apache::site { "localhost": ensure => absent, } apache::site { "${project}": ensure => present, docroot => "${::apache::www_folder}/drupal-7", server_alias => "localhost ${project} ${project}.localhost ${project}.local", mpm_user => $project_user, mpm_group => $project_user, manage_user => false, manage_docroot => false, use => [ 'Drupal 7' ], require => Exec['drupal-download-7.x'], } }