diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-11-28 10:52:01 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-11-28 10:52:01 -0200 |
commit | 24d1bebfb0f1e12729334ed4cc3559971b0ee798 (patch) | |
tree | 4372bbd2c2e3dcb78acf212e03712b7aab330cb2 /manifests/role/dev | |
parent | 12358ae071f956676ada0e4310910d540e607eb5 (diff) | |
download | puppet-nodo-24d1bebfb0f1e12729334ed4cc3559971b0ee798.tar.gz puppet-nodo-24d1bebfb0f1e12729334ed4cc3559971b0ee798.tar.bz2 |
Adds nodo::role::dev::drupal6
Diffstat (limited to 'manifests/role/dev')
-rw-r--r-- | manifests/role/dev/drupal6.pp | 146 |
1 files changed, 146 insertions, 0 deletions
diff --git a/manifests/role/dev/drupal6.pp b/manifests/role/dev/drupal6.pp new file mode 100644 index 0000000..3addb57 --- /dev/null +++ b/manifests/role/dev/drupal6.pp @@ -0,0 +1,146 @@ +# +# Class for a Drupal 6 development website +# +class nodo::role::dev::drupal6( + $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::series5 + include database + include drupal + + # Ensure we have an 6.x instance + exec { 'drupal-download-6.x': + command => '/usr/local/bin/drupal download 6', + user => "root", + creates => '/var/www/data/drupal-6', + require => File['/usr/local/bin/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-6/sites/default": + # ensure => $project_folder, + # force => true, + #} + + #file { "${::apache::www_folder}/drupal-6/sites/${project}": + # ensure => $project_folder, + # force => true, + #} + + file { "${::apache::www_folder}/drupal-6/sites/default": + ensure => directory, + owner => root, + group => root, + mode => '0755', + require => Exec['drupal-download-6.x'], + force => true, + } + + file { "${::apache::www_folder}/drupal-6/sites/${project}": + ensure => "${::apache::www_folder}/drupal-6/sites/default", + force => true, + require => File["${::apache::www_folder}/drupal-6/sites/default"], + } + + file { "${::apache::www_folder}/drupal-6/sites/default/settings.php": + ensure => "${project_folder}/settings.php", + owner => root, + group => root, + force => true, + require => File["${::apache::www_folder}/drupal-6/sites/default"], + } + + file { "${::apache::www_folder}/drupal-6/sites/default/files": + ensure => "${project_folder}/files", + owner => root, + group => root, + force => true, + require => File["${::apache::www_folder}/drupal-6/sites/default"], + } + + file { "${::apache::www_folder}/drupal-6/sites/default/themes": + ensure => "${project_folder}/themes", + owner => root, + group => root, + force => true, + require => File["${::apache::www_folder}/drupal-6/sites/default"], + } + + file { "${::apache::www_folder}/drupal-6/sites/default/modules": + ensure => "${project_folder}/modules", + owner => root, + group => root, + force => true, + require => File["${::apache::www_folder}/drupal-6/sites/default"], + } + + file { "${::apache::www_folder}/drupal-6/sites/default/libraries": + ensure => "${project_folder}/libraries", + owner => root, + group => root, + force => true, + require => File["${::apache::www_folder}/drupal-6/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-6": + ensure => "${::apache::www_folder}/drupal-6", + require => File["${project_folder}/vendor"], + } + + apache::site { "localhost": + ensure => absent, + } + + apache::site { "${project}": + ensure => present, + docroot => "${::apache::www_folder}/drupal-6", + server_alias => "localhost ${project} ${project}.localhost ${project}.local", + mpm_user => $project_user, + mpm_group => $project_user, + manage_user => false, + manage_docroot => false, + use => [ 'Drupal 6' ], + require => Exec['drupal-download-6.x'], + } +} |