-
Notifications
You must be signed in to change notification settings - Fork 16
/
prepare-client-packages.yml
63 lines (55 loc) · 2.43 KB
/
prepare-client-packages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Prepare the input files for the Debian (deb) and Redhat (rpm) packages for CVMFS clients.
---
- name: Prepare Deb and RPM packages
hosts: localhost
vars:
package_vendor: EESSI
package_maintainer: EESSI <[email protected]>
package_description: CVMFS configuration package for EESSI.
package_source_dir: "{{ lookup('env', 'GITHUB_WORKSPACE') | default('/tmp', True) }}/package"
tasks:
- name: Check the number of defined domains (should be one!)
fail:
msg: "Cannot build a client package when eessi_cvmfs_server_urls contains different domains"
when: eessi_cvmfs_server_urls | selectattr('domain') | list | unique | count > 1
- name: Determine domain name
set_fact:
eessi_domain: "{{ eessi_cvmfs_server_urls[0].domain }}"
- name: Create directory structure for the CVMFS config
file:
path: "{{ item }}"
state: directory
mode: 0775
with_items:
- "{{ package_source_dir }}"
- "{{ package_source_dir }}/etc"
- "{{ package_source_dir }}/etc/cvmfs"
- "{{ package_source_dir }}/etc/cvmfs/keys"
- "{{ package_source_dir }}/etc/cvmfs/keys/{{ eessi_domain }}"
- "{{ package_source_dir }}/etc/cvmfs/domain.d"
- name: Make EESSI CVMFS public key files
copy:
content: "{{ item.key }}"
dest: "{{ package_source_dir }}{{ item.path }}"
mode: 0644
with_items: "{{ eessi_cvmfs_keys }}"
- name: Make EESSI CVMFS domain configuration file
copy:
content: |
# Stratum 1 servers for the eessi.io domain
CVMFS_SERVER_URL="{{ item.urls|join(';') }}"
# Public keys for the eessi.io domain
CVMFS_KEYS_DIR="/etc/cvmfs/keys/{{ item.domain }}"
# Enable or disable the Geo API, based on the configuration file
CVMFS_USE_GEOAPI="{{ item.use_geoapi | ternary('yes', 'no') }}"
# The client profile is supposed to be set in /etc/cvmfs/default.local
if [ "$CVMFS_CLIENT_PROFILE" = "single" ]; then
if [ "$CVMFS_HTTP_PROXY" = "" ]; then
# For individual clients (laptops, clusters < 5 nodes), use a site proxy
# where possible and otherwise a direct stratum 1 connection
CVMFS_HTTP_PROXY="DIRECT"
fi
fi
dest: "{{ package_source_dir }}/etc/cvmfs/domain.d/{{ item.domain }}.conf"
mode: 0644
with_items: "{{ eessi_cvmfs_server_urls }}"