Skip to content

Commit

Permalink
YDA-5882 fix ordering Yoda DB indexes
Browse files Browse the repository at this point in the history
Deploying a new environment with Yoda-specific database indexes enabled
failed, because the playbook tried to create the indexes before iRODS
created the tables that were to be indexed.

This fix moves the code for enabling or disabling the Yoda-specific
indexes to a separate role that is always run after both the database
and the provider have been deployed, so that this doesn't happen anymore.
  • Loading branch information
stsnel committed Aug 8, 2024
1 parent 68a187e commit ab9e087
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
9 changes: 9 additions & 0 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@
- icat


- name: Provision Yoda-specific database indexes
hosts: databases
become: true
roles:
- role: yoda_database_indexes
tags:
- database


- name: Provision resource server
hosts: resources
become: true
Expand Down
1 change: 0 additions & 1 deletion roles/irods_database/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
irods_database_name: ICAT
irods_database_user: irodsdb
irods_database_password: irodsdev
irods_database_enable_yoda_indexes: false

icat_database_encoding: UTF-8
icat_database_lc_collate: en_US.UTF-8
Expand Down
4 changes: 0 additions & 4 deletions roles/irods_database/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,3 @@
privs: CREATE
type: schema
when: pgsql_version >= 15


- name: Setup Yoda databases indexes
ansible.builtin.include_tasks: "yoda_indexes.yml"
5 changes: 5 additions & 0 deletions roles/yoda_database_indexes/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# copyright Utrecht University

irods_database_name: ICAT
irods_database_enable_yoda_indexes: false
19 changes: 19 additions & 0 deletions roles/yoda_database_indexes/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# copyright Utrecht University

galaxy_info:
author: Sietse Snel
description: Install Yoda-specific database indexes
license: GPLv3
min_ansible_version: '2.11'
platforms:
- name: EL
version:
- 7
- 8
- name: Ubuntu
version: focal


dependencies:
- role: postgresql
File renamed without changes.

0 comments on commit ab9e087

Please sign in to comment.