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
Branches
No related tags found
No related merge requests found
Pipeline #2744 failed
--- ---
- name: prepare XSD directories - name: prepare XSD directories
ansible.builtin.file: ansible.builtin.file:
path: "/{{ item.dir }}" path: "/{{ item }}"
owner: "{{ vault_rosetta_user }}" owner: "{{ vault_rosetta_user }}"
group: "{{ vault_rosetta_group }}" group: "{{ vault_rosetta_group }}"
state: directory state: directory
mode: "0775" 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 - name: install XSDs used in Rosetta format library XML metadata extractor plugin configuration
ansible.builtin.copy: # '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}}" src: "{{ item.dir }}{{ item.filename}}"
dest: "/{{ item.dir }}{{ item.filename}}" dest: "/{{ item.dir }}{{ item.filename}}"
owner: "{{ vault_rosetta_user }}" rsync_opts:
group: "{{ vault_rosetta_group }}" - "--chmod=F664"
mode: "0664" - "--chown={{ vault_rosetta_user }}:{{ vault_rosetta_group }}"
checksum: "{{ item.sha1 }}"
loop: "{{ local_jhove_xsds }}" 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