Skip to content
Snippets Groups Projects
Commit f78dddb4 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

refactor: increase performance of XSD deployment by creating deduplicated...

refactor: increase performance of XSD deployment by creating deduplicated directories and using ansible.posix.synchronize to copy files
parent f8cd3dcf
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
---
- name: prepare XSD directories
ansible.builtin.file:
path: "/{{ item.dir }}"
path: "/{{ item }}"
owner: "{{ vault_rosetta_user }}"
group: "{{ vault_rosetta_group }}"
state: directory
mode: "0775"
loop: "{{ local_jhove_xsds }}"
loop: "{{ ( local_jhove_xsds | selectattr('dir', 'defined') | map(attribute='dir') | unique | list ) }}"
- name: install XSDs used in Rosetta format library XML metadata extractor plugin configuration
ansible.builtin.copy:
src: "{{ item.dir }}{{ item.filename }}"
dest: "/{{ item.dir }}{{ item.filename }}"
owner: "{{ vault_rosetta_user }}"
group: "{{ vault_rosetta_group }}"
mode: "0664"
checksum: "{{ item.sha1 }}"
# 'ansible.builtin.copy' doesn't scale well for hundreds of files, so we use
# 'ansible.posix.synchronize' instead
# from "man 1 rsync":
# Note that rsync always verifies that each transferred file was correctly
# reconstructed on the receiving side by checking a whole-file checksum that
# is generated as the file is transferred, but that automatic
# after-the-transfer verification has nothing to do with this option's
# before-the-transfer "Does this file need to be updated?" check.
ansible.posix.synchronize:
src: "{{ item.dir }}{{ item.filename}}"
dest: "/{{ item.dir }}{{ item.filename}}"
rsync_opts:
- "--chmod=F664"
- "--chown={{ vault_rosetta_user }}:{{ vault_rosetta_group }}"
loop: "{{ local_jhove_xsds }}"
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment