Refactor galera_use_ssl behaviour

With PKI role in place in most cases you don't need to explicitly
provide path to the CA file because PKI role ensures that CA is trusted
by the system overall. In the meanwhile in PyMySQL [1] you must either
provide CA file or cert/key or enable verify.

Since current behaviour is to provide path to the custom CA we expect
certificate being trusted overall. Thus we enable cert verification when
galera_use_ssl is True.

[1] 78f0cf99e5/pymysql/connections.py (L267)

Change-Id: Ic050f71a2e9a48e12e2549ffdf60223d2b0c601d
This commit is contained in:
Dmitriy Rabotyagov 2021-09-21 16:20:03 +03:00
parent b351843e01
commit ce27e5ec39
2 changed files with 3 additions and 1 deletions

View File

@ -119,6 +119,8 @@ mistral_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter |
mistral_galera_address: "{{ galera_address | default('127.0.0.1') }}"
mistral_galera_database: mistral
mistral_galera_user: mistral
mistral_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
mistral_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('') }}"
mistral_galera_port: "{{ galera_port | default('3306') }}"
# Configuration options

View File

@ -9,7 +9,7 @@ transport_url = {{ mistral_oslomsg_rpc_transport }}://{% for host in mistral_osl
allow_action_execution_deletion = True
[database]
connection = mysql+pymysql://{{ mistral_galera_user }}:{{ mistral_galera_password }}@{{ mistral_galera_address }}/{{ mistral_galera_database }}?charset=utf8
connection = mysql+pymysql://{{ mistral_galera_user }}:{{ mistral_galera_password }}@{{ mistral_galera_address }}/{{ mistral_galera_database }}?charset=utf8{% if mistral_galera_use_ssl | bool %}&ssl_verify_cert=true{% if mistral_galera_ssl_ca_cert | length > 0 %}&ssl_ca={{ mistral_galera_ssl_ca_cert }}{% endif %}{% endif %}
[keystone_authtoken]
auth_type = password