Initial commit
[ta/infra-ansible.git] / playbooks / cleanup-disk.yml
1 ---
2
3 # Copyright 2019 Nokia
4
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 - hosts: storage
18   become: yes
19   become_method: sudo
20   become_user: root
21   gather_facts: no
22   vars:
23     disks: "{{ devices }}"
24   tasks:
25   - include: remove_volume_groups.yml
26     when: devices is defined
27
28   - include: destroy_data_and_partitions.yml
29     when: devices is defined
30
31 - hosts: compute
32   become: yes
33   become_method: sudo
34   become_user: root
35   gather_facts: no
36   vars:
37     disks: "{{ instance_disks }}"
38   tasks:
39   - include: remove_volume_groups.yml
40     when:
41     - instance_disks is defined
42
43   - include: destroy_data_and_partitions.yml
44     when:
45     - instance_disks is defined