From 0e55e618ae4fdc7c1f3cbe4ea05b62dadefba743 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 26 Jul 2016 15:22:12 -0400 Subject: [PATCH] Make sure global worker defs only done once This commit makes sure that all the global definitions on the worker class are only defined once. If we don't check for the previous definition when running with multiple workers on a single node things will fail. Change-Id: I947d61f455778fe41d0a4723c99d029272d2155d --- manifests/worker.pp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/manifests/worker.pp b/manifests/worker.pp index 16b4277..ac87b3e 100644 --- a/manifests/worker.pp +++ b/manifests/worker.pp @@ -26,13 +26,17 @@ define subunit2sql::worker ( ) { $suffix = "-${name}" - file { '/etc/logstash/': - ensure => absent, + if ! defined(File['/etc/logstash']) { + file { '/etc/logstash/': + ensure => absent, + } } - user { 'subunit': - ensure => present, - system => true, + if ! defined(User['subunit']) { + user { 'subunit': + ensure => present, + system => true, + } } if ! defined(File['/etc/subunit2sql']) {