Merge "Mock time.sleep in slow tests"
[yardstick.git] / ansible / post_build_yardstick_image.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: localhost
16
17   tasks:
18     - group_by:
19         key: image_builder
20
21     - name: remove ubuntu policy-rc.d workaround
22       file:
23         path: "{{ mountdir }}/usr/sbin/policy-rc.d"
24         state: absent
25       when: "target_os == 'Ubuntu'"
26
27     - name: cleanup fake tmp fstab
28       file:
29         path: "{{ fake_fstab }}"
30         state: absent
31
32     - mount:
33         name: "{{ mountdir }}/proc"
34         state: unmounted
35
36     - mount:
37         name: "{{ mountdir }}"
38         state: unmounted
39
40     - name: kpartx -dv to delete all image partition device nodes
41       command: kpartx -dv "{{ raw_imgfile }}"
42       ignore_errors: true