Skip to content

Commit b72c24c

Browse files
Staging xrdp,podman-compose,eessi,apptainer
1 parent f61aa44 commit b72c24c

File tree

11 files changed

+136
-157
lines changed

11 files changed

+136
-157
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
EESSI
2+
=====
3+
4+
Configure the EESSI pilot respository for use on given hosts.
5+
6+
Requirements
7+
------------
8+
9+
None.
10+
11+
Role Variables
12+
--------------
13+
14+
- `cvmfs_quota_limit_mb`: Optional int. Maximum size of local package cache on each node in MB.
15+
- `cvmfs_config_overrides`: Optional dict. Set of key-value pairs for additional CernVM-FS settings see [official docs](https://cvmfs.readthedocs.io/en/stable/cpt-configure.html) for list of options. Each dict key should correspond to a valid config variable (e.g. `CVMFS_HTTP_PROXY`) and the corresponding dict value will be set as the variable value (e.g. `https://my-proxy.com`). These configuration parameters will be written to the `/etc/cvmfs/default.local` config file on each host in the form `KEY=VALUE`.
16+
17+
Dependencies
18+
------------
19+
20+
None.
21+
22+
Example Playbook
23+
----------------
24+
25+
```yaml
26+
- name: Setup EESSI
27+
hosts: eessi
28+
tags: eessi
29+
become: true
30+
tasks:
31+
- name: Install and configure EESSI
32+
import_role:
33+
name: eessi
34+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# Default to 10GB
3+
cvmfs_quota_limit_mb: "10000"
4+
5+
cvmfs_config_default:
6+
CVMFS_CLIENT_PROFILE: "single"
7+
CVMFS_QUOTA_LIMIT: "{{ cvmfs_quota_limit_mb }}"
8+
9+
cvmfs_config_overrides: {}
10+
11+
cvmfs_config: "{{ cvmfs_config_default | combine(cvmfs_config_overrides) }}"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
- name: Download CVMFS repo
3+
ansible.builtin.get_url:
4+
url: https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb
5+
dest: '.'
6+
7+
- name: Add CVMFS repo
8+
shell: 'dpkg -i cvmfs-release-latest_all.deb'
9+
10+
- name: Update cache
11+
shell: 'apt update'
12+
13+
- name: Install CVMFS
14+
apt:
15+
name: cvmfs
16+
update_cache: true
17+
18+
- name: Download EESSI CVMFS config
19+
ansible.builtin.get_url:
20+
url: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
21+
dest: '.'
22+
23+
- name: Install EESSI CVMFS config
24+
shell: 'dpkg -i cvmfs-config-eessi_latest_all.deb'
25+
26+
# Alternative version using official repo - still no GPG key :(
27+
# - name: Add EESSI repo
28+
# dnf:
29+
# name: http://repo.eessi-infra.org/eessi/rhel/8/noarch/eessi-release-0-1.noarch.rpm
30+
31+
# - name: Install EESSI CVMFS config
32+
# dnf:
33+
# name: cvmfs-config-eessi
34+
35+
- name: Add base CVMFS config
36+
community.general.ini_file:
37+
dest: /etc/cvmfs/default.local
38+
option: "{{ item.key }}"
39+
value: "{{ item.value }}"
40+
section: "null"
41+
no_extra_spaces: true
42+
loop: "{{ cvmfs_config | dict2items }}"
43+
44+
45+
# NOTE: Not clear how to make this idempotent
46+
- name: Ensure CVMFS config is setup
47+
command:
48+
cmd: "cvmfs_config setup"

ansible/roles/linux-webconsole/files/guacamole-playbook.yml

Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,54 +40,23 @@
4040
key: "{{ guacamole_ssh_public_key }}"
4141

4242
- block:
43-
- name: Generate VNC password for Guacamole
43+
- name: Generate password for Guacamole
4444
set_fact:
45-
guacamole_vnc_password: "{{ lookup('community.general.random_string', length = 16, override_special = special_chars) }}"
45+
guacamole_password: "{{ lookup('community.general.random_string', length = 16, override_special = special_chars) }}"
4646
vars:
4747
# Even though this string is within a CDATA tag, there's very small chance of
4848
# generating ]]>, which will still break XML. Therefore remove ">" from special
4949
# characters.
5050
special_chars: '!"#$%&()*+,-./:;<=?@[\]^_`{|}~'
5151

52-
- block:
53-
- name: Get Guacamole user info
54-
getent:
55-
database: passwd
56-
key: "{{ guacamole_user }}"
57-
58-
- name: Set Guacamole user home directory
59-
set_fact:
60-
guacamole_user_home: "{{ ansible_facts.getent_passwd[guacamole_user][4] }}"
61-
62-
- name: Generate VNC password
63-
command: vncpasswd -f
64-
args:
65-
stdin: "{{ guacamole_vnc_password }}"
66-
register: vncpassword
67-
68-
- name: Create VNC directory
69-
file:
70-
state: directory
71-
path: "{{ guacamole_user_home }}/.vnc"
72-
owner: "{{ guacamole_user }}"
73-
group: "{{ guacamole_user }}"
74-
mode: "0775"
75-
76-
- name: Create VNC password file
77-
copy:
78-
content: "{{ vncpassword.stdout }}"
79-
dest: "{{ guacamole_user_home }}/.vnc/passwd"
80-
owner: "{{ guacamole_user }}"
81-
group: "{{ guacamole_user }}"
82-
mode: "0600"
83-
become: yes
84-
become_user: "{{ guacamole_user }}"
85-
86-
- name: Start and enable VNC server
87-
service:
88-
name: vncserver@:1.service
89-
state: started
90-
enabled: yes
52+
- name: Configure default user
53+
ansible.builtin.user:
54+
name: "{{ guacamole_user }}"
55+
state: present
56+
password: "{{ guacamole_password | password_hash('sha512') }}"
57+
append: true
58+
groups: ssl-cert
59+
become: true
9160
when: desktop_enabled
9261

9362
- name: Write Guacamole user mapping file
@@ -105,12 +74,11 @@
10574
</connection>
10675
{% if desktop_enabled %}
10776
<connection name="desktop">
108-
<protocol>vnc</protocol>
77+
<protocol>rdp</protocol>
10978
<param name="hostname">{{ ansible_default_ipv4.address }}</param>
110-
<param name="port">5901</param>
111-
<param name="autoretry">3</param>
79+
<param name="port">3389</param>
11280
<param name="username">{{ guacamole_user }}</param>
113-
<param name="password"><![CDATA[{{ guacamole_vnc_password }}]]></param>
81+
<param name="password"><![CDATA[{{ guacamole_password }}]]></param>
11482
</connection>
11583
{% endif %}
11684
</authorize>

ansible/roles/linux-webconsole/files/vnc_server/restart.conf

Lines changed: 0 additions & 5 deletions
This file was deleted.

ansible/roles/linux-webconsole/files/vnc_server/start_order.conf

Lines changed: 0 additions & 7 deletions
This file was deleted.

ansible/roles/linux-webconsole/files/vnc_server/vncserver@.service

Lines changed: 0 additions & 18 deletions
This file was deleted.

ansible/roles/linux-webconsole/files/vnc_server/xstartup

Lines changed: 0 additions & 12 deletions
This file was deleted.

ansible/roles/linux-webconsole/tasks/main.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,42 @@
3838

3939
- block:
4040
- include_tasks: desktop.yml
41-
- include_tasks: vnc_server.yml
4241
when: desktop_enabled is defined and desktop_enabled
4342

43+
- name: Install xrdp
44+
apt:
45+
name: xrdp
46+
state: present
47+
when: ansible_os_family == "Debian"
48+
49+
- name: Install dbus-x11 package
50+
apt:
51+
name: dbus-x11
52+
state: present
53+
when: ansible_os_family == "Debian"
54+
4455
- include_role:
4556
name: linux-ansible-init
4657

4758
- include_role:
4859
name: linux-podman
4960
tasks_from: install.yml
5061

62+
- name: Install podman-compose
63+
pip:
64+
name: podman-compose
65+
state: present
66+
67+
- name: Add apptainer repository
68+
apt_repository:
69+
repo: 'ppa:apptainer/ppa'
70+
update_cache: true
71+
72+
- name: Install apptainer
73+
apt:
74+
name: apptainer
75+
state: present
76+
5177
- include_role:
5278
name: linux-data-volumes
5379
vars:
@@ -63,6 +89,9 @@
6389
owner: ubuntu
6490
group: ubuntu
6591

92+
- include_role:
93+
name: linux-eessi
94+
6695
- include_role:
6796
name: linux-guacamole
6897

ansible/roles/linux-webconsole/tasks/vnc_server.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)