puppet-nginx icon indicating copy to clipboard operation
puppet-nginx copied to clipboard

Exported members and streams

Open cova-fe opened this issue 7 years ago • 5 comments

I'm using the feature of exporting members to add servers to a stream. However face issues when upstream resource tries to collect exported resources, as concat searches in /etc/nginx/conf.d/whatever-upstream.conf instead of /etc/nginx/conf.stream.d/whatever.

Looking at upstream/member.pp code, there is a

target  => "${::nginx::conf_dir}/conf.d/${upstream}-upstream.conf",

shouldn't be the same as upstream.pp, that uses the parameter $upstream_context to decide where to place the conf file, something like

target  => "${::nginx::conf_dir}/${conf_dir_real}/${upstream}-upstream.conf",

(with related logic, of course?)

I'm testing a small patch as described, but maybe I got the whole logic wrong (very likely, I fear...). Any hint?

cova-fe avatar Mar 30 '17 09:03 cova-fe

I actually think the logic should be simplified, or unified, not duplicated.

It took us at $co a while to figure out what we're doing wrong when using this module, when we didn't set nginx::stream => on

a lot of the concept that we're exposing are very unintuitive

igalic avatar Mar 30 '17 11:03 igalic

I see your point; however stream flag is indeed on (as the needed stream code block is present in conf files.)

Unifying it seems to be a good idea, however I wonder how this can be done in an exported resource, that is declared with only a @@nginx::resource::upstream::member and no other references to the same module classes...

cova-fe avatar Mar 30 '17 11:03 cova-fe

possibly related, of the things i'm missing in @@nginx::resource::upstream::member is an assignment of port or protocol… https://github.com/voxpupuli/puppet-nginx/issues/1055

igalic avatar Mar 30 '17 11:03 igalic

see https://github.com/voxpupuli/puppet-nginx/pull/1061

cova-fe avatar Mar 31 '17 08:03 cova-fe

Just lost a lot of time because settings stream => on on the init of the module is not documented in the README.

It should throw an error in my opinion when defining streams when stream is not set to on

AranVinkItility avatar Apr 17 '18 15:04 AranVinkItility