Skip to content

Commit 577ecae

Browse files
Post service deploy hook for OpenStack Capacity
1 parent a41fe3f commit 577ecae

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

etc/kayobe/ansible/deploy-os-capacity-exporter.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,27 @@
1515
path: /opt/kayobe/os-capacity/
1616
state: directory
1717

18+
- name: Read admin-openrc credential file
19+
ansible.builtin.command:
20+
cmd: "cat {{ lookup('ansible.builtin.env', 'KOLLA_CONFIG_PATH') }}/admin-openrc.sh"
21+
delegate_to: localhost
22+
register: credential
23+
24+
- name: Set facts for admin credentials
25+
ansible.builtin.set_fact:
26+
stackhpc_os_capacity_auth_url: "{{ credential.stdout_lines | select('match', '.*OS_AUTH_URL*.') | first | split('=') | last | replace(\"'\",'') }}"
27+
stackhpc_os_capacity_project_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_NAME*.') | first | split('=') | last | replace(\"'\",'') }}"
28+
stackhpc_os_capacity_domain_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_DOMAIN_NAME*.') | first | split('=') | last | replace(\"'\",'') }}"
29+
stackhpc_os_capacity_username: "{{ credential.stdout_lines | select('match', '.*OS_USERNAME*.') | first | split('=') | last | replace(\"'\",'') }}"
30+
stackhpc_os_capacity_password: "{{ credential.stdout_lines | select('match', '.*OS_PASSWORD*.') | first | split('=') | last | replace(\"'\",'') }}"
31+
1832
- name: Template clouds.yml
1933
ansible.builtin.template:
2034
src: templates/os_capacity-clouds.yml.j2
2135
dest: /opt/kayobe/os-capacity/clouds.yaml
2236

2337
- name: Ensure os_capacity container is running
24-
docker_container:
38+
community.docker.docker_container:
2539
name: os_capacity
2640
image: ghcr.io/stackhpc/os-capacity:master
2741
env:

etc/kayobe/ansible/templates/os_capacity-clouds.yml.j2

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ clouds:
22
openstack:
33
auth:
44
auth_url: "{{ stackhpc_os_capacity_auth_url }}"
5-
application_credential_id: "{{ secrets_os_capacity_credential_id }}"
6-
application_credential_secret: "{{ secrets_os_capacity_credential_secret }}"
5+
project_name: "{{ stackhpc_os_capacity_project_name }}"
6+
domain_name: "{{ stackhpc_os_capacity_domain_name }}"
7+
username: "{{ stackhpc_os_capacity_username }}"
8+
password: "{{ stackhpc_os_capacity_password }}"
79
region_name: "{{ stackhpc_os_capacity_openstack_region_name }}"
810
interface: "internal"
911
identity_api_version: 3
10-
auth_type: "v3applicationcredential"
12+
auth_type: "password"
1113
{% if not stackhpc_os_capacity_openstack_verify | bool %}
1214
verify: False
1315
{% endif %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../ansible/deploy-os-capacity-exporter.yml

0 commit comments

Comments
 (0)