Skip to content
Snippets Groups Projects
Select Git revision
  • a532d2b91453c14eec661af2beb4a20437244fa7
  • master default protected
2 results

install_validation_tools.yml

Blame
  • install_validation_tools.yml 6.47 KiB
    ---
    - name: install validation dependencies from SLUB Debian repo
      ansible.builtin.package:
        name: [
          "git",
          "inotify-tools",
          # "checkit-tiff-current",    # This is no longer used, because we only want to validate against upcoming. It stays here for documentation purposes.
          "checkit-tiff-upcoming",
          "libzen0v5",
          "libmediainfo0v5",
          "iccmax",    # Icc-Tools, installed from SLUBs private package repo
          "mediaconch",
          "xsltproc",
        ]
        # CAUTION:
        # Do NOT use "state: latest", because the repair tools might need specific
        # versions of these tools!
        state: present
    
    # KEEP THIS HERE!
    # This is in preparation for when the tools actually become available for use on the repair server.
    # - name: create directories for validation dependencies from Gitlab-CI server
    #   ansible.builtin.file:
    #     path: "/usr/share/XmlFormatValidationPlugin/"
    #     state: directory
    #     mode: "0755"
    # - name: install validation dependencies from Gitlab-CI server
    #   ansible.builtin.get_url:
    #     url: "https://git.slub-dresden.de/digital-preservation/xml_plugin4rosetta/-/releases/permalink/latest/downloads/binaries/XmlFormatValidationPlugin.jar"
    #     dest: "/usr/share/XmlFormatValidationPlugin/"
    #     mode: "0644"
    
    - name: remove existing MediaConch-Profile repo directory (otherwise, we can't clone it in the next task -.-)
      ansible.builtin.file:
        path: "/tmp/mediaconch-profile/"
        state: absent
      changed_when: false    # there's no other way to get this task idempotent
    
    - name: checkout MediaConch-Profile repo
      ansible.builtin.git:
        repo: "https://git.slub-dresden.de/digital-preservation/mediaconch-profile.git"
        dest: "/tmp/mediaconch-profile/"
      register: mc_profile_repo_cloned
      changed_when: false    # there's no other way to get this task idempotent
    
    - name: compile MediaConch profile
      ansible.builtin.command:
        cmd: "bash ./build_all.sh"
        chdir: "/tmp/mediaconch-profile/"
      when: mc_profile_repo_cloned.before != mc_profile_repo_cloned.after
      register: mc_profile_repo_built
      changed_when: false    # there's no other way to get this task idempotent
    
    - name: deploy MediaConch profile to Rosetta
      ansible.builtin.copy:
        src: "/tmp/mediaconch-profile/build/SLUB_mediaconch_policy_all.xml"
        dest: "/usr/local/etc/SLUB_mediaconch_policy_all.xml"
        remote_src: true
        mode: "0644"
    
    # According to FHS 3.0 (https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s09.html),
    # use "/usr/local/etc/" for "Host-specific system configuration for local binaries".
    # As our config files are shareable according to https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch02.html,
    # we place them below "/usr/" instead of "/etc/".
    - name: create symlinks for validation tool profiles
      ansible.builtin.file:
        src: "{{ item.s | default(omit) }}"     # file to link to
        dest: "/usr/local/etc/{{ item.d }}"    # symlink file path
        state: "{{ item.state | default('link') }}"
        mode: "{{ item.m | default(omit) }}"