From: Felix Dörre Date: Fri, 16 Jun 2017 21:36:10 +0000 (+0200) Subject: upd: cleanup file-dependencies for lxcs X-Git-Url: https://code.wpia.club/?p=infra.git;a=commitdiff_plain;h=8f38a27c5d1514d7f17f859655e5e62ba38f7242 upd: cleanup file-dependencies for lxcs lxc containers with bind mounts require the file resources of the source paths of those bind mounts. Declare this in the lxc module, instead of declaring those requirements individually in the module definitions. Change-Id: If8beec5f772e3ce316a6f9d6b47484d891e4cfa1 --- diff --git a/environments/production/manifests/root.pp b/environments/production/manifests/root.pp index db84e8d..e041158 100644 --- a/environments/production/manifests/root.pp +++ b/environments/production/manifests/root.pp @@ -110,7 +110,7 @@ if $signerLocation == 'self' { "/run/git-smart-http-socket" => {target => 'git-smart-http-socket'}, "/data/git" => { 'target' => "srv/git", option => ",ro"} }, - require => File['/data/nginx', '/data/crl/htdocs', '/data/gigi-crl'] + require => File['/data/crl/htdocs'] } file { '/data': ensure => 'directory', @@ -154,7 +154,6 @@ if $signerLocation == 'self' { "/data/postgres/data" => { target => "var/lib/postgresql"}, "/data/postgres/conf" => { target => "etc/postgresql"} }, - require => File['/data/postgres'] } $gigi_serial_conf= $signerLocation ? { 'self' => [], @@ -170,7 +169,6 @@ if $signerLocation == 'self' { "/data/gigi-crl" => { target => "var/lib/cassiopeia/ca"} }, confline => $gigi_serial_conf, - require => File['/data/gigi', '/data/gigi-crl'] } if $signerLocation == 'self' { lxc::container { 'cassiopeia': @@ -197,7 +195,6 @@ if $signerLocation == 'self' { ensure => 'directory' } lxc::container { 'gitweb': - require => File['/data/git', '/run/gitweb-socket', '/run/git-smart-http-socket'], contname => 'gitweb', dir => ['/gitweb-socket', '/git-smart-http-socket', '/srv/git'], bind => { diff --git a/modules/lxc/manifests/init.pp b/modules/lxc/manifests/init.pp index d2795b3..0722b76 100644 --- a/modules/lxc/manifests/init.pp +++ b/modules/lxc/manifests/init.pp @@ -68,7 +68,7 @@ class lxc { file_line { "lxc-$contname-mount-$out": path => "/var/lib/lxc/$contname/config", line => "lxc.mount.entry = $out ${in[target]} none bind${in[option]} 0 0", - require=> File_line["lxc-$contname-conf5"], + require=> [File_line["lxc-$contname-conf5"], File["$out"]], notify => Exec["lxc-$contname-started"], } }