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

[5.0] Terminate ssl on haproxy (bsc#1149535) #2347

Open
wants to merge 2 commits into
base: stable/5.0-pike
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions chef/cookbooks/cinder/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@
default[:cinder][:ha][:op][:monitor][:interval] = "10s"
# Ports to bind to when haproxy is used for the real ports
default[:cinder][:ha][:ports][:api] = 5520

#
# SSL settings
#
default[:cinder][:ssl][:loadbalancer_terminate_ssl] = false
default[:cinder][:ssl][:pemfile] = "/etc/ssl/private/cinder.pem"
2 changes: 2 additions & 0 deletions chef/cookbooks/cinder/recipes/controller_ha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
address node[:cinder][:api][:bind_open_address] ? "0.0.0.0" : cluster_admin_ip
port node[:cinder][:api][:bind_port]
use_ssl (node[:cinder][:api][:protocol] == "https")
terminate_ssl node[:cinder][:ssl][:loadbalancer_terminate_ssl]
pemfile node[:cinder][:ssl][:pemfile]
servers CrowbarPacemakerHelper.haproxy_servers_for_service(node, "cinder", "cinder-controller", "api")
rate_limit node[:cinder][:ha_rate_limit]["cinder-api"]
action :nothing
Expand Down
6 changes: 6 additions & 0 deletions chef/cookbooks/nova/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,9 @@
# metadata/vendordata
#
default[:nova][:metadata][:vendordata][:json] = "{}"

#
# SSL settings
#
default[:nova][:ssl][:loadbalancer_terminate_ssl] = false
default[:nova][:ssl][:pemfile] = "/etc/ssl/private/nova.pem"
2 changes: 2 additions & 0 deletions chef/cookbooks/nova/recipes/controller_ha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
address "0.0.0.0"
port node[:nova][:ports][:api]
use_ssl node[:nova][:ssl][:enabled]
terminate_ssl node[:nova][:ssl][:loadbalancer_terminate_ssl]
pemfile node[:nova][:ssl][:pemfile]
servers CrowbarPacemakerHelper.haproxy_servers_for_service(node, "nova", "nova-controller", "api")
rate_limit node[:nova][:ha_rate_limit]["nova-api"]
action :nothing
Expand Down
12 changes: 12 additions & 0 deletions chef/data_bags/crowbar/migrate/cinder/210_add_haproxy_mode_http.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def upgrade(template_attrs, template_deployment, attrs, deployment)
key = "loadbalancer_terminate_ssl"
Copy link
Member

Choose a reason for hiding this comment

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

what about the pemfile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right, and the same problem exists in other pull requests. Thanks, will do

template_value = template_attrs["cinder"]["ssl"][key]
attrs["cinder"]["ssl"][key] = template_value unless attrs["cinder"]["ssl"].key? key
return attrs, deployment
end

def downgrade(template_attrs, template_deployment, attrs, deployment)
key = "loadbalancer_terminate_ssl"
attrs["cinder"]["ssl"].delete(key) unless template_attrs["cinder"]["ssl"].key? key
return attrs, deployment
end
12 changes: 12 additions & 0 deletions chef/data_bags/crowbar/migrate/nova/214_add_haproxy_mode_http.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def upgrade(template_attrs, template_deployment, attrs, deployment)
key = "loadbalancer_terminate_ssl"
template_value = template_attrs["nova"]["ssl"][key]
attrs["nova"]["ssl"][key] = template_value unless attrs["nova"]["ssl"].key? key
return attrs, deployment
end

def downgrade(template_attrs, template_deployment, attrs, deployment)
key = "loadbalancer_terminate_ssl"
attrs["nova"]["ssl"].delete(key) unless template_attrs["nova"]["ssl"].key? key
return attrs, deployment
end
6 changes: 4 additions & 2 deletions chef/data_bags/crowbar/template-cinder.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"generate_certs": false,
"insecure": false,
"cert_required": false,
"ca_certs": "/etc/cinder/ssl/certs/ca.pem"
"ca_certs": "/etc/cinder/ssl/certs/ca.pem",
"loadbalancer_terminate_ssl": false,
"pemfile": "/etc/ssl/private/cinder.pem"
},
"db": {
"password": "",
Expand All @@ -183,7 +185,7 @@
"cinder": {
"crowbar-revision": 0,
"crowbar-applied": false,
"schema-revision": 209,
"schema-revision": 210,
"element_states": {
"cinder-controller": [ "readying", "ready", "applying" ],
"cinder-volume": [ "readying", "ready", "applying" ]
Expand Down
4 changes: 3 additions & 1 deletion chef/data_bags/crowbar/template-cinder.schema
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@
"generate_certs": { "type" : "bool", "required" : true },
"insecure": { "type" : "bool", "required" : true },
"cert_required": { "type" : "bool", "required" : true },
"ca_certs": { "type" : "str", "required" : true }
"ca_certs": { "type" : "str", "required" : true },
"loadbalancer_terminate_ssl": { "type" : "bool", "required": true},
"pemfile": { "type" : "str", "required": true}
}},
"db": {
"type": "map",
Expand Down
6 changes: 4 additions & 2 deletions chef/data_bags/crowbar/template-nova.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@
"generate_certs": false,
"insecure": false,
"cert_required": false,
"ca_certs": "/etc/nova/ssl/certs/ca.pem"
"ca_certs": "/etc/nova/ssl/certs/ca.pem",
"loadbalancer_terminate_ssl": false,
"pemfile": "/etc/ssl/private/nova.pem"
},
"novnc": {
"ssl": {
Expand Down Expand Up @@ -182,7 +184,7 @@
"nova": {
"crowbar-revision": 0,
"crowbar-applied": false,
"schema-revision": 213,
"schema-revision": 214,
"element_states": {
"nova-controller": [ "readying", "ready", "applying" ],
"nova-compute-ironic": [ "readying", "ready", "applying" ],
Expand Down
4 changes: 3 additions & 1 deletion chef/data_bags/crowbar/template-nova.schema
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@
"generate_certs": { "type" : "bool", "required" : true },
"insecure": { "type" : "bool", "required" : true },
"cert_required": { "type" : "bool", "required" : true },
"ca_certs": { "type" : "str", "required" : true }
"ca_certs": { "type" : "str", "required" : true },
"loadbalancer_terminate_ssl": { "type" : "bool", "required": true},
"pemfile": { "type" : "str", "required": true}
}
},
"novnc": {
Expand Down