Browse Source

Fix ceilometer task order

Gnocchi initialization need to be run after ceilometer user creation

Partial-Bug: 1778195
Change-Id: I7715f7df35e10c41d65450c273c3f9cc53d0a855
changes/84/577384/3
Kourosh Vivan 1 year ago
parent
commit
9d54c79b82
3 changed files with 31 additions and 14 deletions
  1. +26
    -0
      tasks/ceilometer_db_setup.yml
  2. +0
    -14
      tasks/ceilometer_post_install.yml
  3. +5
    -0
      tasks/main.yml

+ 26
- 0
tasks/ceilometer_db_setup.yml 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

+ 0
- 14
tasks/ceilometer_post_install.yml 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


+ 5
- 0
tasks/main.yml 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

Loading…
Cancel
Save