From 6aee9743b5866d4185b11fc96182725f4877c6f7 Mon Sep 17 00:00:00 2001 From: Michael Bacon Date: Thu, 14 Jul 2016 17:50:32 -0400 Subject: [PATCH] Separate upstream member collection into separate module to kill storeconfig warn --- manifests/resource/upstream.pp | 6 ++++-- manifests/resource/upstream/collect.pp | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 manifests/resource/upstream/collect.pp diff --git a/manifests/resource/upstream.pp b/manifests/resource/upstream.pp index bd5e66f3f..651b5a0a6 100644 --- a/manifests/resource/upstream.pp +++ b/manifests/resource/upstream.pp @@ -97,8 +97,10 @@ content => template('nginx/conf.d/upstream_members.erb'), } } else { - # Collect exported members: - ::Nginx::Resource::Upstream::Member <<| upstream == $name |>> + class { 'nginx::resource::upstream::collect': + # Collect exported members + upstream_name => $name, + } } concat::fragment { "${name}_upstream_footer": diff --git a/manifests/resource/upstream/collect.pp b/manifests/resource/upstream/collect.pp new file mode 100644 index 000000000..0d81183fd --- /dev/null +++ b/manifests/resource/upstream/collect.pp @@ -0,0 +1,12 @@ +# Class to collect exported upstream members, if needed. +# +# This is separated into a separate class in order to remove errors if +# storeconfigs are unavailable. + +class nginx::resource::upstream::collect ( + $upstream_name, +) +{ + # Collect exported members: + ::Nginx::Resource::Upstream::Member <<| upstream == $upstream_name |>> +}