Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 class web::server( | 1 class web::server( |
2 $vhost, | 2 $vhost, |
3 $repository, | 3 $repository, |
4 $certificate = hiera('web::server::certificate', 'undef'), | 4 $certificate = hiera('web::server::certificate', 'undef'), |
5 $private_key = hiera('web::server::private_key', 'undef'), | 5 $private_key = hiera('web::server::private_key', 'undef'), |
6 $is_default = false, | 6 $is_default = false, |
7 $aliases = undef, | 7 $aliases = undef, |
8 $custom_config = undef, | 8 $custom_config = undef, |
9 $multiplexer_locations = undef, | 9 $multiplexer_locations = undef, |
10 $geoip = false, | 10 $geoip = false, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 user => www, | 114 user => www, |
115 timeout => 0, | 115 timeout => 0, |
116 creates => "/home/www/${repository}/.hg/hgrc", | 116 creates => "/home/www/${repository}/.hg/hgrc", |
117 } | 117 } |
118 | 118 |
119 $initialize_content_exec = [ | 119 $initialize_content_exec = [ |
120 'python', '-m', 'cms.bin.generate_static_pages', | 120 'python', '-m', 'cms.bin.generate_static_pages', |
121 "/home/www/${repository}", "/var/www/${vhost}", | 121 "/home/www/${repository}", "/var/www/${vhost}", |
122 ] | 122 ] |
123 | 123 |
124 if $::environment == 'development' { | 124 exec {"initialize_content": |
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.
| |
125 exec {"initialize_content": | 125 command => shellquote($initialize_content_exec), |
126 command => shellquote($initialize_content_exec), | 126 path => ["/usr/bin/", "/bin/"], |
127 path => ["/usr/bin/", "/bin/"], | 127 user => www, |
128 user => www, | 128 subscribe => [Exec["fetch_repo"], Exec["fetch_cms"]], |
129 require => [Exec["fetch_repo"], Exec["fetch_cms"]], | 129 refreshonly => true, |
130 environment => $PYTHONPATH, | 130 environment => $PYTHONPATH, |
131 } | |
132 } | 131 } |
133 | 132 |
134 file {'/var/www': | 133 file {'/var/www': |
135 ensure => directory, | 134 ensure => directory, |
136 mode => 755, | 135 mode => 755, |
137 } | 136 } |
138 | 137 |
139 file {[ | 138 file {[ |
140 "/var/cache/$repository", | 139 "/var/cache/$repository", |
141 "/var/www/$vhost", | 140 "/var/www/$vhost", |
142 "/var/www/docs", | 141 "/var/www/docs", |
143 ]: | 142 ]: |
144 ensure => directory, | 143 ensure => directory, |
145 owner => www, | 144 owner => www, |
146 mode => 755, | 145 mode => 755, |
147 } | 146 } |
148 | 147 |
149 cron {'update_cms': | 148 cron {'update_cms': |
150 ensure => present, | 149 ensure => present, |
151 command => "hg pull -q -u -R /opt/cms", | 150 command => "hg pull -q -u -R /opt/cms", |
152 minute => '4-59/20', | 151 minute => '4-59/20', |
153 } | 152 } |
154 | 153 |
154 $update_repo_cmd = [ | |
155 "hg", "pull", "-q", "-R", "/home/www/${repository}", | |
156 ] | |
157 | |
158 $update_webpage_cmd = join( | |
159 [ | |
160 shellquote($update_repo_cmd), | |
161 shellquote($initialize_content_exec) | |
162 ], | |
163 "&&" | |
164 ) | |
165 | |
155 cron {'update_repo': | 166 cron {'update_repo': |
156 ensure => present, | 167 ensure => present, |
157 command => "hg pull -q -R /home/www/${repository} && ${initialize_content_ex ec} /home/www/${repository} /var/www/${vhost}", | 168 command => $update_webpage_cmd, |
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
| |
158 user => www, | 169 user => www, |
159 minute => '5-59/20', | 170 minute => '5-59/20', |
160 } | 171 } |
161 | 172 |
162 } | 173 } |
LEFT | RIGHT |