--- # Copyright 2016, 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: Deploy Grafana hosts: grafana_all become: true vars_files: - vars/variables.yml pre_tasks: - name: Galera database block block: - name: Setup installation variables include_role: name: openstack.osa.install_defaults defaults_from: "{{ install_method }}" public: true apply: tags: - always tags: - always - include_role: name: openstack.osa.db_setup vars: _oslodb_setup_host: "{{ grafana_db_setup_host }}" _oslodb_ansible_python_interpreter: "{{ grafana_db_setup_python_interpreter }}" _oslodb_setup_endpoint: "{{ galera_address | default('127.0.0.1') }}" _oslodb_databases: - name: "{{ grafana_galera_database }}" users: - username: "{{ grafana_galera_user }}" password: "{{ grafana_db_password }}" - name: Set grafana database fact set_fact: grafana_ini: "{{ grafana_ini_database | ansible.builtin.combine(grafana_ini, recursive=true) }}" vars: grafana_ini_database: grafana_database: type: mysql host: "{{ galera_address }}:3306" name: "{{ grafana_galera_database }}" user: "{{ grafana_galera_user }}" password: "{{ grafana_db_password }}" when: - (groups['galera_all'] | default([])) | length > 0 - name: Ensure https repos function apt: pkg: "apt-transport-https" state: "latest" roles: - role: grafana.grafana.grafana