Execution
Date 15 Dec 2025 10:19:13 +0000
Duration 00:23:12.82
Controller aio1.openstack.local
User root
Versions
Ansible 2.18.6
ara 1.7.4 / 1.7.4
Python 3.12.3
Summary
9 Hosts
618 Tasks
960 Results
108 Plays
456 Files
0 Records

File: /home/zuul/src/opendev.org/openstack/openstack-ansible-os_gnocchi/tasks/main.yml

---
# Copyright 2015, Rackspace US, Inc.
#
# 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: Gather variables for each operating system
  ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
  vars:
    params:
      files:
        - "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
        - "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
        - "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
        - "{{ ansible_facts['distribution'] | lower }}.yml"
        - "{{ ansible_facts['os_family'] | lower }}.yml"
      paths:
        - "{{ role_path }}/vars"
  tags:
    - always

- name: Including osa.db_setup role
  ansible.builtin.include_role:
    name: openstack.osa.db_setup
    apply:
      tags:
        - common-db
        - gnocchi-config
  when:
    - _gnocchi_is_first_play_host
  vars:
    _oslodb_setup_host: "{{ gnocchi_db_setup_host }}"
    _oslodb_ansible_python_interpreter: "{{ gnocchi_db_setup_python_interpreter }}"
    _oslodb_setup_endpoint: "{{ gnocchi_galera_address }}"
    _oslodb_setup_port: "{{ gnocchi_galera_port }}"
    _oslodb_databases:
      - name: "{{ gnocchi_galera_database }}"
        users:
          - username: "{{ gnocchi_galera_user }}"
            password: "{{ gnocchi_container_mysql_password }}"
  tags:
    - always

- name: Importing gnocchi_pre_install tasks
  ansible.builtin.import_tasks: gnocchi_pre_install.yml
  tags:
    - gnocchi-install

- name: Create and install SSL certificates
  ansible.builtin.include_role:
    name: pki
    tasks_from: main_certs.yml
    apply:
      tags:
        - gnocchi-config
        - pki
  vars:
    pki_setup_host: "{{ gnocchi_pki_setup_host }}"
    pki_dir: "{{ gnocchi_pki_dir }}"
    pki_create_certificates: "{{ gnocchi_user_ssl_cert is not defined and gnocchi_user_ssl_key is not defined }}"
    pki_regen_cert: "{{ gnocchi_pki_regen_cert }}"
    pki_certificates: "{{ gnocchi_pki_certificates }}"
    pki_install_certificates: "{{ gnocchi_pki_install_certificates }}"
  when:
    - gnocchi_backend_ssl
  tags:
    - always

- name: Install the python venv
  ansible.builtin.import_role:
    name: "python_venv_build"
  vars:
    venv_build_distro_package_list: "{{ gnocchi_devel_distro_packages }}"
    venv_python_executable: "{{ gnocchi_venv_python_executable }}"
    venv_build_constraints: "{{ gnocchi_git_constraints }}"
    venv_install_destination_path: "{{ gnocchi_bin | dirname }}"
    venv_install_distro_package_list: "{{ gnocchi_distro_packages }}"
    venv_pip_install_args: "{{ gnocchi_pip_install_args }}"
    venv_pip_packages: "{{ gnocchi_pip_packages }}"
    venv_facts_when_changed:
      - section: "gnocchi"
        option: "venv_tag"
        value: "{{ gnocchi_venv_tag }}"
  tags:
    - gnocchi-install

- name: Importing gnocchi_post_install tasks
  ansible.builtin.import_tasks: gnocchi_post_install.yml
  when: not gnocchi_identity_only | bool
  tags:
    - gnocchi-config
    - post-install

- name: Run the systemd service role
  ansible.builtin.import_role:
    name: systemd_service
  vars:
    systemd_user_name: "{{ gnocchi_system_user_name }}"
    systemd_group_name: "{{ gnocchi_system_group_name }}"
    systemd_tempd_prefix: openstack
    systemd_slice_name: gnocchi
    systemd_lock_path: /var/lock/gnocchi
    systemd_service_cpu_accounting: true
    systemd_service_block_io_accounting: true
    systemd_service_memory_accounting: true
    systemd_service_tasks_accounting: true
    systemd_services: "{{ filtered_gnocchi_services }}"
  when: not gnocchi_identity_only | bool
  tags:
    - gnocchi-config
    - systemd-service

- name: Import uwsgi role
  ansible.builtin.import_role:
    name: uwsgi
  vars:
    uwsgi_services: "{{ uwsgi_gnocchi_services }}"
    uwsgi_install_method: "source"
  tags:
    - gnocchi-config
    - uwsgi

- name: Including osa.service_setup role
  ansible.builtin.include_role:
    name: openstack.osa.service_setup
    apply:
      tags:
        - common-service
        - gnocchi-config
  vars:
    _service_adminuri_insecure: "{{ keystone_service_adminuri_insecure }}"
    _service_setup_host: "{{ gnocchi_service_setup_host }}"
    _service_setup_host_python_interpreter: "{{ gnocchi_service_setup_host_python_interpreter }}"
    _service_region: "{{ gnocchi_service_region }}"
    _service_in_ldap: "{{ gnocchi_service_in_ldap }}"
    _service_project_name: "{{ gnocchi_service_project_name }}"
    _project_name: "{{ gnocchi_service_project_name }}"
    _project_domain: "{{ gnocchi_service_project_domain_id }}"
    _service_users:
      - name: "{{ gnocchi_service_user_name }}"
        password: "{{ gnocchi_service_password }}"
        role: "{{ gnocchi_service_role_names }}"
    _service_endpoints:
      - service: "{{ gnocchi_service_name }}"
        interface: "public"
        url: "{{ gnocchi_service_publicurl }}"
      - service: "{{ gnocchi_service_name }}"
        interface: "internal"
        url: "{{ gnocchi_service_internalurl }}"
      - service: "{{ gnocchi_service_name }}"
        interface: "admin"
        url: "{{ gnocchi_service_adminurl }}"
    _service_catalog:
      - name: "{{ gnocchi_service_name }}"
        type: "{{ gnocchi_service_type }}"
        description: "{{ gnocchi_service_description }}"
  when:
    - _gnocchi_is_first_play_host
    - not gnocchi_identity_only | bool
  tags:
    - always

- name: Include ceph_client role
  ansible.builtin.include_role:
    name: "ceph_client"
    apply:
      tags:
        - ceph
        - gnocchi-install
  vars:
    openstack_service_system_user: "{{ gnocchi_system_user_name }}"
    openstack_service_venv_bin: "{{ gnocchi_bin }}"
  when:
    - gnocchi_storage_driver == 'ceph'
    - not gnocchi_identity_only | bool
  tags:
    - always

- name: Flush handlers
  ansible.builtin.meta: flush_handlers

# N.B. Must occur after identity setup, as this may perform calls to Swift.
#      Similarly, when using Ceph, must occur after Ceph setup.
- name: Importing gnocchi_db_sync tasks
  ansible.builtin.import_tasks: gnocchi_db_sync.yml
  when:
    - (gnocchi_storage_driver == 'file') | ternary(True, _gnocchi_is_first_play_host)
    - not gnocchi_identity_only | bool
  tags:
    - gnocchi-config