Merge "Clean functional tests in "test_cli_scenario""
[yardstick.git] / ansible / roles / cpu_pin_local_teardown / tasks / main.yaml
1 ---
2 ##############################################################################
3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 - name: get nova-compute host
12   shell:
13     source /etc/yardstick/openstack.creds;
14     openstack availability zone list --long | grep nova-compute | sort | awk '{print $7}';
15   args:
16       executable: /bin/bash
17   register: compute_nodes
18
19 - name: delete flavor yardstick-pinned-flavor
20   os_nova_flavor:
21     cloud: opnfv
22     state: absent
23     name: yardstick-pinned-flavor
24
25 - name: get flavor list
26   shell:
27     source /etc/yardstick/openstack.creds;
28     openstack flavor list | grep "True" | cut -f 2 -d ' ';
29   args:
30       executable: /bin/bash
31   register: flavors
32
33 - name: unset flavor default property
34   shell:
35     source /etc/yardstick/openstack.creds;
36     openstack flavor unset --property aggregate_instance_extra_specs:pinned {{item}};
37   args:
38       executable: /bin/bash
39   with_items:
40       - '{{ flavors.stdout_lines }}'
41
42 - name: delete pinned-cpu and regular host aggregate
43   shell:
44     source /etc/yardstick/openstack.creds;
45     nova aggregate-remove-host pinned-cpu {{ compute_nodes.stdout_lines[0] }};
46     nova aggregate-remove-host regular {{ compute_nodes.stdout_lines[1] }};
47     openstack aggregate delete pinned-cpu;
48     openstack aggregate delete regular;
49   args:
50       executable: /bin/bash