diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index d38b2ea3..82ab25ec 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -27,9 +27,9 @@ jobs: # [optional] # Arguments to override a package and its version to be set explicitly. # Must follow the example syntax. - override-deps: | - ansible==2.9 - ansible-lint==4.2.0 + #override-deps: | + # ansible==2.9 + # ansible-lint==4.2.0 # [optional] # Arguments to be passed to the ansible-lint diff --git a/ansible/playbooks/README.md b/ansible/playbooks/README.md index 0c642768..eec24645 100644 --- a/ansible/playbooks/README.md +++ b/ansible/playbooks/README.md @@ -3,7 +3,7 @@ # Ansible role/playbooks for installing the compatibility layer -This directory contains an Ansible role (`compatibility-layer`) in the subdirectory `roles` which has +This directory contains an Ansible role (`compatibility_layer`) in the subdirectory `roles` which has all functionality for installing the compatibility layer into an existing Gentoo Prefix installation. It adds a given overlay to the installation and installs a list of package sets and list of additional packages. The playbook `install.yml` will execute this role on a given server. diff --git a/ansible/playbooks/install.yml b/ansible/playbooks/install.yml index 078ebbb0..57c5fc6f 100644 --- a/ansible/playbooks/install.yml +++ b/ansible/playbooks/install.yml @@ -8,5 +8,5 @@ BPREFIX: "{{ gentoo_prefix_path }}" LC_ALL: C roles: - - compatibility-layer + - compatibility_layer become: True diff --git a/ansible/playbooks/roles/compatibility-layer/defaults/main.yml b/ansible/playbooks/roles/compatibility-layer/defaults/main.yml deleted file mode 100644 index 88c4ce09..00000000 --- a/ansible/playbooks/roles/compatibility-layer/defaults/main.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Defaults file for the compatibility layer role. ---- -custom_overlay_name: eessi -custom_overlay_source: git -custom_overlay_url: https://github.com/EESSI/gentoo-overlay.git - -cvmfs_start_transaction: False -cvmfs_publish_transaction: False -cvmfs_abort_transaction_on_failures: False -cvmfs_repository: pilot.eessi-hpc.org - -gentoo_prefix_path: /cvmfs/pilot.eessi-hpc.org/2020.08/compat/x86_64 - -package_sets: - - 2020.08 - -prefix_packages: diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml new file mode 100644 index 00000000..24280899 --- /dev/null +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -0,0 +1,53 @@ +# Defaults file for the compatibility layer role. +--- +custom_overlay_name: eessi +custom_overlay_source: git +custom_overlay_url: https://github.com/EESSI/gentoo-overlay.git + +cvmfs_start_transaction: False +cvmfs_publish_transaction: False +cvmfs_abort_transaction_on_failures: False +cvmfs_repository: pilot.eessi-hpc.org + +gentoo_prefix_path: /cvmfs/pilot.eessi-hpc.org/2020.09/compat/x86_64 + +package_sets: + - 2020.08 + +prefix_packages: + +# List of locations that should get a symlink $EPREFIX/$LOCATION -> $LOCATION. +# This ensures that things like user/group ids are correct/looked up in the right way in the Prefix environment. +symlinks_to_host: + # required to ensure local user groups are known + - /etc/group + + # required to ensure local users are known (see https://github.com/EESSI/compatibility-layer/issues/15) + - /etc/passwd + + # required to ensure name-service information is taken from the right source (e.g. ldap) + - /etc/nsswitch.conf + + # required to use the DNS resolver from the host (should be done automatically) + - /etc/resolv.conf + + # required if Centrify is used in nsswitch.conf + - /lib64/libnss_centrifydc.so.2 + + # required if LDAP is used in nsswitch.conf + - /lib64/libnss_ldap.so.2 + + # required if SSSD is used in nsswitch.conf + - /lib64/libnss_sss.so.2 + +# - /etc/hosts +# - /var/lib/munge +# - /var/lib/unbound +# - /var/lib/VirtualGL +# - /var/log/munge +# - /var/log/wtmp +# - /var/run +# - /var/spool +# - /var/tmp +# - /run/dbus +# - /tmp diff --git a/ansible/playbooks/roles/compatibility-layer/tasks/add_overlay.yml b/ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml similarity index 100% rename from ansible/playbooks/roles/compatibility-layer/tasks/add_overlay.yml rename to ansible/playbooks/roles/compatibility_layer/tasks/add_overlay.yml diff --git a/ansible/playbooks/roles/compatibility_layer/tasks/create_host_symlinks.yml b/ansible/playbooks/roles/compatibility_layer/tasks/create_host_symlinks.yml new file mode 100644 index 00000000..55db4f29 --- /dev/null +++ b/ansible/playbooks/roles/compatibility_layer/tasks/create_host_symlinks.yml @@ -0,0 +1,26 @@ +# Replace a list of files/directories in Gentoo Prefix installation by symlinks to corresponding files/directories +# on the host in order to solve some common issues. +--- + +- name: Check type of original files/directories + stat: + path: "{{ gentoo_prefix_path }}{{ item }}" + with_items: "{{ symlinks_to_host }}" + register: orig_types + +- name: Remove original files/directories + file: + path: "{{ gentoo_prefix_path }}{{ item.item }}" + state: absent + with_items: "{{ orig_types.results }}" + when: + - item.stat.exists + - not item.stat.islnk + +- name: Make symlinks + file: + src: "{{ item }}" + dest: "{{ gentoo_prefix_path }}{{ item }}" + state: link + force: yes + with_items: "{{ symlinks_to_host }}" diff --git a/ansible/playbooks/roles/compatibility-layer/tasks/install_packages.yml b/ansible/playbooks/roles/compatibility_layer/tasks/install_packages.yml similarity index 100% rename from ansible/playbooks/roles/compatibility-layer/tasks/install_packages.yml rename to ansible/playbooks/roles/compatibility_layer/tasks/install_packages.yml diff --git a/ansible/playbooks/roles/compatibility-layer/tasks/main.yml b/ansible/playbooks/roles/compatibility_layer/tasks/main.yml similarity index 96% rename from ansible/playbooks/roles/compatibility-layer/tasks/main.yml rename to ansible/playbooks/roles/compatibility_layer/tasks/main.yml index 66e904d6..43a663e2 100644 --- a/ansible/playbooks/roles/compatibility-layer/tasks/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/tasks/main.yml @@ -21,6 +21,8 @@ when: cvmfs_start_transaction - block: + - include_tasks: create_host_symlinks.yml + - include_tasks: add_overlay.yml - include_tasks: install_packages.yml