aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/role/dev/drupal8.pp66
1 files changed, 42 insertions, 24 deletions
diff --git a/manifests/role/dev/drupal8.pp b/manifests/role/dev/drupal8.pp
index 74e056c..f508a09 100644
--- a/manifests/role/dev/drupal8.pp
+++ b/manifests/role/dev/drupal8.pp
@@ -2,21 +2,14 @@
# Class for a Drupal 8 development website
#
class nodo::role::dev::drupal8(
+ $project = 'drupal',
$project_folder = '/srv/kvmx', # '/vagrant'
$project_user = 'user', # 'vagrant'
- $run_makefile = false,
) {
include nodo::role::dev::virtual
-
- class { 'apache':
- default_folder => "${project_folder}/vendor/drupal-8",
- default_user => $project_user,
- default_group => $project_user,
- }
-
+ include apache
include nodo::utils::development::web
include nodo::utils::development::php
-
include php
include database
include drupal
@@ -34,7 +27,7 @@ class nodo::role::dev::drupal8(
notify => Service['apache2'],
}
- $default_db = hiera('websites::default_db', 'default')
+ $default_db = hiera('websites::default_db', 'drupal')
$default_db_password = hiera('websites::default_db::password', 'hackme')
# Do not use this password on production machines
@@ -42,19 +35,44 @@ class nodo::role::dev::drupal8(
password => $default_db_password,
}
- # Install the development website
- if $run_makefile != false {
- package { 'make':
- ensure => present,
- }
-
- exec { 'make-platform':
- command => '/usr/bin/make platform',
- user => $project_user,
- cwd => "${project_folder}",
- creates => "${project_folder}/vendor/drupal-8/sites/default/settings.php",
- timeout => 0,
- require => [ Package['make'], Database::Instance[$default_db] ],
- }
+ 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 { "${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' ],
}
}