Update the latest version of ansible script
[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: install_from != "container"\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: install_from == "container"\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: install_from == "container"\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 external provisioner plugin if flexvolume specified\r
50   shell: |\r
51     . /etc/profile\r
52     kubectl delete -f deploy/\r
53   args:\r
54     chdir: "{{ nbp_work_dir }}/provisioner"\r
55   ignore_errors: yes\r
56   when: nbp_plugin_type == "flexvolume"\r
57 \r
58 - name: clean opensds csi plugin if csi plugin specified\r
59   shell: |\r
60     . /etc/profile\r
61     kubectl delete -f deploy/kubernetes\r
62   args:\r
63     chdir: "{{ nbp_work_dir }}/csi"\r
64   ignore_errors: yes\r
65   when: nbp_plugin_type == "csi"\r
66 \r
67 - name: clean all configuration and log files in opensds and nbp work directory\r
68   file:\r
69     path: "{{ item }}"\r
70     state: absent\r
71     force: yes\r
72   with_items:\r
73     - "{{ opensds_work_dir }}"\r
74     - "{{ nbp_work_dir }}"\r
75     - "{{ opensds_config_dir }}"\r
76     - "{{ opensds_log_dir }}"\r
77   ignore_errors: yes\r
78 \r
79 - name: include scenarios/auth-keystone.yml when specifies keystone\r
80   include_tasks: scenarios/auth-keystone.yml\r
81   when: opensds_auth_strategy == "keystone"\r
82 \r
83 - name: include scenarios/repository.yml if installed from repository\r
84   include_tasks: scenarios/repository.yml\r
85   when: install_from == "repository" or dashboard_installation_type == "source_code"\r
86 \r
87 - name: include scenarios/release.yml if installed from release\r
88   include_tasks: scenarios/release.yml\r
89   when: install_from == "release"\r
90 \r
91 - name: include scenarios/backend.yml for cleaning up storage backend service\r
92   include_tasks: scenarios/backend.yml\r