Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TVAULT-4413: [Victoria Qualification] Trilio component deployment failed on OSA ubuntu 20 Victoria #457

Open
wants to merge 1 commit into
base: v4.1maintenance
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ansible/roles/ansible-datamover-api/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Database vars
dmapi_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
dmapi_db_setup_host_victoria: "{{ openstack_db_setup_host | default('localhost') }}"
dmapi_db_setup_host_ussuri: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to check length of groups['galera_all'] before accessing the index.

dmapi_galera_address: "{{ galera_address | default('127.0.0.1') }}"
dmapi_galera_database: dmapi
dmapi_galera_user: dmapi
dmapi_galera_use_ssl: "{{ galera_use_ssl | default(False) }}"
dmapi_galera_ssl_ca_cert: "{{ galera_ssl_ca_cert | default('/etc/ssl/certs/galera-ca.pem') }}"
dmapi_galera_password: "{{DMAPI_MYSQL_PASSWORD}}"
dmapi_galera_port: 3306


# RPC
Expand Down Expand Up @@ -35,8 +37,10 @@ dmapi_oslomsg_notify_vhost: "{{ dmapi_oslomsg_rpc_vhost }}"
# Set the host which will execute the shade modules
# for the service setup. The host must already have
# clouds.yaml properly configured.

dmapi_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
dmapi_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((dmapi_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
dmapi_db_setup_python_interpreter_victoria: "{{ openstack_db_setup_python_interpreter | default((dmapi_db_setup_host_victoria == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"

# Keystone AuthToken/Middleware
dmapi_keystone_auth_plugin: password
Expand Down
21 changes: 19 additions & 2 deletions ansible/roles/ansible-datamover-api/tasks/create_dmapi_db.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
- import_tasks: db_setup.yml
- import_tasks: db_setup_victoria.yml
run_once: True
vars:
_oslodb_setup_host: "{{ dmapi_db_setup_host }}"
_oslodb_setup_host: "{{ dmapi_db_setup_host_victoria }}"
_oslodb_ansible_python_interpreter: "{{ dmapi_db_setup_python_interpreter_victoria }}"
_oslodb_setup_endpoint: "{{ dmapi_galera_address }}"
_oslodb_setup_port: "{{ dmapi_galera_port }}"
_oslodb_databases:
- name: "{{ dmapi_galera_database }}"
users:
- username: "{{ dmapi_galera_user }}"
password: "{{ dmapi_galera_password }}"
when:
OPENSTACK_DIST | upper == "VICTORIA"

- import_tasks: db_setup_ussuri.yml
run_once: True
vars:
_oslodb_setup_host: "{{ dmapi_db_setup_host_ussuri }}"
_oslodb_databases:
- name: "{{ dmapi_galera_database }}"
users:
- username: "{{ dmapi_galera_user }}"
password: "{{ dmapi_galera_password }}"
when:
OPENSTACK_DIST | upper == "USSURI"

- import_tasks: mq_setup.yml
run_once: True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
- name: Setup Database Service (MariaDB)
delegate_to: "{{_oslodb_setup_host }}"
block:
- name: Create database for service
- name: Ussuri | Create database for service Ussri
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spell check

mysql_db:
name: "{{ item.name }}"
loop: "{{ _oslodb_databases }}"
no_log: true

- name: Grant access to the database for the service
- name: Ussuri | Grant access to the database for the service
mysql_user:
name: "{{ item.1.username }}"
password: "{{ item.1.password }}"
Expand All @@ -17,4 +17,4 @@
priv: "{{ item.0.name }}.*:{{ item.1.priv | default('ALL') }}"
append_privs: yes
loop: "{{ _oslodb_databases | subelements('users') }}"
no_log: true
no_log: true
26 changes: 26 additions & 0 deletions ansible/roles/ansible-datamover-api/tasks/db_setup_victoria.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Setup Database Service (MariaDB)
delegate_to: "{{_oslodb_setup_host }}"
vars:
ansible_python_interpreter: "{{ _oslodb_ansible_python_interpreter }}"
block:
- name: Victoria | Create database for service
mysql_db:
name: "{{ item.name }}"
login_host: "{{ _oslodb_setup_endpoint | default(omit) }}"
login_port: "{{ _oslodb_setup_port | default(omit) }}"
loop: "{{ _oslodb_databases }}"
no_log: true

- name: Victoria | Grant access to the database for the service
mysql_user:
name: "{{ item.1.username }}"
password: "{{ item.1.password }}"
update_password: always
host: "{{ item.1.host | default('%') }}"
priv: "{{ item.0.name }}.*:{{ item.1.priv | default('ALL') }}"
login_host: "{{ _oslodb_setup_endpoint | default(omit) }}"
login_port: "{{ _oslodb_setup_port | default(omit) }}"
append_privs: yes
loop: "{{ _oslodb_databases | subelements('users') }}"
no_log: true