Password with special characters are not encoded correctly in URLs

Bug #1967897 reported by Benjamin FÜHRMANN
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
kolla-ansible
In Progress
Wishlist
Benjamin FÜHRMANN

Bug Description

In various configuration file in OpenStack and side services, URL can be declared to access to database or RabbitMQ.

If you use special characters like `#` or `/` in the password, then the URL is not declared as expected and related service can't load correctly the URL, causing connection/authentication issues.

To fix that issue, we can use the `urlencode` filter in Ansible to encode the password.

Example:

```
[database]
connection = mysql+pymysql://{{ ironic_database_user }}:{{ ironic_database_password | urlencode }}@{{ ironic_database_address }}/{{ ironic_database_name }}
```

Revision history for this message
Benjamin FÜHRMANN (fuhrmannb) wrote :

Note that we have to also encode slashes manually, Jinja does not do it in `urlencode` method. See [related Jinja2 issue](https://github.com/pallets/jinja/issues/515).

Final Example:

```
[database]
connection = mysql+pymysql://{{ ironic_database_user }}:{{ ironic_database_password | urlencode | replace('/', '%2f') }}@{{ ironic_database_address }}/{{ ironic_database_name }}
```

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)
Changed in kolla-ansible:
status: New → In Progress
Changed in kolla-ansible:
assignee: nobody → Benjamin FÜHRMANN (fuhrmannb)
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

IMHO it should be enough to simply document the restriction

Changed in kolla-ansible:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.