|
22 | 22 | register: openrc_file_stat
|
23 | 23 | run_once: true
|
24 | 24 |
|
25 |
| - - block: |
| 25 | + - name: If admin-openrc.sh exists, deploy os-capacity exporter |
| 26 | + when: stackhpc_enable_os_capacity and openrc_file_stat.stat.exists |
| 27 | + block: |
26 | 28 | - name: Ensure os-capacity directory exists
|
27 | 29 | ansible.builtin.file:
|
28 | 30 | path: /opt/kayobe/os-capacity/
|
|
37 | 39 |
|
38 | 40 | - name: Set facts for admin credentials
|
39 | 41 | ansible.builtin.set_fact:
|
40 |
| - stackhpc_os_capacity_auth_url: "{{ credential.stdout_lines | select('match', '.*OS_AUTH_URL*.') | first | split('=') | last | replace(\"'\",'') }}" |
41 |
| - stackhpc_os_capacity_project_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_NAME*.') | first | split('=') | last | replace(\"'\",'') }}" |
42 |
| - stackhpc_os_capacity_domain_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_DOMAIN_NAME*.') | first | split('=') | last | replace(\"'\",'') }}" |
43 |
| - stackhpc_os_capacity_openstack_region_name: "{{ credential.stdout_lines | select('match', '.*OS_REGION_NAME*.') | first | split('=') | last | replace(\"'\",'') }}" |
44 |
| - stackhpc_os_capacity_username: "{{ credential.stdout_lines | select('match', '.*OS_USERNAME*.') | first | split('=') | last | replace(\"'\",'') }}" |
45 |
| - stackhpc_os_capacity_password: "{{ credential.stdout_lines | select('match', '.*OS_PASSWORD*.') | first | split('=') | last | replace(\"'\",'') }}" |
| 42 | + stackhpc_os_capacity_auth_url: "{{ credential.stdout_lines | select('match', '.*OS_AUTH_URL*.') | first | split('=') | last | replace(\"'\", '') }}" |
| 43 | + stackhpc_os_capacity_project_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_NAME*.') | first | split('=') | last | replace(\"'\", '') }}" |
| 44 | + stackhpc_os_capacity_domain_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_DOMAIN_NAME*.') | first | split('=') | last | replace(\"'\", '') }}" |
| 45 | + stackhpc_os_capacity_openstack_region_name: "{{ credential.stdout_lines | select('match', '.*OS_REGION_NAME*.') | first | split('=') | last | replace(\"'\", '') }}" |
| 46 | + stackhpc_os_capacity_username: "{{ credential.stdout_lines | select('match', '.*OS_USERNAME*.') | first | split('=') | last | replace(\"'\", '') }}" |
| 47 | + stackhpc_os_capacity_password: "{{ credential.stdout_lines | select('match', '.*OS_PASSWORD*.') | first | split('=') | last | replace(\"'\", '') }}" |
46 | 48 |
|
47 | 49 | - name: Template clouds.yml
|
48 | 50 | ansible.builtin.template:
|
|
72 | 74 | restart: "{{ clouds_yaml_result is changed or cacert_result is changed }}"
|
73 | 75 | restart_policy: unless-stopped
|
74 | 76 | become: true
|
75 |
| - when: stackhpc_enable_os_capacity and openrc_file_stat.stat.exists |
|
0 commit comments