Merge "Module to manage pip packages"
[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|default(openrc.OS_TENANT_NAME) }}"
33       project_domain_name: "{{ openrc.OS_PROJECT_DOMAIN_NAME }}"
34
35 - debug: var=os_auth
36
37 - set_fact:
38     clouds:
39         demo:
40             # must specify API version here
41             identity_api_version: "{{ openrc.OS_IDENTITY_API_VERSION|default(3) }}"
42             auth: "{{ os_auth }}"
43
44 - template:
45     src: clouds.yaml.j2
46     # this is autodetected and used
47     dest: "{{ cloud_yaml_path }}"
48   when:  write_cloud_yaml|default(False)
49