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

operations-guide: add custom database & user #678

Merged
merged 1 commit into from
Dec 3, 2024
Merged
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
54 changes: 54 additions & 0 deletions docs/guides/operations-guide/infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,60 @@ https://docs.openstack.org/kolla-ansible/latest/admin/mariadb-backup-and-restore
osism apply mariadb_recovery
```

### Create database & user

1. Create a custom play `playbook-database-sample.yml` in `environments/kolla` in
the configuration repository.

```yaml
---
- name: Manage sample database
hosts: control

vars:
database_sample_username: sample
database_sample_name: sample

tasks:
- name: Create sample database
become: true
kolla_toolbox:
container_engine: "{{ kolla_container_engine }}"
module_name: mysql_db
module_args:
login_host: "{{ database_address }}"
login_port: "{{ database_port }}"
login_user: "root"
login_password: "{{ database_password }}"
name: "{{ database_sample_name }}"
run_once: true

- name: Create sample user
become: true
kolla_toolbox:
container_engine: "{{ kolla_container_engine }}"
module_name: mysql_user
module_args:
login_host: "{{ api_interface_address }}"
login_port: "{{ mariadb_port }}"
login_user: "root"
login_password: "{{ database_password }}"
name: "{{ database_sample_username }}"
password: "{{ database_sample_password }}"
host: "%"
priv: "{{ database_sample_name }}.*:ALL"
append_privs: True
run_once: true
```

2. Add secret `database_sample_password` in `environments/kolla/secrets.yml` in the
configuration repository.

3. Commit the custom play and the secret. Sync the configuration on the manager
node with `osism apply configuration`.

4. Run `osism apply xxx` on the manager node.

## Open Search

### Get all indices
Expand Down
Loading