Merge "apiserver: mock socket.gethostbyname"
[yardstick.git] / ansible / prepare_env.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 - hosts: yardstick
16   vars_files:
17     - yardstick_config.yml
18
19   pre_tasks:
20     - name: check for openrc
21       stat: path="{{ OPENRC }}"
22       ignore_errors: yes
23       register: openrc_stat
24
25     - set_fact:
26         openrc_present: "{{ openrc_stat.stat.isreg|default(False) }}"
27
28     - fail: msg="{{ INSTALLER_TYPE }} not in {{ INSTALLERS }}"
29       when: not openrc_present and (INSTALLER_TYPE not in INSTALLERS)
30
31     - name: fetch OS credentials
32       command: "{{ RELENG_REPO_DIR }}/utils/fetch_os_creds.sh {{ '-v' if DEPLOY_TYPE == 'virt' else '' }} -d {{ OPENRC }} -i {{ INSTALLER_TYPE }} -a {{ INSTALLER_IP }}"
33       when: not openrc_present
34
35
36   roles:
37     - role: convert_openrc
38       openrc_file: "{{ OPENRC }}"
39       cloud_yaml_path: "{{ opnfv_root }}/clouds.yaml"
40     - role: create_storperf_admin_rc
41     - role: add_fuel_jumphost
42       when: "INSTALLER_TYPE == 'fuel'"
43
44
45   post_tasks:
46     # if huawei-pod1 then copy storeperf_adminrc to deployment location?
47     - name: add huawei-pod1 so we can copy storeperf_admin-rc to pod
48       add_host:
49         name: huawei-pod1
50         ansible_ssh_host: "192.168.200.1"
51         ansible_ssh_pass: root
52         ansible_ssh_use: root
53       when: "NODE_NAME == 'huawei-pod1'"
54
55
56 - hosts: huawei-pod1
57   tasks:
58     - name: copy a admin-rc file for StorPerf integration to the deployment location
59       copy:
60         src: "{{ storperf_rc }}"
61         dest: /root/
62
63
64 - hosts: fuel_jumphost
65   roles:
66     - create_fuel_pod_yaml
67
68
69