Skip to content

Commit 7db2936

Browse files
author
Matt Pryor
committed
Add project ID verification to Zenith clients
1 parent 0b7b795 commit 7db2936

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ collections:
3535
- name: openstack.cloud
3636
- name: https://github.com/stackhpc/ansible-collection-terraform
3737
type: git
38-
version: e7243ff5ccb6186ea2fa6e108e5a2b5f408e59c0
38+
version: ae1dc46a9d266bcdc6e79a6e290edbb080596f7f
3939
- name: https://github.com/stackhpc/ansible_collection_slurm_openstack_tools
4040
type: git
4141
version: v0.1.0

roles/cluster_infra/templates/outputs.tf.j2

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,28 @@ output "cluster_nodes" {
1010
{
1111
name = openstack_compute_instance_v2.login.name
1212
ip = openstack_compute_instance_v2.login.network[0].fixed_ip_v4
13-
groups = ["{{ cluster_name }}_login"]
13+
groups = ["{{ cluster_name }}_login"],
14+
facts = {
15+
openstack_project_id = data.openstack_identity_auth_scope_v3.scope.project_id
16+
}
1417
},
1518
{
1619
name = openstack_compute_instance_v2.control.name
1720
ip = openstack_compute_instance_v2.control.network[0].fixed_ip_v4
18-
groups = ["{{ cluster_name }}_control"]
21+
groups = ["{{ cluster_name }}_control"],
22+
facts = {
23+
openstack_project_id = data.openstack_identity_auth_scope_v3.scope.project_id
24+
}
1925
}
2026
],
2127
[
2228
for compute in openstack_compute_instance_v2.compute: {
2329
name = compute.name
2430
ip = compute.network[0].fixed_ip_v4
25-
groups = ["{{ cluster_name }}_compute"]
31+
groups = ["{{ cluster_name }}_compute"],
32+
facts = {
33+
openstack_project_id = data.openstack_identity_auth_scope_v3.scope.project_id
34+
}
2635
}
2736
]
2837
)

roles/cluster_infra/templates/resources.tf.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#####
2+
##### The identity scope we are operating in
3+
##### Used to output the OpenStack project ID as a fact for provisioned hosts
4+
#####
5+
data "openstack_identity_auth_scope_v3" "scope" {
6+
name = "{{ cluster_name }}"
7+
}
8+
19
#####
210
##### Security groups for the cluster
311
#####

roles/zenith_proxy/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
src: zenith-client.yaml.j2
5050
dest: /etc/zenith/{{ zenith_proxy_service_name }}/client.yaml
5151
become: true
52+
register: zenith_proxy_client_config_file
5253

5354
- name: Create podman volume to persist SSH key
5455
containers.podman.podman_volume:
@@ -89,6 +90,7 @@
8990
{{
9091
'restarted'
9192
if (
93+
zenith_proxy_client_config_file is changed or
9294
zenith_proxy_client_systemd_unit is changed or
9395
zenith_proxy_client_init is changed
9496
)

slurm-infra.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
zenith_proxy_upstream_host: "{{ ansible_default_ipv4.address }}"
8181
zenith_proxy_upstream_port: "{{ grafana_port }}"
8282
zenith_proxy_client_token: "{{ zenith_token_monitoring }}"
83-
zenith_proxy_client_auth_params: {}
83+
zenith_proxy_client_auth_params:
84+
tenancy-id: "{{ openstack_project_id }}"
8485
zenith_proxy_mitm_enabled: yes
8586
zenith_proxy_mitm_auth_inject: basic
8687
zenith_proxy_mitm_auth_basic_username: "{{ grafana_security.admin_user }}"
@@ -98,7 +99,8 @@
9899
zenith_proxy_upstream_host: "{{ ansible_default_ipv4.address }}"
99100
zenith_proxy_upstream_port: 443
100101
zenith_proxy_client_token: "{{ zenith_token_ood }}"
101-
zenith_proxy_client_auth_params: {}
102+
zenith_proxy_client_auth_params:
103+
tenancy-id: "{{ openstack_project_id }}"
102104
zenith_proxy_mitm_enabled: yes
103105
zenith_proxy_mitm_auth_inject: basic
104106
zenith_proxy_mitm_auth_basic_username: azimuth

0 commit comments

Comments
 (0)