diff --git a/manifests/resource/upstream.pp b/manifests/resource/upstream.pp index bd5e66f..651b5a0 100644 --- a/manifests/resource/upstream.pp +++ b/manifests/resource/upstream.pp @@ -97,8 +97,10 @@ define nginx::resource::upstream ( 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 0000000..0d81183 --- /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 |>> +}