Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple servers per location #1278

Merged
merged 1 commit into from
Dec 11, 2018

Conversation

SaschaDoering
Copy link
Contributor

Pull Request (PR) description

By changing the data type, you can now specify multiple servers for
a location. These are then rolled out in a loop. This doesn't break existing installations.

This Pull Request (PR) fixes the following issues

Fixes GH-1187

@SaschaDoering SaschaDoering force-pushed the 1187_recycle_locations branch 2 times, most recently from 0c99478 to 88cba1d Compare November 21, 2018 16:35
content => template('nginx/server/location.erb'),
order => $priority,
}
any2array($server).each |$s| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From our docs:

If you can supply one or multiple values for an attribute it’s common practice to enforce the datatype for one value and an array of that datatype. An example for string is Variant[String[1],Array[String[1]]]. This can be used in the Puppet code as [$var].flatten()

Maybe we should update the docs to any2array(). I'm not sure if this is easier to read.

if ($ssl == true or $ssl_only == true) {
$ssl_priority = $priority + 300
$config_file = "${server_dir}/${server_sanitized}.conf"
if $ensure == present {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add quotes:

Suggested change
if $ensure == present {
if $ensure == 'present' {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, you're right. I add qoutes to present.

@bastelfreak bastelfreak added enhancement New feature or request needs-tests needs-work not ready to merge just yet labels Nov 26, 2018
@bastelfreak
Copy link
Member

Hi @SaschaDoering, thanks for the PR. Can you please add an acceptance test for this as well? Otherwise it looks good!

@SaschaDoering SaschaDoering force-pushed the 1187_recycle_locations branch 3 times, most recently from 0fc9114 to 8265885 Compare November 28, 2018 12:54
@SaschaDoering
Copy link
Contributor Author

Hi, I add an acceptance test for locations. This is my first one so I hope it's allright. Also I fixed the issue with the missing quotes. I'm not sure how to understand your comment for updating the docs with any2array(). Do you mean the head of manifests/resource/location.pp or the basic documentation under https://voxpupuli.org/docs/?

@bastelfreak
Copy link
Member

Sorry about the confusion, that was basically a note for myself :D

@bastelfreak bastelfreak removed needs-tests needs-work not ready to merge just yet labels Nov 28, 2018
@bastelfreak
Copy link
Member

This looks good to me, but I will keep it open for a few days in case somebody else wants to review it as well.

@@ -123,6 +122,14 @@
# server => 'test2.local',
# }
#
# Use one location in multiple serrvers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling of servers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the confusion, that was basically a note for myself :D

Not for that, thank you for the review ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the finding, I've fixed that.

@@ -7,8 +7,7 @@
# (present|absent)
# [*internal*] - Indicates whether or not this location can be
# used for internal requests only. Default: false
# [*server*] - Defines the default server for this location
# entry to include with
# [*server*] - Defines all server for this location entry to include with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This documentation doesn't read very well. Could you try rephrasing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about 'Defines a server or list of servers that integrate these location'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the text, hopefully it's better than the last try :)

By changing the data type, you can now specify multiple servers for
a location.

Fixes voxpupuliGH-1187
@bastelfreak bastelfreak merged commit 4b06d59 into voxpupuli:master Dec 11, 2018
cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this pull request Sep 13, 2019
Rubueno pushed a commit to Rubueno/puppet-nginx that referenced this pull request Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Same location linked to multiple nginx::servers
3 participants