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

listen_options and ipv6_listen_options doesn't have the same default value #874

Open
FlorianSW opened this issue Sep 15, 2016 · 2 comments

Comments

@FlorianSW
Copy link
Contributor

With issue #30 the listen directive's options for ipv6 support was moved from the template to the puppet manifest, which was a good change btw.

However, the listen options parameters (ipv6_listen_options and listen_options) now have completely different default values, which is confusing. In fact, I ran into the problem, that I assumed, that setting ipv6_enable to all my vhosts would be enough configuration for ipv6, however, I had to change all ipv6 vhosts again to set the correct listen options (which was mostly '' excluding one vhost).

It would be nice, if we could think about changing the default value of one of both to make it (nearly) the same so that they're less confusing. What do you think? :)

ghost pushed a commit to droidwiki/operations-puppet that referenced this issue Sep 15, 2016
The puppet nginx module support ipv6_enable, which will insert a listen
option to the vhost (if set to true). However, the default ipv6_listen_options
parameter is different from the listen_options (for ipv4) parameter:
$listen_options = undef,
$ipv6_listen_options = 'default ipv6only=on',

This means: Enabling ipv6 support for a vhost with ipv6_enable will use the
default and ipv6only=on options for the listen directive. Having more then one
ipv6-enabled vhost on the same address:port combination including one of the
default listen options breaks nginx with message:
nginx: [emerg] duplicate listen options for [::]:80 ...

This change fixes the false implementation of ipv6 support for all vhosts by
setting the ipv6 listen options to '', excluding the ipv4 default vhost.

The different default values was reported upstream with #874:
voxpupuli/puppet-nginx#874

Follow up: I690799e6f4977ced914b6e6e1dc03563380d4d73

Change-Id: I9d02c49ac1934336ab553bbb29520304306d0ce3
@dol
Copy link
Contributor

dol commented Oct 24, 2016

While cleaning up the PR #769 I stumbled upon the same issue in the mailhost configuration. At the current state of the module it's not possible to define a IPv6 only vhost or mailhost.
I would assume if the listen_port attribute is set the IPv6 listen_port attribute inherits the value of the listen_port. If the IPv4 and IPv6 ports differ it possible to use the ipv6_listen_port attribute that will overwrite the inherited value of the IPv4 value.
This change could be introduced without a major BC break. This change only affects people that changed the listen port to something else then Port 80 (e.g. 8080) and also server IPv6. In this case, the default IPv6 listen port will inherit the IPv4 value (e.g. 8080). IMHO this is a setup that is quite rare.

@wyardley
Copy link
Collaborator

@dol Is reworking this something you'd be able to contribute a PR / tests for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants