Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/web/manifests/server.pp

Issue 29435656: Noissue - Generate content on provision (Closed)
Patch Set: For comment 4 Created May 12, 2017, 4:34 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/web/manifests/server.pp
===================================================================
--- a/modules/web/manifests/server.pp
+++ b/modules/web/manifests/server.pp
@@ -12,6 +12,8 @@
include sitescripts
+ $PYTHONPATH = 'PYTHONPATH=/opt/cms:/opt/sitescripts'
+
# Ensure there is at least one character in the respective strings;
# see https://codereview.adblockplus.org/29329028/#msg3
validate_re($vhost, '.+')
@@ -25,7 +27,7 @@
Cron {
environment => concat(hiera('cron::environment', []), [
- 'PYTHONPATH=/opt/cms:/opt/sitescripts',
+ $PYTHONPATH,
]),
}
@@ -114,6 +116,21 @@
creates => "/home/www/${repository}/.hg/hgrc",
}
+ $initialize_content_exec = [
+ 'python', '-m', 'cms.bin.generate_static_pages',
+ "/home/www/${repository}", "/var/www/${vhost}",
+ ]
+
+ if $::environment == 'development' {
mathias 2017/05/12 16:42:12 If you'd used refreshonly => $::environment != "de
f.lopez 2017/05/12 17:43:39 You are right.
+ exec {"initialize_content":
+ command => shellquote($initialize_content_exec),
+ path => ["/usr/bin/", "/bin/"],
+ user => www,
+ require => [Exec["fetch_repo"], Exec["fetch_cms"]],
+ environment => $PYTHONPATH,
+ }
+ }
+
file {'/var/www':
ensure => directory,
mode => 755,
@@ -137,7 +154,7 @@
cron {'update_repo':
ensure => present,
- command => "hg pull -q -R /home/www/${repository} && python -m cms.bin.generate_static_pages /home/www/${repository} /var/www/${vhost}",
+ command => "hg pull -q -R /home/www/${repository} && ${initialize_content_exec} /home/www/${repository} /var/www/${vhost}",
mathias 2017/05/12 16:42:12 Please export the commands preceeding and followin
f.lopez 2017/05/12 17:43:39 I actually thought of this but for a different com
user => www,
minute => '5-59/20',
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld