Skip to content

Commit d153d2d

Browse files
committed
add option for using a CDN
1 parent b7eb79c commit d153d2d

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

prepare-client-packages.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
- name: Make EESSI CVMFS domain configuration file
4141
ansible.builtin.copy:
4242
content: |
43-
# Stratum 1 servers for the eessi.io domain
44-
CVMFS_SERVER_URL="{{ item.urls | join(';') }}"
45-
4643
# Public keys for the eessi.io domain
4744
CVMFS_KEYS_DIR="/etc/cvmfs/keys/{{ item.domain }}"
4845
@@ -51,11 +48,24 @@
5148
5249
# The client profile is supposed to be set in /etc/cvmfs/default.local
5350
if [ "$CVMFS_CLIENT_PROFILE" = "single" ]; then
54-
if [ "$CVMFS_HTTP_PROXY" = "" ]; then
55-
# For individual clients (laptops, clusters < 5 nodes), use a site proxy
56-
# where possible and otherwise a direct stratum 1 connection
57-
CVMFS_HTTP_PROXY="DIRECT"
58-
fi
51+
if [ "$CVMFS_HTTP_PROXY" = "" ]; then
52+
# For individual clients (laptops, clusters < 5 nodes), use a site proxy
53+
# where possible and otherwise a direct stratum 1 connection
54+
CVMFS_HTTP_PROXY="DIRECT"
55+
fi
56+
fi
57+
58+
# Check if we should use a CDN
59+
CVMFS_USE_CDN="$CVMFS_USE_CDN"
60+
if [ -z "$CVMFS_USE_CDN" ] && [ "$CVMFS_HTTP_PROXY" = "DIRECT" ] || [ "$CVMFS_HTTP_PROXY" = "auto;DIRECT" ]; then
61+
CVMFS_USE_CDN="yes"
62+
fi
63+
64+
# Stratum 1 servers for the eessi.io domain
65+
if [ "$CVMFS_USE_CDN" = "yes" ]; then
66+
CVMFS_SERVER_URL="{{ eessi_cvmfs_server_cdn_urls | selectattr('domain', 'equalto', 'eessi.io') | map(attribute='urls') | sum(start=[]) | join(';') }}"
67+
else
68+
CVMFS_SERVER_URL="{{ eessi_cvmfs_server_urls | selectattr('domain', 'equalto', 'eessi.io') | map(attribute='urls') | sum(start=[]) | join(';') }}"
5969
fi
6070
6171
dest: "{{ package_source_dir }}/etc/cvmfs/domain.d/{{ item.domain }}.conf"

0 commit comments

Comments
 (0)