From 2857a6dec3cafbdb39671528e0c68e0d36ad6301 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 27 Oct 2017 18:51:01 -0200 Subject: Adds nodo::role::dev::drupal8 --- manifests/role/dev/drupal8.pp | 97 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 manifests/role/dev/drupal8.pp diff --git a/manifests/role/dev/drupal8.pp b/manifests/role/dev/drupal8.pp new file mode 100644 index 0000000..938d29e --- /dev/null +++ b/manifests/role/dev/drupal8.pp @@ -0,0 +1,97 @@ +# +# Class for a Drupal 8 development website +# +class nodo::role::dev::drupal8( + #$project_folder = '/vagrant', + #$project_user = 'vagrant', + $project_folder = '/srv/kvmx', + $project_user = 'user', + $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 nodo::utils::development::web + include nodo::utils::development::php + + include php + include database + include drupal + + # 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': + ensure => present, + owner => 'root', + group => 'root', + mode => '0644', + content => "[xdebug]\nxdebug.max_nesting_level=256\n", + require => Package['php5'], + notify => Service['apache2'], + } + + # Zend dependencies + #package { [ 'zendframework', 'zendframework-bin', 'zendframework-resources', 'php5-sqlite' ]: + # ensure => present, + #} + + #file { "/home/${project_user}/.custom": + # ensure => directory, + # owner => $project_user, + # group => $project_user, + # mode => '0755', + #} + + # Custom profile + #file { "/home/${project_user}/.custom/profile": + # ensure => present, + # owner => $project_user, + # group => $project_user, + # mode => '0644', + # source => "puppet:///modules/site_nodo/profile/${project_user}", + # require => File["/home/${project_user}/.custom"], + #} + + # Grunt dependencies + #package { [ 'nodejs', 'nodejs-legacy', 'npm' ]: + # ensure => present, + #} + + # Grunt (to compile bootstrap stuff) + #exec { 'grunt-cli': + # command => 'npm install -g grunt-cli', + # user => 'root', + # creates => '/usr/local/bin/grunt', + # require => Package['npm'], + #} + + $default_db = hiera('websites::default_db', 'default') + $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, + } + + # 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] ], + } + } +} -- cgit v1.2.3