From 459e12d0a5dc1984ae9642f6aa453f371d2d161f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 8 May 2019 13:23:24 +0200 Subject: [PATCH] Add media directory for caldance --- modules/role/manifests/caldance.pp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/role/manifests/caldance.pp b/modules/role/manifests/caldance.pp index f44455f..2794e00 100644 --- a/modules/role/manifests/caldance.pp +++ b/modules/role/manifests/caldance.pp @@ -61,6 +61,12 @@ class role::caldance ( owner => $user, group => $group, require => User["$user:"], + } -> + file { "${home}/media": + ensure => "directory", + mode => "0755", + owner => "http", + group => "http", } exec { "initialize_venv": @@ -107,6 +113,14 @@ class role::caldance ( require => [User["$user:"], File["$caldance_app/manage.py"]], refreshonly => true, } ~> + exec { "py-symlink-file": + cwd => $caldance_app, + user => $user, + environment => concat(["HOME=${home}"], $shell_env), + command => "/usr/bin/ln -sf ${home}/media www/media", + require => [User["$user:"], File["$caldance_app/manage.py"]], + refreshonly => true, + } ~> exec { "reload httpd": command => "/usr/bin/systemctl reload httpd", require => [User["$user:"], File["$caldance_app/manage.py"]], -- 2.41.0