Skip to content

Commit

Permalink
Merge pull request EESSI#37 from EESSI/host_symlinks
Browse files Browse the repository at this point in the history
Add Ansible task for making symlinks to host files/directories
  • Loading branch information
peterstol authored Sep 23, 2020
2 parents 8c43c9b + 47e1473 commit 53edca3
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
BPREFIX: "{{ gentoo_prefix_path }}"
LC_ALL: C
roles:
- compatibility-layer
- compatibility_layer
become: True
17 changes: 0 additions & 17 deletions ansible/playbooks/roles/compatibility-layer/defaults/main.yml

This file was deleted.

53 changes: 53 additions & 0 deletions ansible/playbooks/roles/compatibility_layer/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 }}"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 53edca3

Please sign in to comment.