78cf87ec70f042781066ef1d1de299a4bff4ff49
[yardstick.git] / ansible / nsb_setup.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 - include: ubuntu_server_baremetal_deploy_samplevnfs.yml
16   vars:
17     YARD_IMG_ARCH: amd64
18
19 - hosts: localhost
20   roles:
21     - install_dependencies
22     - docker
23
24 - include: build_yardstick_image.yml
25   vars:
26     YARD_IMG_ARCH: amd64
27     release: xenial
28   when: openrc_file is defined
29
30 - include: clean_images.yml
31   when: openrc_file is defined
32
33 - hosts: localhost
34   post_tasks:
35     - os_image:
36         name: yardstick-samplevnfs
37         is_public: yes
38         disk_format: qcow2
39         container_format: bare
40         filename: "{{ raw_imgfile }}"
41       environment: "{{ openrc }}"
42       when: openrc_file is defined
43
44     - name: Start yardstick container
45       docker_container:
46         name: yardstick
47         image: opnfv/yardstick:latest
48         recreate: yes
49         state: started
50         restart_policy: always
51         privileged: True
52         interactive: True
53         volumes:
54           - "{{ openrc_file|default('/dev/null') }}:/etc/yardstick/openstack.creds:ro"
55           - /var/run/docker.sock:/var/run/docker.sock
56           - /opt/:/opt