Merge "KVMFORNFV: Update Grafana config for Packet Forwarding test cases."
[yardstick.git] / ansible / roles / convert_openrc / tasks / main.yml
1 # Copyright (c) 2017 Intel Corporation.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 ---
15 - name: parse openrc into openstack auth dict
16   parse_shell_file: path="{{ openrc_file }}" fact_name="openrc"
17
18 - debug: var=openrc
19
20 - set_fact:
21     yardstick_url_ip: "{{ openrc.OS_AUTH_URL|urlsplit|attr('hostname') }}"
22
23 - debug: var=yardstick_url_ip
24
25 # This doesn't work, due to OS_IDENTITY_API_VERSION, use environment
26
27 - set_fact:
28     os_auth:
29       auth_url: "{{ openrc.OS_AUTH_URL }}"
30       password: "{{ openrc.OS_PASSWORD }}"
31       username: "{{ openrc.OS_USERNAME }}"
32       project_name: "{{ openrc.OS_PROJECT_NAME }}"
33 #      tenant_name: "{{ openrc.OS_TENANT_NAME }}"
34       project_domain_name: "{{ openrc.OS_PROJECT_DOMAIN_NAME }}"
35 #      user_domain_name: "{{ openrc.OS_USER_DOMAIN_NAME }}"
36       # BUGS: We need to specify identity_api_version == 3, but we can't do it here
37       # because it is not the write place
38       # we need to set it via OS_IDENTITY_API_VERSION or clouds.yaml
39 #      identity_api_version: "{{ openrc.OS_IDENTITY_API_VERSION }}"
40
41 - debug: var=os_auth
42
43 - set_fact:
44     clouds:
45         demo:
46             # must specify API version here
47             identity_api_version: "{{ openrc.OS_IDENTITY_API_VERSION }}"
48             auth: "{{ os_auth }}"
49
50 - template:
51     src: clouds.yaml.j2
52     # this is autodetected and used
53     dest: "{{ cloud_yaml_path }}"
54   when:  write_cloud_yaml|default(False)
55