diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 40da83a8936c6cebbcc5d8891e84c1a896955bbd..ac3f6e2ef020426fb3acf57f15559e5ba108ffe7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,4 +45,4 @@ test-job: - molecule create --scenario-name ${SCENARIO} - molecule converge --scenario-name ${SCENARIO} - molecule idempotence --scenario-name ${SCENARIO} - # - molecule verify --scenario-name ${SCENARIO} + - molecule verify --scenario-name ${SCENARIO} diff --git a/molecule/resources/playbooks/verify.yml b/molecule/resources/playbooks/verify.yml index a5cfa75e4c765f52891877bfca5f823b69a2c23b..75b4ec42da9476fb96b73bf285acf95e9984aadc 100644 --- a/molecule/resources/playbooks/verify.yml +++ b/molecule/resources/playbooks/verify.yml @@ -1,5 +1,5 @@ --- -# This is an example playbook to execute Ansible tests. +# This is a playbook to execute Ansible tests. - name: Verify hosts: all @@ -8,3 +8,37 @@ - name: Example assertion ansible.builtin.assert: that: true + +- name: Run Rosetta-specific tests. + hosts: 'vm-rosapp-mol' + gather_facts: true + tasks: + - name: Get list of installed MediaArea packages. + ansible.builtin.command: + cmd: "dnf list mediaconch mediainfo libmediainfo libzen" + register: mediaconch_repo + changed_when: false + - name: > + Test if the MediaArea packages are installed from their own repository. + ansible.builtin.assert: + that: "'@MediaArea' in mediaconch_repo.stdout" + success_msg: > + The string '@MediaArea' was found in the list of installed MediaArea + packages, so we can assume that at least one of them was installed + from the official MediaArea repository. + fail_msg: > + The string '@MediaArea' was NOT found in the list of installed + MediaArea packages, so they are probably installed from another + source, quite possibly EPEL. These will probably not work without + RHEL 8. + + - name: Call mediaconch to see if it runs without errors. + ansible.builtin.command: + cmd: "mediaconch -h" + register: mediaconch_output + changed_when: false + - name: Parse mediaconch output. + ansible.builtin.assert: + that: "'MediaConch Command Line Interface' in mediaconch_output.stdout" + success_msg: MediaConch runs as expected. + fail_msg: MediaConch couldn't be run without errors. diff --git a/tasks/rosetta/configure_package_repositories.yml b/tasks/rosetta/configure_package_repositories.yml index 622ed52f662c12bfd0b16d35f6a07da306950c4e..9ae19a79b0ed7a19887ee6618020b4263a27b926 100644 --- a/tasks/rosetta/configure_package_repositories.yml +++ b/tasks/rosetta/configure_package_repositories.yml @@ -1,9 +1,10 @@ --- - name: add MediaArea repository ansible.builtin.dnf: - name: "https://mediaarea.net/repo/rpm/releases/repo-MediaArea-1.0-24.noarch.rpm" + name: "https://mediaarea.net/repo/rpm/releases/repo-MediaArea-1.0-25.noarch.rpm" state: latest disable_gpg_check: true + tags: [mediaconch] - name: enable powertools repository (part of EPEL) community.general.dnf_config_manager: diff --git a/tasks/rosetta/install_mediaconch.yml b/tasks/rosetta/install_mediaconch.yml index 93fadba9971921001ae2a548d5d624a2cc04cf26..9c25c0f29e31b3cb0317235e76fc09150fbcb554 100644 --- a/tasks/rosetta/install_mediaconch.yml +++ b/tasks/rosetta/install_mediaconch.yml @@ -1,12 +1,24 @@ --- -- name: install MediaConch - ansible.builtin.yum: +- name: install Ansible prerequisites + ansible.builtin.dnf: name: [ - "mediaconch", "git", "libxslt", ] state: latest + +- name: install MediaConch + ansible.builtin.dnf: + name: [ + "mediaconch", + "mediainfo", + "libmediainfo", + "libzen", + ] + enablerepo: "MediaArea" + disablerepo: "epel" + update_cache: true + state: latest - name: check MediaConch symlink ansible.builtin.stat: diff --git a/tasks/rosetta/install_packages.yml b/tasks/rosetta/install_packages.yml index 832f2e29d0a5e67f040b9e57ae036b7f71b1623e..385ffc0e050d703752780bc3954bab8bc53a92db 100644 --- a/tasks/rosetta/install_packages.yml +++ b/tasks/rosetta/install_packages.yml @@ -1,11 +1,9 @@ --- - name: install packages for plugins, TA, analysis - ansible.builtin.yum: + ansible.builtin.dnf: name: [ 'libtiff', - 'mediaconch', - 'mediainfo', 'perl-Image-ExifTool', 'slubarchiv-xml-catalog', ] - state: latest + state: latest \ No newline at end of file