forked from nextgis/nextgisweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vagrant.pp
62 lines (47 loc) · 1.72 KB
/
vagrant.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
$rootdir = "/srv/ngw"
class { 'nextgisweb::libs': }
nextgisweb::venv { "${rootdir}/env":
sources => ['/vagrant', ],
user => vagrant,
require => Class['nextgisweb::libs'],
}
file { "${rootdir}": ensure => directory, owner => vagrant }
nextgisweb::db { 'ngw': password => 'vagrant' }
$preseed_ini = "[core]
database.name = ngw
database.host = localhost
database.user = ngw
database.password = vagrant
[pyramid]
secret = vagrant
[file_storage]
path = ${rootdir}/data/file_storage
[file_upload]
path = ${rootdir}/data/file_upload"
file { "${rootdir}/preseed.ini": ensure => file, content => $preseed_ini, owner => vagrant }
$pserve_ini = "[app:main]
use = egg:nextgisweb
config = %(here)s/config.ini
[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 5000"
file { "${rootdir}/pserve.ini": ensure => file, content => $pserve_ini, owner => vagrant }
file { "${rootdir}/data": ensure => directory, owner => vagrant, require => File["${rootdir}"] }
file { "${rootdir}/data/file_storage": ensure => directory, owner => vagrant, require => File["${rootdir}/data"]}
file { "${rootdir}/data/file_upload": ensure => directory, owner => vagrant, require => File["${rootdir}/data"]}
exec { 'nextgisweb-config':
command => "${rootdir}/env/bin/nextgisweb-config --no-comments --preseed preseed.ini > config.ini",
cwd => "${rootdir}",
require => [
File["${rootdir}/preseed.ini"],
File["${rootdir}/data/file_upload"],
File["${rootdir}/data/file_storage"],
Nextgisweb::Venv["${rootdir}/env"],
Nextgisweb::Db["ngw"],
]
}
exec { 'nextgisweb initialize_db':
command => "${rootdir}/env/bin/nextgisweb --config ${rootdir}/config.ini initialize_db",
require => Exec['nextgisweb-config'],
}