aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/init.pp23
-rw-r--r--manifests/maintenance.pp7
2 files changed, 27 insertions, 3 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 577e6fe..da68b08 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -4,6 +4,29 @@ class drupal {
include drupal::makefiles
include drupal::maintenance
+ group { 'drupal':
+ ensure => present,
+ allowdupe => false,
+ }
+
+ user { 'drupal':
+ ensure => present,
+ allowdupe => false,
+ shell => '/bin/bash',
+ gid => 'drupal',
+ home => '/var/lib/drupal',
+ require => Group['drupal'],
+ }
+
+ # This shall hold drush-backups in the future
+ file { '/var/lib/drupal':
+ ensure => directory,
+ owner => 'drupal',
+ group => 'drupal',
+ mode => 0750,
+ require => User['drupal'],
+ }
+
# TODO: old location, remove in the future
file { "/usr/local/sbin/drupal":
ensure => absent,
diff --git a/manifests/maintenance.pp b/manifests/maintenance.pp
index 16f4c6a..720089e 100644
--- a/manifests/maintenance.pp
+++ b/manifests/maintenance.pp
@@ -2,21 +2,22 @@ class drupal::maintenance {
# Run drupal cron
cron { "drupal-cron":
command => "/usr/local/bin/drupal cron &> /dev/null",
- user => root,
+ user => drupal,
hour => "*/1",
minute => "15",
ensure => present,
- require => File['/usr/local/sbin/drupal'],
+ require => [ File['/usr/local/sbin/drupal'], User['drupal'] ],
}
# Keep themes and modules up-to-date
cron { "drupal-update":
command => "/usr/local/bin/drupal cron-update",
- user => root,
+ user => drupal,
# Run once a week after security releases (usually on Wednesdays)
weekday => 5,
hour => "02",
minute => "30",
ensure => present,
+ require => User['drupal'],
}
}