Fix ceilometer task order

Gnocchi initialization need to be run after ceilometer user creation

Partial-Bug: 1778195
Change-Id: I7715f7df35e10c41d65450c273c3f9cc53d0a855
This commit is contained in:
Kourosh Vivan 2018-06-22 11:56:58 +02:00
parent 7867f90e51
commit 9d54c79b82
3 changed files with 31 additions and 14 deletions

View File

@ -0,0 +1,26 @@
---
# Copyright 2018, SUSE LINUX GmbH.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: check for gnocchi resource file
stat:
path: "/etc/ceilometer/gnocchi_resources.yaml"
register: gnocchi_resource_file
- name: Initialize Gnocchi database by creating ceilometer resources
command: "{{ ceilometer_bin }}/ceilometer-upgrade --skip-metering-database"
become: yes
become_user: "{{ ceilometer_system_user_name }}"
changed_when: false
when: gnocchi_resource_file.stat.exists

View File

@ -79,17 +79,3 @@
notify:
- Restart ceilometer services
- name: check for gnocchi resource file
stat:
path: "/etc/ceilometer/gnocchi_resources.yaml"
register: gnocchi_resource_file
- name: Initialize Gnocchi database by creating ceilometer resources
command: "{{ ceilometer_bin }}/ceilometer-upgrade --skip-metering-database"
become: yes
become_user: "{{ ceilometer_system_user_name }}"
changed_when: false
when: gnocchi_resource_file.stat.exists
notify:
- Restart ceilometer services

View File

@ -91,3 +91,8 @@
- groups['ceilometer_central_container'] is defined and inventory_hostname == groups['ceilometer_central_container'][0]
tags:
- ceilometer-config
- include: ceilometer_db_setup.yml
tags:
- ceilometer-config
run_once: true