Skip to content

Commit 895f302

Browse files
committed
Merge branch 'main' into feat/hostkey-secrets
2 parents f021167 + 6929272 commit 895f302

File tree

23 files changed

+63
-48
lines changed

23 files changed

+63
-48
lines changed

.github/workflows/stackhpc.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ jobs:
9999
. venv/bin/activate
100100
. environments/.stackhpc/activate
101101
ansible-playbook ansible/adhoc/generate-passwords.yml
102-
echo vault_testuser_password: "$TESTUSER_PASSWORD" > $APPLIANCES_ENVIRONMENT_ROOT/inventory/group_vars/all/test_user.yml
102+
echo vault_demo_user_password: "$DEMO_USER_PASSWORD" > $APPLIANCES_ENVIRONMENT_ROOT/inventory/group_vars/all/test_user.yml
103103
env:
104-
TESTUSER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
104+
DEMO_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
105105

106106
- name: Provision nodes using fat image
107107
id: provision_servers
@@ -163,12 +163,12 @@ jobs:
163163
--spider \
164164
--server-response \
165165
--no-check-certificate \
166-
--http-user=testuser \
167-
--http-password=${TESTUSER_PASSWORD} https://${openondemand_servername} \
166+
--http-user=demo_user \
167+
--http-password=${DEMO_USER_PASSWORD} https://${openondemand_servername} \
168168
2>&1)
169169
(echo $statuscode | grep "200 OK") || (echo $statuscode && exit 1)
170170
env:
171-
TESTUSER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
171+
DEMO_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
172172

173173
# - name: Build environment-specific compute image
174174
# 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/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') }}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
- name: Assert secrets created
22
assert:
3-
that: (hostvars[inventory_hostname].keys() | select('contains', 'vault_') | length) > 1 # 1 as may have vault_testuser_password defined in dev
3+
that: (hostvars[inventory_hostname].keys() | select('contains', 'vault_') | length) > 1 # 1 as may have vault_demo_user_password defined in dev
44
fail_msg: "No inventory variables 'vault_*' found: Has ansible/adhoc/generate-passwords.yml been run?"

docs/openondemand.README.md renamed to docs/openondemand.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ The above functionality is configured by running the `ansible/portal.yml` playbo
3030

3131
See the [ansible/roles/openondemand/README.md](../ansible/roles/openondemand/README.md) for more details on the variables described below.
3232

33-
At minimum the following must be defined:
34-
- `openondemand_servername` - this must be defined for both `openondemand` and `grafana` hosts (when Grafana is enabled). It is suggested to place it groupvars for `all`.
35-
- `openondemand_auth` and any corresponding options.
36-
- `openondemand_desktop_partition` and `openondemand_jupyter_partition` if the corresponding inventory groups are defined.
37-
- `openondemand_host_regex` if `openondemand_desktop` or `openondemand_jupyter` inventory groups are defined and/or proxying Grafana via Open Ondemand is required.
33+
The following variables have been given default values to allow Open Ondemand to work in a newly created environment without additional configuration, but generally should be overridden in `environment/site/inventory/group_vars/all/` with site-specific values:
34+
- `openondemand_servername` - this must be defined for both `openondemand` and `grafana` hosts (when Grafana is enabled). Default is `ansible_host` (i.e. the IP address) of the first host in the `openondemand` group.
35+
- `openondemand_auth` and any corresponding options. Defaults to `basic_pam`.
36+
- `openondemand_desktop_partition` and `openondemand_jupyter_partition` if the corresponding inventory groups are defined. Defaults to the first compute group defined in the `compute` Terraform variable in `environments/$ENV/terraform`.
3837

3938
It is also recommended to set:
4039
- `openondemand_dashboard_support_url`
@@ -45,3 +44,6 @@ If shared filesystems other than `$HOME` are available, add paths to `openondema
4544
The appliance automatically configures Open Ondemand to proxy Grafana and adds a link to it on the Open Ondemand dashboard. This means no external IP (or SSH proxying etc) is required to access Grafana (which by default is deployed on the control node). To allow users to authenticate to Grafana, the simplest option is to enable anonymous (View-only) login by setting `grafana_auth_anonymous` (see [environments/common/inventory/group_vars/all/grafana.yml](../environments/common/inventory/group_vars/all/grafana.yml)[^1]).
4645

4746
[^1]: Note that if `openondemand_auth` is `basic_pam` and anonymous Grafana login is enabled, the appliance will (by default) configure Open Ondemand's Apache server to remove the Authorisation header from proxying of all `node/` addresses. This is done as otherwise Grafana tries to use this header to authenticate, which fails with the default configuration where only the admin Grafana user `grafana` is created. Note that the removal of this header in this configuration means it cannot be used to authenticate proxied interactive applications - however the appliance-deployed remote desktop and Jupyter Notebook server applications use other authentication methods. An alternative if using `basic_pam` is not to enable anonymous Grafana login and to create Grafana users matching the local users (e.g. in `environments/<env>/hooks/post.yml`).
47+
48+
# Access
49+
By default the appliance authenticates against OOD with basic auth through PAM. When creating a new environment, a new user with username `demo_user` will be created. Its password is found under `vault_openondemand_default_user` in the appliance secrets store in `environments/{ENV}/inventory/group_vars/all/secrets.yml`. Other users can be defined by overriding the `basic_users_users` variable in your environment (templated into `environments/{ENV}/inventory/group_vars/all/basic_users.yml` by default).

docs/production.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ and referenced from the `site` and `production` environments, e.g.:
9898

9999
- Configure Open OpenOndemand - see [specific documentation](openondemand.README.md).
100100

101+
- Remove the `demo_user` user from `environments/$ENV/inventory/group_vars/all/basic_users.yml`
102+
103+
- Consider whether having (read-only) access to Grafana without login is OK. If not, remove `grafana_auth_anonymous` in `environments/$ENV/inventory/group_vars/all/grafana.yml`
104+
101105
- Modify `environments/site/terraform/nodes.tf` to provide fixed IPs for at least
102106
the control node, and (if not using FIPs) the login node(s):
103107

environments/.caas/inventory/group_vars/all/selinux.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
test_user_password: "{{ lookup('env', 'TESTUSER_PASSWORD') | default(vault_testuser_password, true) }}" # CI uses env, debug can set vault_testuser_password
1+
test_demo_user_password: "{{ lookup('env', 'DEMO_USER_PASSWORD') | default(vault_demo_user_password, true) }}" # CI uses env, debug can set vault_demo_user_password
22

33
basic_users_users:
4-
- name: testuser # can't use rocky as $HOME isn't shared!
5-
password: "{{ test_user_password | password_hash('sha512', 65534 | random(seed=inventory_hostname) | string) }}" # idempotent
4+
- name: demo_user # can't use rocky as $HOME isn't shared!
5+
password: "{{ test_demo_user_password | password_hash('sha512', 65534 | random(seed=inventory_hostname) | string) }}" # idempotent
66
uid: 1005

environments/.stackhpc/inventory/group_vars/all/freeipa.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# NB: Users defined this way have expired passwords
44
freeipa_users:
5-
- name: testuser # can't use rocky as $HOME isn't shared!
6-
password: "{{ test_user_password }}"
5+
- name: demo_user # can't use rocky as $HOME isn't shared!
6+
password: "{{ test_demo_user_password }}"
77
givenname: test
88
sn: test
99

File renamed without changes.

0 commit comments

Comments
 (0)