diff --git a/ansible/playbooks/README.md b/ansible/playbooks/README.md index 8449ffb0..f182c1e8 100644 --- a/ansible/playbooks/README.md +++ b/ansible/playbooks/README.md @@ -42,6 +42,7 @@ Before running the playbook, make sure the following settings are correct, and o | prefix_snapshot_url | Directory (served over http(s)) containing snapshot files | | prefix_snapshot_version | Date (`YYYYMMDD`) of the Portage snapshot file for the Prefix installation | | prefix_python_targets | String consisting of [Gentoo Python targets](https://wiki.gentoo.org/wiki/Project:Python/PYTHON_TARGETS) Python targets used for the Prefix installation | +| prefix_user_defined_trusted_dir | Path to the user defined trusted dir for glibc | | prefix_singularity_command | Singularity command for launching the container with the bootstrap script | | prefix_source | Singularity container path used for the Prefix installtion | | prefix_source_options | Arguments to be passed to the Prefix bootstrap script | diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index ed4e5c4f..593b44dd 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -19,6 +19,7 @@ gentoo_prefix_path: /cvmfs/{{ cvmfs_repository }}/{{ eessi_version }}/compat/{{ prefix_snapshot_url: http://cvmfs-s0.eessi-hpc.org/snapshots prefix_snapshot_version: 20210222 prefix_python_targets: python3_8 +prefix_user_defined_trusted_dir: /opt/eessi/lib prefix_singularity_command: "singularity run -B {{ gentoo_prefix_path }}:{{ gentoo_prefix_path }}" prefix_source: "docker://eessi/bootstrap-prefix:centos8-{{ eessi_host_arch }}" prefix_source_options: "{{ gentoo_prefix_path }} noninteractive" diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml b/ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml index 5503489e..28a81364 100644 --- a/ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml @@ -77,4 +77,3 @@ force: yes with_items: "{{ find_configs.results | rejectattr('files', 'equalto', []) | map(attribute='files') | list }}" - diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/install_packages.yml b/ansible/playbooks/roles/compatibility_layer/tasks/install_packages.yml index 7d245297..c2d17992 100644 --- a/ansible/playbooks/roles/compatibility_layer/tasks/install_packages.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/install_packages.yml @@ -1,5 +1,20 @@ # Install a specified list of sets and packages. --- +- name: Check if glibc has already been (re)installed with the user-defined-trusted-dirs option + command: "strings {{ gentoo_prefix_path }}/usr/lib64/libc.a" + register: glibc_reinstalled + when: eessi_host_os == "linux" + +- name: Reinstall glibc with the user-defined-trusted-dirs option + portage: + package: sys-libs/glibc + noreplace: no + oneshot: yes + become: no + environment: + EXTRA_EMAKE: "user-defined-trusted-dirs={{ prefix_user_defined_trusted_dir }}" + when: eessi_host_os == "linux" and glibc_reinstalled.stdout | regex_search("^" + prefix_user_defined_trusted_dir + "/?$") + - name: Install package set {{ package_sets }} portage: package: "@{{ item }}" diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/main.yml b/ansible/playbooks/roles/compatibility_layer/tasks/main.yml index 041a32b7..402c9d11 100644 --- a/ansible/playbooks/roles/compatibility_layer/tasks/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/main.yml @@ -20,8 +20,6 @@ - block: - include_tasks: prefix_configuration.yml - - include_tasks: create_host_symlinks.yml - - include_tasks: add_overlay.yml args: apply: @@ -31,6 +29,8 @@ - include_tasks: install_packages.yml + - include_tasks: create_host_symlinks.yml + - name: Publish transaction command: "cvmfs_server publish {{ cvmfs_repository }}" when: cvmfs_start_transaction and cvmfs_publish_transaction