Skip to content

Commit fce13ed

Browse files
committed
Compute script: configure EESSI
1 parent c1065b3 commit fce13ed

File tree

1 file changed

+61
-9
lines changed

1 file changed

+61
-9
lines changed

ansible/roles/compute_init/files/compute-init.yml

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@
1111
# block device (disk) on which to create the exported filesystem.
1212
# if the disk is not defined, formatting and mounting will not be done.
1313
nfs_disk_location:
14-
1514
# Path to exported filesystem mountpoint on nfs servers
1615
nfs_export: "/exports/home"
17-
1816
# nfs client mount options
1917
nfs_client_mnt_options:
20-
2118
# Path to mountpoint on nfs clients
2219
nfs_client_mnt_point: "/home"
2320
nfs_client_mnt_state: mounted
24-
2521
nfs_server: "{{ control_node_ip }}"
2622

2723

@@ -38,23 +34,29 @@
3834

3935

4036
basic_users_manage_homedir: false
41-
4237
basic_users_userdefaults:
4338
state: present
4439
create_home: "{{ basic_users_manage_homedir }}"
4540
generate_ssh_key: "{{ basic_users_manage_homedir }}"
4641
ssh_key_comment: "{{ item.name }}"
47-
4842
test_user_password: "zXpcWyGQL7jtZnqylQra4g=="
49-
5043
basic_users_users:
5144
- name: testuser # can't use rocky as $HOME isn't shared!
5245
password: "{{ test_user_password | password_hash('sha512', 65534 | random(seed=inventory_hostname) | string) }}" # idempotent
5346
uid: 1005
5447
state: present
55-
5648
basic_users_groups: []
5749

50+
51+
# Default to 10GB
52+
cvmfs_quota_limit_mb: 10000
53+
cvmfs_config_default:
54+
CVMFS_CLIENT_PROFILE: single
55+
CVMFS_QUOTA_LIMIT: "{{ cvmfs_quota_limit_mb }}"
56+
cvmfs_config_overrides: {}
57+
cvmfs_config: "{{ cvmfs_config_default | combine(cvmfs_config_overrides) }}"
58+
59+
5860
tasks:
5961
- name: Configure resolve.conf
6062
block:
@@ -217,4 +219,54 @@
217219
loop: "{{ basic_users_users }}"
218220
loop_control:
219221
label: "{{ item.name }}"
220-
when: "'sudo' in item"
222+
when: "'sudo' in item"
223+
224+
225+
- name: Configure EESSI
226+
gather_facts: false
227+
block:
228+
- name: Download Cern GPG key
229+
ansible.builtin.get_url:
230+
url: http://cvmrepo.web.cern.ch/cvmrepo/yum/RPM-GPG-KEY-CernVM
231+
dest: ./cvmfs-key.gpg
232+
233+
- name: Import downloaded GPG key
234+
command: rpm --import cvmfs-key.gpg
235+
236+
- name: Add CVMFS repo
237+
dnf:
238+
name: https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest.noarch.rpm
239+
240+
- name: Install CVMFS
241+
dnf:
242+
name: cvmfs
243+
244+
- name: Install EESSI CVMFS config
245+
dnf:
246+
name: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi-latest.noarch.rpm
247+
# NOTE: Can't find any docs on obtaining gpg key - maybe downloading directly from github is ok?
248+
disable_gpg_check: true
249+
250+
# Alternative version using official repo - still no GPG key :(
251+
# - name: Add EESSI repo
252+
# dnf:
253+
# name: http://repo.eessi-infra.org/eessi/rhel/8/noarch/eessi-release-0-1.noarch.rpm
254+
255+
# - name: Install EESSI CVMFS config
256+
# dnf:
257+
# name: cvmfs-config-eessi
258+
259+
- name: Add base CVMFS config
260+
community.general.ini_file:
261+
dest: /etc/cvmfs/default.local
262+
section: null
263+
option: "{{ item.key }}"
264+
value: "{{ item.value }}"
265+
no_extra_spaces: true
266+
loop: "{{ cvmfs_config | dict2items }}"
267+
268+
269+
# NOTE: Not clear how to make this idempotent
270+
- name: Ensure CVMFS config is setup
271+
command:
272+
cmd: "cvmfs_config setup"

0 commit comments

Comments
 (0)