"LOG_FILE" => "$home/caldev_django.log",
"MEDIA_ROOT" => "$home/media",
}
- $shell_env = $environment.map |$key, $value| { "$key=$value" }
file { $home:
mode => "0755",
file { "${home}/media":
ensure => "directory",
mode => "0755",
- owner => "http",
- group => "http",
+ owner => $user,
+ group => $group,
}
exec { "initialize_venv":
exec { "py-requirements":
cwd => $caldance_app,
user => $user,
- environment => concat(["HOME=${home}"], $shell_env),
+ environment => ["HOME=${home}"],
command => "/usr/bin/sed -i -e '/GDAL/d' requirements.txt && ${home}/virtualenv/bin/pip install -r requirements.txt --upgrade",
require => User["$user:"],
refreshonly => true,
exec { "py-migrate":
cwd => $caldance_app,
user => $user,
- environment => concat(["HOME=${home}"], $shell_env),
- command => "$caldance_app/manage.py migrate",
- require => [User["$user:"], File["$caldance_app/manage.py"]],
+ environment => ["HOME=${home}"],
+ command => "$caldance_app/manage migrate",
+ require => [User["$user:"], File["$caldance_app/manage"]],
refreshonly => true,
} ~>
exec { "py-static":
cwd => $caldance_app,
user => $user,
- environment => concat(["HOME=${home}"], $shell_env),
- command => "$caldance_app/manage.py collectstatic --no-input",
- require => [User["$user:"], File["$caldance_app/manage.py"]],
+ environment => ["HOME=${home}"],
+ command => "$caldance_app/manage collectstatic --no-input",
+ require => [User["$user:"], File["$caldance_app/manage"]],
refreshonly => true,
} ~>
exec { "restart uwsgi application":
$uwsgi_path = "${home}/virtualenv/bin/uwsgi"
$python_path = "${home}/virtualenv/bin/python"
- file { "$caldance_app/manage.py":
+ file { "$caldance_app/manage":
owner => $user,
group => $group,
mode => "0755",
- content => template("role/caldance/manage.py.erb"),
+ content => template("role/caldance/manage.sh.erb"),
require => [
User["$user:"],
Archive[ "${home}/caldance_${caldance_version}.tar.gz"],
profile::postgresql::master { "postgresql master for caldance":
letsencrypt_host => $web_host,
- backup_hosts => ["backup-1"],
+ backup_hosts => [],
}
postgresql::server::db { $pg_db:
proxy_pass => [
{
path => "/",
- url => "unix:$socket|uwsgi://caldance-app",
+ url => "unix:$socket|uwsgi://caldance-app/",
reverse_urls => [],
no_proxy_uris => [ "/media/", "/static/" ],
}
enable => true
}
- $mailtos = join($cron_pip, ",")
cron::job { "list_outdated_pip_packages":
- ensure => present,
- user => $user,
- environment => concat(["HOME=${home}","MAILTO=${mailtos}"], $shell_env),
- command => "${home}/virtualenv/bin/pip list --outdated",
- minute => "15",
- hour => "0",
- require => Exec["initialize_venv"],
+ ensure => absent
}
}