Skip to content

Commit 726fa61

Browse files
Merge branch 'stable_14r4' of gitlab.taurusgroup.one:clustervision/trinityx-combined into stable_14r4
2 parents 08d4f5c + 91ec4af commit 726fa61

File tree

13 files changed

+153
-4
lines changed

13 files changed

+153
-4
lines changed

site/controller.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@
269269
tags: ood, ood-vnc
270270

271271
- role: trinity/ood-interactive_apps
272+
ood_apps_admin_group: '{{ admin_group }}'
272273
tags: ood, interactive-apps, ood-interactive-apps
273274

274275
# - role: trinity/prometheus-auth

site/imports/trinity-redhat-image-setup.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
tags: ood, ood-vnc
100100

101101
- role: trinity/ood-interactive_apps
102+
ood_apps_admin_group: '{{ admin_group }}'
102103
tags: ood, ood-interactive-apps, interactive-apps
103104

104105
- role: trinity/target

site/imports/trinity-ubuntu-image-setup.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
# tags: ood
9898

9999
- role: trinity/ood-interactive_apps
100+
ood_apps_admin_group: '{{ admin_group }}'
100101
tags: ood, ood-interactive-apps, interactive-apps
101102

102103
- role: trinity/target

site/roles/trinity/mariadb/tasks/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@
3939
seuser: system_u
4040
when: primary | default(True)
4141

42+
- name: modify mariadb-server.cnf
43+
replace:
44+
dest: '/etc/my.cnf.d/mariadb-server.cnf'
45+
regexp: '^{{ item }}='
46+
replace: '#{{ item }}='
47+
with_items:
48+
- datadir
49+
- socket
50+
ignore_errors: true
51+
4252
- name: Render /etc/my.cnf
4353
template:
4454
src: 'etc_my.cnf.j2'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
---
2+
3+
ood_apps_admin_group: 'admins'

site/roles/trinity/ood-interactive_apps/tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
when: '"Code Server" in ood_interactive_apps'
1414
tags: codeserver
1515

16+
- name: Install OSImage addons
17+
ansible.builtin.include_tasks:
18+
file: osimage.yml
19+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
3+
- block:
4+
- name: Ensure addons directory exists
5+
file:
6+
path: "{{ trix_ood }}/{{ ood_portal_version }}/osimage/addons/"
7+
state: directory
8+
9+
- name: Render wrapper addon for lchroot
10+
template:
11+
src: "osimage/lchroot_wrapper.sh.j2"
12+
dest: "{{ trix_ood }}/{{ ood_portal_version }}/osimage/addons/chroot_wrapper.sh"
13+
mode: 0755
14+
owner: root
15+
group: root
16+
17+
- name: Render sudoers for lchroot
18+
template:
19+
src: "osimage/sudoers.j2"
20+
dest: "/etc/sudoers.d/lchroot"
21+
mode: 0755
22+
owner: root
23+
group: root
24+
when:
25+
- on_controller|default(False)
26+
- ansible_connection not in 'chroot'
27+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
3+
# This code is part of the TrinityX software suite
4+
# Copyright (C) 2023 ClusterVision Solutions b.v.
5+
#
6+
# This program is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program. If not, see <https://www.gnu.org/licenses/>
18+
19+
###
20+
#
21+
# USAGE:
22+
# cat /etc/ood/config/apps/shell/env
23+
# OOD_SSH_WRAPPER=/trinity/local/ondemand/3.0/osimage/addons/chroot_wrapper.sh
24+
#
25+
# cat /trinity/local/ondemand/3.0/osimage/addons/chroot_wrapper.sh
26+
# https://vmware-controller1.cluster:8080/pun/sys/shell/ssh/vmware-controller1.cluster/image=compute,path=/trinity/images/compute,kernel_version=5.14.0-427.37.1.el9_4.x86_64
27+
#
28+
####
29+
30+
function wait_till_ok {
31+
local OS_PATH=$1
32+
if [[ -f "${OS_PATH}/tmp/lchroot.lock" ]]; then
33+
echo "lchroot is already running, waiting for it to finish (press f to force)"
34+
35+
while [[ -f "${OS_PATH}/tmp/lchroot.lock" ]]; do
36+
read -t 1 -n 1 -s key
37+
if [[ $key == "f" ]]; then
38+
echo ""
39+
echo "Removing lock file"
40+
sudo rm "${OS_PATH}/tmp/lchroot.lock"
41+
break
42+
else
43+
echo -n "."
44+
fi
45+
done
46+
fi
47+
}
48+
49+
50+
for arg in "$@"; do
51+
if [[ "$arg" =~ image= ]]; then
52+
OS_IMAGE=$(echo "$arg" | grep -oP 'image=[^,]+' | cut -d= -f2 | tr -d "'")
53+
fi
54+
if [[ "$arg" =~ path= ]]; then
55+
OS_PATH=$(echo "$arg" | grep -oP 'path=[^,]+' | cut -d= -f2 | tr -d "'")
56+
fi
57+
done
58+
59+
60+
if [[ -n "$OS_IMAGE" ]]; then
61+
if [[ ! -n "$OS_PATH" ]]; then
62+
OS_PATH="{{ trix_images }}/${OS_IMAGE}"
63+
fi
64+
wait_till_ok "${OS_PATH}"
65+
sudo lchroot $OS_IMAGE
66+
else
67+
exec /usr/bin/ssh "$@"
68+
fi
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
%{{ood_apps_admin_group}} ALL=(ALL) NOPASSWD: /usr/sbin/lchroot
2+
%{{ood_apps_admin_group}} ALL=(ALL) NOPASSWD: /bin/rm {{ trix_images }}/*/tmp/lchroot.lock

site/roles/trinity/openldap/tasks/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,18 @@
136136
shell: rsync -raW -AX /etc/openldap/slapd.d/* {{ openldap_server_conf_path|quote }}
137137
args:
138138
creates: '{{ openldap_server_conf_path }}/cn=config.ldif'
139+
register: openldap_copy
140+
ignore_errors: true
139141
when: primary | default(True)
140142

143+
- name: Copy default configuration to {{ openldap_server_conf_path }} without xattr
144+
shell: rsync -raW /etc/openldap/slapd.d/* {{ openldap_server_conf_path|quote }}
145+
args:
146+
creates: '{{ openldap_server_conf_path }}/cn=config.ldif'
147+
when:
148+
- primary | default(True)
149+
- openldap_copy is failed
150+
141151
- name: Delete default configuration
142152
file:
143153
path: '/etc/openldap/slapd.d'

0 commit comments

Comments
 (0)