designate.conf.j2 does not respect user configured designate database name

Bug #1783132 reported by Yiorgos Stamoulis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Medium
Guilherme Steinmuller Pimentel

Bug Description

encountered this in 17.0.6, Queens/stable when i started testing openstack-ansible

in designate.conf.j2, the database name is hardcoded as 'designate':

[storage:sqlalchemy]
connection = mysql+pymysql://{{ designate_galera_user }}:{{ designate_galera_password }}@{{ designate_galera_address }}/designate?charset=utf8{% if designate_galera_use_ssl | bool %}&ssl_ca={{ designate_galera_ssl_ca_cert }}{% endif %}

Further to this, for the database name, all other openstack-ansible roles use variables that follow a pattern: <openstack-service>_galera_database, e.g.: glance_galera_database

os-designate, seems to prefer designate_galera_database_name as can be seen in os-designate-install.yml:

    - include: common-tasks/mysql-db-user.yml
      static: no
      vars:
        user_name: "{{ designate_galera_user }}"
        password: "{{ designate_galera_password }}"
        login_host: "{{ designate_galera_address }}"
        db_name: "{{ designate_galera_database_name }}"

I therefore propose the 2 patches attached:

1 - to make os-designate respect custom database names:
diff /etc/ansible/roles/os_designate/templates/designate.conf.j2.amended /etc/ansible/roles/os_designate/templates/designate.conf.j2.original
384c384
< connection = mysql+pymysql://{{ designate_galera_user }}:{{ designate_galera_password }}@{{ designate_galera_address }}/{{ designate_galera_database }}?charset=utf8{% if designate_galera_use_ssl | bool %}&ssl_ca={{ designate_galera_ssl_ca_cert }}{% endif %}
---
> connection = mysql+pymysql://{{ designate_galera_user }}:{{ designate_galera_password }}@{{ designate_galera_address }}/designate?charset=utf8{% if designate_galera_use_ssl | bool %}&ssl_ca={{ designate_galera_ssl_ca_cert }}{% endif %}

2 - To bring os-designate inline with othse openstack-ansible components wrt database naming pattern:
diff /opt/openstack-ansible/playbooks/os-designate-install.yml.amended /opt/openstack-ansible/playbooks/os-designate-install.yml.original
59c59
< db_name: "{{ designate_galera_database }}"
---
> db_name: "{{ designate_galera_database_name }}"

#1 is a bug fix
#2 is a 'nice to have' change in the interest of consistency

Revision history for this message
Yiorgos Stamoulis (yiorgos) wrote :
Revision history for this message
Yiorgos Stamoulis (yiorgos) wrote :
Mohammed Naser (mnaser)
tags: added: low-hanging-fruit
Changed in openstack-ansible:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Guilherme Steinmuller Pimentel (guilhermesp)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_designate (master)

Fix proposed to branch: master
Review: https://review.openstack.org/585523

Changed in openstack-ansible:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_designate (master)

Reviewed: https://review.openstack.org/585523
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-os_designate/commit/?id=9b5d91d520660150f28a8b5060dc008acf0f808f
Submitter: Zuul
Branch: master

commit 9b5d91d520660150f28a8b5060dc008acf0f808f
Author: Guilherme Steinmüller <email address hidden>
Date: Tue Jul 24 16:25:23 2018 -0300

    Use designate_galera_database

    Use the designate_galera_database instead of
    hardcoded database name.

    Closes-Bug: 1783132
    Change-Id: I4dd96cb87130c3ec3caaa487384874229acb7356

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_designate (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/585722

Revision history for this message
Guilherme Steinmuller Pimentel (guilhermesp) wrote :

We need to consider that queens, pike and ocata are still delegated to create the databases for the services. Today at master this delegation was moved to the roles itself. I.e (that suits this bug):

https://github.com/openstack/openstack-ansible-os_designate/commit/2d2b3a714975aa2e7f11e0b8679ee88775317284

The way it is in the stable branches, the designate installation will fail because
{{ designate_galera_database_name }} doesn't exist.

Backporting the os-designate-install.yml from master seems not to be an option, as it doesn't creates the database anymore.

Any thoughts?

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

Due to the fact master has quite changed for this,I'd understand why this could be a re-implementation in stable/queens fixing that issue.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_designate (stable/queens)

Reviewed: https://review.openstack.org/585722
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-os_designate/commit/?id=3d4280b8b82a6492ac4bfea835119442e804a55e
Submitter: Zuul
Branch: stable/queens

commit 3d4280b8b82a6492ac4bfea835119442e804a55e
Author: Guilherme Steinmüller <email address hidden>
Date: Tue Jul 24 16:25:23 2018 -0300

    Use designate_galera_database

    Use the designate_galera_database instead of
    hardcoded database name.

    Closes-Bug: 1783132
    Change-Id: I4dd96cb87130c3ec3caaa487384874229acb7356
    (cherry picked from commit 9b5d91d520660150f28a8b5060dc008acf0f808f)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/587931

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_designate (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/587980

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_designate (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/587986

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/queens)

Reviewed: https://review.openstack.org/587931
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=4f80bfe34b267da069371ab1c3b901a7d68d4ca6
Submitter: Zuul
Branch: stable/queens

commit 4f80bfe34b267da069371ab1c3b901a7d68d4ca6
Author: Guilherme Steinmüller <email address hidden>
Date: Wed Aug 1 15:04:07 2018 -0300

    Rename designate_galera_database_name

    We need to rename this variable to designate_galera_database
    as is declared in os_designate role.

    Closes-Bug: 1783132
    Change-Id: I39f076e01a3acb13966ff9d5a5b23e7c526289b6

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 17.0.8

This issue was fixed in the openstack/openstack-ansible 17.0.8 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_designate (stable/ocata)

Reviewed: https://review.openstack.org/587986
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-os_designate/commit/?id=b3bad128f0efbbe52fa72e2a6369337f2c6f37fa
Submitter: Zuul
Branch: stable/ocata

commit b3bad128f0efbbe52fa72e2a6369337f2c6f37fa
Author: Guilherme Steinmüller <email address hidden>
Date: Tue Jul 24 16:25:23 2018 -0300

    Use designate_galera_database

    Use the designate_galera_database instead of
    hardcoded database name.

    Closes-Bug: 1783132
    Change-Id: I4dd96cb87130c3ec3caaa487384874229acb7356
    (cherry picked from commit 9b5d91d520660150f28a8b5060dc008acf0f808f)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_designate (stable/pike)

Reviewed: https://review.openstack.org/587980
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-os_designate/commit/?id=faf5b2b553cec07f788d917add1771e7e95bb57a
Submitter: Zuul
Branch: stable/pike

commit faf5b2b553cec07f788d917add1771e7e95bb57a
Author: Guilherme Steinmüller <email address hidden>
Date: Tue Jul 24 16:25:23 2018 -0300

    Use designate_galera_database

    Use the designate_galera_database instead of
    hardcoded database name.

    Closes-Bug: 1783132
    Change-Id: I4dd96cb87130c3ec3caaa487384874229acb7356
    (cherry picked from commit 9b5d91d520660150f28a8b5060dc008acf0f808f)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate ocata-em

This issue was fixed in the openstack/openstack-ansible-os_designate ocata-em release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate 16.0.29

This issue was fixed in the openstack/openstack-ansible-os_designate 16.0.29 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate queens-eol

This issue was fixed in the openstack/openstack-ansible-os_designate queens-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate rocky-eol

This issue was fixed in the openstack/openstack-ansible-os_designate rocky-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate stein-eol

This issue was fixed in the openstack/openstack-ansible-os_designate stein-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate train-eol

This issue was fixed in the openstack/openstack-ansible-os_designate train-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate ussuri-eol

This issue was fixed in the openstack/openstack-ansible-os_designate ussuri-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate yoga-eom

This issue was fixed in the openstack/openstack-ansible-os_designate yoga-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate victoria-eom

This issue was fixed in the openstack/openstack-ansible-os_designate victoria-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate wallaby-eom

This issue was fixed in the openstack/openstack-ansible-os_designate wallaby-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_designate xena-eom

This issue was fixed in the openstack/openstack-ansible-os_designate xena-eom release.

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.