-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add port 443 to listen_ports in apache2 (SOC-9172) #1954
base: master
Are you sure you want to change the base?
Conversation
98d7980
to
6b0edbb
Compare
I need to check this new version actually works; I don't trust myself to have got the Ruby syntax right. |
This actually looks right (once you fix the syntax). I'm really surprised we didn't see it before... |
6b0edbb
to
c11500f
Compare
This commit stops port clashes between horizon and haproxy on HA deployments with SSL enabled. Without this patch, the apache ssl recipe adds port 443 to the apache listen.conf file without adding the port to the listen_ports array. In a HA setup with ssl enabled, both HAProxy and Apache will try to use port 443. To work around this, the horizon ssl recipe currently checks to see what ports are listed in a listen_ports array, and if either port 443 or port 80 is in there, it wipes the listen.conf file. As port 443 is not currently in the listen_ports array, the horizon recipe leaves the listen.conf file alone in cases where port 443 is in there. This commit adds port 443 to the listen_ports array at the point where it is added as a listen port, so that the horizon recipe can find it later. More explanation in: https://bugzilla.suse.com/show_bug.cgi?id=1141490#c34
c11500f
to
c5eeab3
Compare
Yeah, it made me wonder if there was a not-obvious but important reason for the current implementation, since it's easier to add 443 to the array. |
[I had an old comment here that said this shouldn't be merged, but actually it was wrong. Kept it here to avoid confusion from anyone who'd already read it, but it should be ignored.] OLD INCORRECT COMMENT: (HA cookbook in the crowbar-openstack repo, that is: https://github.com/crowbar/crowbar-openstack/blob/master/chef/cookbooks/horizon/recipes/ha.rb#L52 should change to just remove the specified ports instead of clearing the array entirely) END OF OLD INCORRECT COMMENT |
@rhafer @cmurphy @jgrassler Could you please take a look? This seems like a correct change, I'm just unsure if we can't break something else with it. |
I'm not really sure if this is the right fix. AFAIU the default for the There seems to be just one place where the attribute is ever touched. And that's in https://github.com/crowbar/crowbar-openstack/blob/master/chef/cookbooks/horizon/recipes/ha.rb#L52 Now we'd be changing the attribute twice. First the port is added to the nodes attribute (in the mod_ssl recipe) and then its removed it again later (in the horizion/ha recipe). I am not exactly sure about the run order here, but depending on which other services are deployed on the node the recipes might actually change the order even. (Depending of which cookbook does the first Given that Or did I overlook something and |
I'd be happy to change it to that, I just don't know why that |
I think that is still an artifact from the old "upstream" chef cookbook for apache. I.e. the apache cookbook in crowbar was forked from https://github.com/chefs/cookbooks at some point (which is archived here: https://github.com/chef-boneyard/cookbooks/tree/deprecated-master/apache2 if you're interested in archaeology ;-) ). I don't think crowbar needs that specific part as |
This commit stops port clashes between horizon and haproxy on HA
deployments with SSL enabled.
Without this patch, the apache ssl recipe adds port 443 to the apache
listen.conf file without adding the port to the listen_ports array.
In a HA setup with ssl enabled, both HAProxy and Apache will
try to use port 443. To work around this, the horizon ssl recipe currently
checks to see what ports are listed in a listen_ports array, and
if either port 443 or port 80 is in there, it wipes the listen.conf
file. As port 443 is not currently in the listen_ports array, the
horizon recipe leaves the listen.conf file alone in cases where
port 443 is in there.
This commit adds port 443 to the listen_ports array at the point
where it is added as a listen port, so that the horizon recipe can
find it later.
More explanation in:
https://bugzilla.suse.com/show_bug.cgi?id=1141490#c34