From c9f74a0f6da6bb48ed773678f6cf8488295e748f Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Mon, 26 Feb 2024 09:41:33 +0100 Subject: [PATCH] Try to avoid create_resources() function --- manifests/config.pp | 6 +++++- manifests/program.pp | 21 ++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 65e22263..64174514 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -84,7 +84,11 @@ } if !empty($programs) { - create_resources(haproxy::program, $programs) + $programs.each |String $program, Hash $attributes| { + Resource['haproxy::program'] { $program: + *=> $attributes, + } + } } } diff --git a/manifests/program.pp b/manifests/program.pp index 8afec086..f24c8a5a 100644 --- a/manifests/program.pp +++ b/manifests/program.pp @@ -1,7 +1,14 @@ # @summary Program definition # -# A command to be executed by haproxy master process -# +# @param command +# A command to be executed by haproxy master process +# @param user +# @param group +# @param options +# @param instance +# haproxy instance +# @param config_file +# Path to haproxy config # @see https://www.haproxy.com/documentation/haproxy-configuration-tutorials/programs/ # @example # haproxy::program { 'hello': @@ -30,11 +37,11 @@ order => "40-program-${name}", target => $_config_file, content => epp('haproxy/haproxy_program.epp', { - 'name' => $name, - 'command' => $command, - 'user' => $user, - 'group' => $group, - 'options' => $options, + 'name' => $name, + 'command' => $command, + 'user' => $user, + 'group' => $group, + 'options' => $options, }), } }