From a2bfe399a80010ca1da316c34ee60f799ae5413d Mon Sep 17 00:00:00 2001 From: Vladislav Belogrudov Date: Mon, 7 Nov 2016 16:17:11 +0300 Subject: [PATCH] Exclude port from ceilometer_database_mysql_address Users can specify database address and port for mysql backend of Ceilometer. Currently ceilometer_database_mysql_address incorrectly includes port. This is unnecessary, also Ceilometer bootstrapping (mysql_user, mysql_db Ansible modules) wants to use these variables separately. Change-Id: I88f5359517fcf4f119ec6abfdf16a15a4e33b6fd Closes-Bug: #1639786 --- ansible/roles/ceilometer/defaults/main.yml | 2 +- ansible/roles/ceilometer/templates/ceilometer.conf.j2 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/ceilometer/defaults/main.yml b/ansible/roles/ceilometer/defaults/main.yml index e3d015df61..55289180aa 100644 --- a/ansible/roles/ceilometer/defaults/main.yml +++ b/ansible/roles/ceilometer/defaults/main.yml @@ -10,7 +10,7 @@ ceilometer_database_user: "ceilometer" ceilometer_database_port: "{{ mondodb_port if ceilometer_database_type == 'mongodb' else database_port }}" ceilometer_database_mongodb_address: "{% for host in groups['mongodb'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ ceilometer_database_port }}{% if not loop.last %},{% endif %}{% endfor %}" -ceilometer_database_mysql_address: "{{ kolla_internal_fqdn }}:{{ ceilometer_database_port }}" +ceilometer_database_mysql_address: "{{ kolla_internal_fqdn }}" #################### diff --git a/ansible/roles/ceilometer/templates/ceilometer.conf.j2 b/ansible/roles/ceilometer/templates/ceilometer.conf.j2 index 1a45158305..726571f28b 100644 --- a/ansible/roles/ceilometer/templates/ceilometer.conf.j2 +++ b/ansible/roles/ceilometer/templates/ceilometer.conf.j2 @@ -21,8 +21,8 @@ host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['addr event_connection = mongodb://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mongodb_address }}/{{ ceilometer_database_name }} metering_connection = mongodb://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mongodb_address }}/{{ ceilometer_database_name }} {% elif ceilometer_database_type == "mysql" %} -event_connection = mysql+pymysql://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mysql_address }}/{{ ceilometer_database_name }} -metering_connection = mysql+pymysql://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mysql_address }}/{{ ceilometer_database_name }} +event_connection = mysql+pymysql://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mysql_address }}:{{ ceilometer_database_port }}/{{ ceilometer_database_name }} +metering_connection = mysql+pymysql://{{ ceilometer_database_user }}:{{ ceilometer_database_password }}@{{ ceilometer_database_mysql_address }}:{{ ceilometer_database_port }}/{{ ceilometer_database_name }} {% endif %} [keystone_authtoken]