kolla/ansible/roles/ceilometer/tasks/bootstrap.yml
Hui Kang 4108c6c6ec Implement ceilometer ansible role
Change-Id: I13c50a78b2dc7c98b720a4b2e7161104213bd295
Implements: bp ansible-ceilometer
2016-06-16 22:05:56 -04:00

12 lines
544 B
YAML

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