Skip to content

Commit

Permalink
Add MySQL connection SSL support
Browse files Browse the repository at this point in the history
When 'cinder_galera_use_ssl' is True, use an encrypted connection to
the database using either a self-signed or user-provided CA certificate.

A new non-voting test has been added to verify that the role remains
functional when enabling SSL features.

Partial-Bug: 1667789

Change-Id: Ifeda0acb4b70ba313e6572c806125d31ab3eb300
Depends-On: I95cc994df5118fce7ce588fc0bff979bc283a6f3
  • Loading branch information
jimmymccrory committed Dec 18, 2017
1 parent 3312cd5 commit 198acc0
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ cinder_nova_catalog_admin_info: compute:nova:adminURL

cinder_fatal_deprecations: False

## DB
## Database info
cinder_galera_user: cinder
cinder_galera_database: cinder
cinder_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
cinder_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('/etc/ssl/certs/galera-ca.pem') }}"

## RabbitMQ info

Expand Down
2 changes: 1 addition & 1 deletion templates/cinder.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ enabled_backends={% for backend in cinder_backends|dictsort %}{{ backend.0 }}{%
{% endif %}

[database]
connection = mysql+pymysql://{{ cinder_galera_user }}:{{ cinder_container_mysql_password }}@{{ cinder_galera_address }}/{{ cinder_galera_database }}?charset=utf8
connection = mysql+pymysql://{{ cinder_galera_user }}:{{ cinder_container_mysql_password }}@{{ cinder_galera_address }}/{{ cinder_galera_database }}?charset=utf8{% if cinder_galera_use_ssl | bool %}&ssl_ca={{ cinder_galera_ssl_ca_cert }}{% endif %}

[oslo_messaging_rabbit]
ssl = {{ cinder_rabbitmq_use_ssl }}
Expand Down
11 changes: 11 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ commands =
bash -c "{toxinidir}/tests/test-cinder-upgrades.sh"


[testenv:ssl]
deps =
{[testenv:ansible]deps}
setenv =
{[testenv]setenv}
ANSIBLE_PARAMETERS=-vvv -e galera_use_ssl=True
commands =
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"


[testenv:linters]
deps =
{[testenv:ansible]deps}
Expand Down
21 changes: 21 additions & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- job:
name: openstack-ansible-cinder-ssl-nv
parent: openstack-ansible-functional-ubuntu-xenial
voting: false
vars:
tox_env: ssl
2 changes: 2 additions & 0 deletions zuul.d/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- openstack-ansible-functional-opensuse-423
- openstack-ansible-functional-ubuntu-xenial
- openstack-ansible-upgrade-ubuntu-xenial
- openstack-ansible-cinder-ssl-nv
experimental:
jobs:
- openstack-ansible-integrated-deploy-aio
Expand All @@ -32,3 +33,4 @@
- openstack-ansible-functional-opensuse-423
- openstack-ansible-functional-ubuntu-xenial
- openstack-ansible-upgrade-ubuntu-xenial
- openstack-ansible-cinder-ssl-nv

0 comments on commit 198acc0

Please sign in to comment.