Skip to content

Commit 12effec

Browse files
committed
Merge branch 'main' into feat/auto-bump-timestamps
2 parents 9ff34cb + 2903223 commit 12effec

File tree

54 files changed

+466
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+466
-106
lines changed

.github/workflows/stackhpc.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ jobs:
111111
. venv/bin/activate
112112
. environments/.stackhpc/activate
113113
ansible-playbook ansible/adhoc/generate-passwords.yml
114-
echo vault_testuser_password: "$TESTUSER_PASSWORD" > $APPLIANCES_ENVIRONMENT_ROOT/inventory/group_vars/all/test_user.yml
114+
echo vault_demo_user_password: "$DEMO_USER_PASSWORD" > $APPLIANCES_ENVIRONMENT_ROOT/inventory/group_vars/all/test_user.yml
115115
env:
116-
TESTUSER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
116+
DEMO_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
117117

118118
- name: Provision nodes using fat image
119119
id: provision_servers
@@ -175,12 +175,12 @@ jobs:
175175
--spider \
176176
--server-response \
177177
--no-check-certificate \
178-
--http-user=testuser \
179-
--http-password=${TESTUSER_PASSWORD} https://${openondemand_servername} \
178+
--http-user=demo_user \
179+
--http-password=${DEMO_USER_PASSWORD} https://${openondemand_servername} \
180180
2>&1)
181181
(echo $statuscode | grep "200 OK") || (echo $statuscode && exit 1)
182182
env:
183-
TESTUSER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
183+
DEMO_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
184184

185185
# - name: Build environment-specific compute image
186186
# id: packer_build

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ To deploy this infrastructure, ensure the venv and the environment are [activate
104104

105105
export OS_CLOUD=openstack
106106
cd environments/$ENV/terraform/
107+
tofu init
107108
tofu apply
108109

109110
and follow the prompts. Note the OS_CLOUD environment variable assumes that OpenStack credentials are defined using a [clouds.yaml](https://docs.openstack.org/python-openstackclient/latest/configuration/index.html#clouds-yaml) file in a default location with the default cloud name of `openstack`.

ansible/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ roles/*
5858
!roles/squid/**
5959
!roles/tuned/
6060
!roles/tuned/**
61+
!roles/sssd/
62+
!roles/sssd/**
63+
!roles/sshd/
64+
!roles/sshd/**
6165
!roles/compute_init/
6266
!roles/compute_init/**
6367
!roles/k3s/

ansible/bootstrap.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@
110110
policy: "{{ selinux_policy }}"
111111
register: sestatus
112112

113+
- hosts: sshd
114+
tags: sshd
115+
gather_facts: no
116+
become: yes
117+
tasks:
118+
- name: Configure sshd
119+
import_role:
120+
name: sshd
121+
113122
- hosts: dnf_repos
114123
become: yes
115124
tasks:

ansible/fatimage.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
name: freeipa
5555
tasks_from: client-install.yml
5656
when: "'freeipa_client' in group_names"
57+
- name: Install sssd
58+
import_role:
59+
name: sssd
60+
tasks_from: install.yml
61+
when: "'sssd' in group_names"
5762

5863
# - import_playbook: filesystems.yml:
5964
- name: Install nfs packages

ansible/iam.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@
4040
import_role:
4141
name: freeipa
4242
tasks_from: users.yml
43+
44+
- hosts: sssd
45+
become: yes
46+
gather_facts: no
47+
tags: sssd
48+
tasks:
49+
- name: Configure sssd
50+
import_role:
51+
name: sssd

ansible/roles/basic_users/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Role Variables
2424
- An additional key `sudo` may optionally be specified giving a string (possibly multiline) defining sudo rules to be templated.
2525
- Any other keys may present for other purposes (i.e. not used by this role).
2626
- `basic_users_groups`: Optional, default empty list. A list of mappings defining information for each group. Mapping keys/values are passed through as parameters to [ansible.builtin.group](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/group_module.html) and default values are as given there.
27+
- `basic_users_override_sssd`: Optional bool, default false. Whether to disable `sssd` when ensuring users/groups exist with this role. Permits creating local users/groups even if they clash with users provided via sssd (e.g. from LDAP). Ignored if host is not in group `sssd` as well. Note with this option active `sssd` will be stopped and restarted each time this role is run.
2728

2829
Dependencies
2930
------------

ansible/roles/basic_users/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ basic_users_userdefaults:
77
shell: "{{'/sbin/nologin' if 'control' in group_names else omit }}"
88
basic_users_users: []
99
basic_users_groups: []
10+
basic_users_override_sssd: false

ansible/roles/basic_users/tasks/main.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77
label: "{{ item.name }}"
88
when:
99
- "item.state | default('present') == 'absent'"
10-
10+
11+
- name: Stop sssd if required
12+
systemd:
13+
name: sssd
14+
state: stopped
15+
register: _stop_sssd
16+
when:
17+
- "'sssd' in group_names"
18+
- basic_users_override_sssd | bool
19+
1120
- name: Create groups
1221
ansible.builtin.group: "{{ item }}"
1322
loop: "{{ basic_users_groups }}"
@@ -19,6 +28,12 @@
1928
label: "{{ item.name }} [{{ item.state | default('present') }}]"
2029
register: basic_users_info
2130

31+
- name: Restart sssd if required
32+
systemd:
33+
name: sssd
34+
state: started
35+
when: _stop_sssd is changed
36+
2237
- name: Write supplied public key as authorized for SSH access
2338
authorized_key:
2439
user: "{{ item.name }}"

ansible/roles/passwords/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ slurm_appliance_secrets:
1010
vault_freeipa_admin_password: "{{ vault_freeipa_admin_password | default(lookup('password', '/dev/null')) }}"
1111
vault_k3s_token: "{{ vault_k3s_token | default(lookup('ansible.builtin.password', '/dev/null', length=64)) }}"
1212
vault_pulp_admin_password: "{{ vault_pulp_admin_password | default(lookup('password', '/dev/null', chars=['ascii_letters', 'digits'])) }}"
13+
vault_demo_user_password: "{{ vault_demo_user_password | default(lookup('password', '/dev/null')) }}"
1314

1415
secrets_openhpc_mungekey_default:
1516
content: "{{ lookup('pipe', 'dd if=/dev/urandom bs=1 count=1024 2>/dev/null | base64') }}"

0 commit comments

Comments
 (0)