Skip to content

Commit a3f6881

Browse files
committed
YDA-7218: ensure composed schema collection is present
1 parent f0f65bb commit a3f6881

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎roles/yoda_rulesets/tasks/yoda-ruleset.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
loop:
163163
- schemas
164164
- metadata_schemas
165+
- composed_schemas
165166

166167

167168
- name: Ensure that Yoda metadata schema collection exists
@@ -195,6 +196,24 @@
195196
changed_when: true
196197

197198

199+
- name: Check if priv-admin group has ownership to make changes to composed schemas collection
200+
become_user: '{{ irods_service_account }}'
201+
become: true
202+
ansible.builtin.shell: 'ils -A /{{ irods_zone }}/yoda/composed_schemas | grep "g:priv-admin#{{ irods_zone }}:own"'
203+
register: composed_schemas_access
204+
ignore_errors: true
205+
changed_when: file_formats_access.rc != 0
206+
207+
208+
- name: Ensure priv-admin group has ownership to make changes to composed schemas collection
209+
become_user: "{{ irods_service_account }}"
210+
become: true
211+
# noqa no-changed-when
212+
ansible.builtin.command:
213+
ichmod -rM own priv-admin /{{ irods_zone }}/yoda/composed_schemas
214+
when: not ansible_check_mode and composed_schemas_access.rc != 0
215+
216+
198217
- name: Install metadata schemas
199218
block:
200219
- name: Ensure metadata schemas are present

0 commit comments

Comments
 (0)