From b4a7f74268b71c3c63f460b3c86287aa0806c237 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 11 May 2015 21:25:06 +0200 Subject: Fix ordering between purging and adding/removing modules for debian Before, purging files from the `mods-enabled` dir and adding modules to this dir happened unordered, meaning that some modules are added before all old modules are purged. Puppet (3.7.2) somehow screws this up and some modules are not installed that should be. see https://gitlab.com/shared-puppet-modules-group/apache/issues/6 for details --- manifests/debian/module.pp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manifests/debian/module.pp b/manifests/debian/module.pp index 9688430..252948f 100644 --- a/manifests/debian/module.pp +++ b/manifests/debian/module.pp @@ -9,7 +9,7 @@ define apache::debian::module( package { $package_name: ensure => $ensure, notify => Service['apache'], - require => Package['apache'], + require => [ File['modules_dir'], Package['apache'] ], } } @@ -27,10 +27,13 @@ define apache::debian::module( unless => "/bin/sh -c '[ -L ${modules_dir}-enabled/${name}.load ] \\ && [ ${modules_dir}-enabled/${name}.load -ef ${modules_dir}-available/${name}.load ]'", notify => Service['apache'], - require => $package_name ? { + require => [ + File['modules_dir'], + $package_name ? { 'absent' => Package['apache'], default => Package[['apache',$package_name]], - }, + } + ], } } } -- cgit v1.2.3