Skip to content

Commit f016417

Browse files
Post service deploy hook for OpenStack Capacity
1 parent c700e7b commit f016417

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,27 @@
88
path: /opt/kayobe/os-capacity/
99
state: directory
1010

11+
- name: Read admin-openrc credential file
12+
ansible.builtin.command:
13+
cmd: "cat {{ lookup('ansible.builtin.env', 'KOLLA_CONFIG_PATH') }}/admin-openrc.sh"
14+
delegate_to: localhost
15+
register: credential
16+
17+
- name: Set facts for admin credentials
18+
ansible.builtin.set_fact:
19+
os_capacity_auth_url: "{{ credential.stdout_lines | select('match', '.*OS_AUTH_URL*.') | first | split('=') | last | replace(\"'\",'') }}"
20+
os_capacity_project_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_NAME*.') | first | split('=') | last | replace(\"'\",'') }}"
21+
os_capacity_domain_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_DOMAIN_NAME*.') | first | split('=') | last | replace(\"'\",'') }}"
22+
os_capacity_username: "{{ credential.stdout_lines | select('match', '.*OS_USERNAME*.') | first | split('=') | last | replace(\"'\",'') }}"
23+
os_capacity_password: "{{ credential.stdout_lines | select('match', '.*OS_PASSWORD*.') | first | split('=') | last | replace(\"'\",'') }}"
24+
1125
- name: Template clouds.yml
1226
ansible.builtin.template:
1327
src: templates/os_capacity-clouds.yml.j2
1428
dest: /opt/kayobe/os-capacity/clouds.yaml
1529

1630
- name: Ensure os_capacity container is running
17-
docker_container:
31+
community.docker.docker_container:
1832
name: os_capacity
1933
image: ghcr.io/stackhpc/os-capacity:master
2034
env:
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
clouds:
22
openstack:
33
auth:
4-
auth_url: "{{ secrets_os_capacity_auth_url }}"
5-
application_credential_id: "{{ secrets_os_capacity_credential_id }}"
6-
application_credential_secret: "{{ secrets_os_capacity_credential_secret }}"
4+
auth_url: "{{ os_capacity_auth_url }}"
5+
project_name: "{{ os_capacity_project_name }}"
6+
domain_name: "{{ os_capacity_domain_name }}"
7+
username: "{{ os_capacity_username }}"
8+
password: "{{ os_capacity_password }}"
79
region_name: "RegionOne"
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)