Update stor4nfv install scripts according to opensds aruba release
[stor4nfv.git] / ci / ansible / roles / cleaner / tasks / main.yml
1 # Copyright (c) 2018 Huawei Technologies Co., Ltd. All Rights Reserved.\r
2 #\r
3 # Licensed under the Apache License, Version 2.0 (the "License");\r
4 # you may not use this file except in compliance with the License.\r
5 # You may obtain a copy of the License at\r
6 #\r
7 #     http://www.apache.org/licenses/LICENSE-2.0\r
8 #\r
9 # Unless required by applicable law or agreed to in writing, software\r
10 # distributed under the License is distributed on an "AS IS" BASIS,\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
12 # See the License for the specific language governing permissions and\r
13 # limitations under the License.\r
14 \r
15 - name: kill osdslet daemon service\r
16   shell: killall osdslet osdsdock\r
17   when: container_enabled == false\r
18   ignore_errors: true\r
19 \r
20 - name: kill osdslet containerized service\r
21   docker_container:\r
22     name: osdslet\r
23     image: "{{ controller_docker_image }}"\r
24     state: stopped\r
25   when: container_enabled == true\r
26 \r
27 - name: kill osdsdock containerized service\r
28   docker_container:\r
29     name: osdsdock\r
30     image: "{{ dock_docker_image }}"\r
31     state: stopped\r
32   when: container_enabled == true\r
33 \r
34 - name: stop container where dashboard is located\r
35   docker_container:\r
36     name: dashboard\r
37     image: "{{ dashboard_docker_image }}"\r
38     state: stopped\r
39   when: dashboard_installation_type == "container"\r
40 \r
41 - name: clean opensds flexvolume plugins binary file if flexvolume specified\r
42   file:\r
43     path: "{{ flexvolume_plugin_dir }}"\r
44     state: absent\r
45     force: yes\r
46   ignore_errors: yes\r
47   when: nbp_plugin_type == "flexvolume"\r
48 \r
49 - name: clean opensds csi plugin if csi plugin specified\r
50   shell: |\r
51     . /etc/profile\r
52     kubectl delete -f deploy/kubernetes\r
53   args:\r
54     chdir: "{{ nbp_work_dir }}/csi"\r
55   ignore_errors: yes\r
56   when: nbp_plugin_type == "csi"\r
57 \r
58 - name: clean all configuration and log files in opensds and nbp work directory\r
59   file:\r
60     path: "{{ item }}"\r
61     state: absent\r
62     force: yes\r
63   with_items:\r
64     - "{{ opensds_work_dir }}"\r
65     - "{{ nbp_work_dir }}"\r
66     - "{{ opensds_config_dir }}"\r
67     - "{{ opensds_log_dir }}"\r
68   ignore_errors: yes\r
69 \r
70 - name: include scenarios/auth-keystone.yml when specifies keystone\r
71   include_tasks: scenarios/auth-keystone.yml\r
72   when: opensds_auth_strategy == "keystone"\r
73 \r
74 - name: include scenarios/repository.yml if installed from repository\r
75   include_tasks: scenarios/repository.yml\r
76   when: install_from == "repository" or dashboard_installation_type == "source_code"\r
77 \r
78 - name: include scenarios/release.yml if installed from release\r
79   include_tasks: scenarios/release.yml\r
80   when: install_from == "release"\r
81 \r
82 - name: include scenarios/backend.yml for cleaning up storage backend service\r
83   include_tasks: scenarios/backend.yml\r