registered variable and used variable not matching in ceilometer bootstrap.yml

Bug #1635322 reported by prameswar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Fix Released
Undecided
prameswar
Newton
Fix Released
Critical
Duong Ha-Quang

Bug Description

registered variable and used variable not matching in bootstrap.yml of ceilometer that cause below error:

TASK [ceilometer : Creating Ceilometer MongoDB database] ***********************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "The conditional check ''already' not in database.stdout' failed. The error was: error while evaluating conditional ('already' not in database.stdout): Unable to look up a name or access an attribute in template string ({% if 'already' not in database.stdout %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid characters like '-': argument of type 'StrictUndefined' is not iterable"}

NO MORE HOSTS LEFT *************************************************************
 to retry, use: --limit @/home/vagrant/kolla/ansible/site.retry

problem in below code of bootstrap.yml (https://github.com/openstack/kolla/blob/master/ansible/roles/ceilometer/tasks/bootstrap.yml)

- name: Creating Ceilometer MongoDB database
  command: docker exec -t mongodb mongo --host {{ ceilometer_database_mongodb_address }} --eval 'db = db.getSiblingDB("{{ ceilometer_database_name }}"); db.createUser({user':' "{{ ceilometer_database_user }}", pwd':' "{{ ceilometer_database_password}}", roles':' [ "readWrite", "dbAdmin" ]})'
  register: mongodb_ceilometer_database
  run_once: true
  failed_when:
    - "'already' not in database.stdout"
    - database.stdout.split()[4] != 'connecting'
  delegate_to: "{{ groups['mongodb'][0] }}"
  when:
    - ceilometer_database_type == "mongodb"

- name: Creating Ceilometer mysql database
  command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
    -m mysql_db
    -a "login_host='{{ ceilometer_database_mysql_address }}'
        login_port='{{ database_port }}'
        login_user='{{ database_user }}'
        login_password='{{ database_password }}'
        name='{{ ceilometer_database_name }}'"
  register: mysql_ceilometer_database
  changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
                    (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
  failed_when: database.stdout.split()[2] != 'SUCCESS'
  run_once: True
  delegate_to: "{{ groups['ceilometer-api'][0] }}"
  when:
    - ceilometer_database_type == "mysql"

prameswar (prameswar)
Changed in kolla:
assignee: nobody → prameswar (prameswar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

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

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

Reviewed: https://review.openstack.org/389252
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=7ef0b41e0ff2aff8e51da4bb60571232c8c24dc3
Submitter: Jenkins
Branch: master

commit 7ef0b41e0ff2aff8e51da4bb60571232c8c24dc3
Author: prameswar <email address hidden>
Date: Thu Oct 20 21:01:18 2016 +0530

    corrected register variable name in ceilometer bootstrap.yml

    Closes-Bug: #1635322

    Change-Id: I6f3351d098dfd9a7c1c3e3e8b213134284f823f9

Changed in kolla:
status: In Progress → Fix Released
Changed in kolla:
milestone: none → ocata-1
Revision history for this message
prameswar (prameswar) wrote :

it seems this issue is only in master. newton already have correct variable: https://github.com/openstack/kolla/blob/stable/newton/ansible/roles/ceilometer/tasks/bootstrap.yml

Steven Dake (sdake)
no longer affects: kolla/newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 4.0.0.0b1

This issue was fixed in the openstack/kolla 4.0.0.0b1 development milestone.

Duong Ha-Quang (duonghq)
no longer affects: kolla/ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/437815

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

Reviewed: https://review.openstack.org/437815
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=867d089fa2de6f70ed9483384b919441bb2c341e
Submitter: Jenkins
Branch: stable/newton

commit 867d089fa2de6f70ed9483384b919441bb2c341e
Author: prameswar <email address hidden>
Date: Thu Oct 20 21:01:18 2016 +0530

    corrected register variable name in ceilometer bootstrap.yml

    Closes-Bug: #1635322

    Change-Id: I6f3351d098dfd9a7c1c3e3e8b213134284f823f9
    (cherry picked from commit https://review.openstack.org/#/c/389252/)

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

This issue was fixed in the openstack/kolla 3.0.3 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.