]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
Add media directory for caldance
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 8 May 2019 11:23:24 +0000 (13:23 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 13 May 2019 14:47:00 +0000 (16:47 +0200)
modules/role/manifests/caldance.pp

index f44455f4be1ea61797e75bf80ca68c222afd18ba..2794e00ed519f82173cc5b807a612c9df5cc3901 100644 (file)
@@ -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"]],