Skip to content

Commit 53edca3

Browse files
authored
Merge pull request EESSI#37 from EESSI/host_symlinks
Add Ansible task for making symlinks to host files/directories
2 parents 8c43c9b + 47e1473 commit 53edca3

File tree

9 files changed

+86
-22
lines changed

9 files changed

+86
-22
lines changed

.github/workflows/ansible-lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
# [optional]
2828
# Arguments to override a package and its version to be set explicitly.
2929
# Must follow the example syntax.
30-
override-deps: |
31-
ansible==2.9
32-
ansible-lint==4.2.0
30+
#override-deps: |
31+
# ansible==2.9
32+
# ansible-lint==4.2.0
3333
# [optional]
3434
# Arguments to be passed to the ansible-lint
3535

ansible/playbooks/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Ansible role/playbooks for installing the compatibility layer
55

6-
This directory contains an Ansible role (`compatibility-layer`) in the subdirectory `roles` which has
6+
This directory contains an Ansible role (`compatibility_layer`) in the subdirectory `roles` which has
77
all functionality for installing the compatibility layer into an existing Gentoo Prefix installation.
88
It adds a given overlay to the installation and installs a list of package sets and list of additional packages.
99
The playbook `install.yml` will execute this role on a given server.

ansible/playbooks/install.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
BPREFIX: "{{ gentoo_prefix_path }}"
99
LC_ALL: C
1010
roles:
11-
- compatibility-layer
11+
- compatibility_layer
1212
become: True

ansible/playbooks/roles/compatibility-layer/defaults/main.yml

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Defaults file for the compatibility layer role.
2+
---
3+
custom_overlay_name: eessi
4+
custom_overlay_source: git
5+
custom_overlay_url: https://github.com/EESSI/gentoo-overlay.git
6+
7+
cvmfs_start_transaction: False
8+
cvmfs_publish_transaction: False
9+
cvmfs_abort_transaction_on_failures: False
10+
cvmfs_repository: pilot.eessi-hpc.org
11+
12+
gentoo_prefix_path: /cvmfs/pilot.eessi-hpc.org/2020.09/compat/x86_64
13+
14+
package_sets:
15+
- 2020.08
16+
17+
prefix_packages:
18+
19+
# List of locations that should get a symlink $EPREFIX/$LOCATION -> $LOCATION.
20+
# This ensures that things like user/group ids are correct/looked up in the right way in the Prefix environment.
21+
symlinks_to_host:
22+
# required to ensure local user groups are known
23+
- /etc/group
24+
25+
# required to ensure local users are known (see https://github.com/EESSI/compatibility-layer/issues/15)
26+
- /etc/passwd
27+
28+
# required to ensure name-service information is taken from the right source (e.g. ldap)
29+
- /etc/nsswitch.conf
30+
31+
# required to use the DNS resolver from the host (should be done automatically)
32+
- /etc/resolv.conf
33+
34+
# required if Centrify is used in nsswitch.conf
35+
- /lib64/libnss_centrifydc.so.2
36+
37+
# required if LDAP is used in nsswitch.conf
38+
- /lib64/libnss_ldap.so.2
39+
40+
# required if SSSD is used in nsswitch.conf
41+
- /lib64/libnss_sss.so.2
42+
43+
# - /etc/hosts
44+
# - /var/lib/munge
45+
# - /var/lib/unbound
46+
# - /var/lib/VirtualGL
47+
# - /var/log/munge
48+
# - /var/log/wtmp
49+
# - /var/run
50+
# - /var/spool
51+
# - /var/tmp
52+
# - /run/dbus
53+
# - /tmp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Replace a list of files/directories in Gentoo Prefix installation by symlinks to corresponding files/directories
2+
# on the host in order to solve some common issues.
3+
---
4+
5+
- name: Check type of original files/directories
6+
stat:
7+
path: "{{ gentoo_prefix_path }}{{ item }}"
8+
with_items: "{{ symlinks_to_host }}"
9+
register: orig_types
10+
11+
- name: Remove original files/directories
12+
file:
13+
path: "{{ gentoo_prefix_path }}{{ item.item }}"
14+
state: absent
15+
with_items: "{{ orig_types.results }}"
16+
when:
17+
- item.stat.exists
18+
- not item.stat.islnk
19+
20+
- name: Make symlinks
21+
file:
22+
src: "{{ item }}"
23+
dest: "{{ gentoo_prefix_path }}{{ item }}"
24+
state: link
25+
force: yes
26+
with_items: "{{ symlinks_to_host }}"

ansible/playbooks/roles/compatibility-layer/tasks/main.yml renamed to ansible/playbooks/roles/compatibility_layer/tasks/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
when: cvmfs_start_transaction
2222

2323
- block:
24+
- include_tasks: create_host_symlinks.yml
25+
2426
- include_tasks: add_overlay.yml
2527

2628
- include_tasks: install_packages.yml

0 commit comments

Comments
 (0)