-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclear_env.yml
34 lines (27 loc) · 920 Bytes
/
clear_env.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
- name: Clean the virtual environment
hosts: mlflow_env
become: yes
tasks:
- name: Delete all docker containers and images
ansible.builtin.shell: docker rm -vf $(docker ps -a -q) && docker rmi -f $(docker images -a -q)
ignore_errors: yes
- name: Shut down the remote tracking server
ansible.builtin.shell: sudo kill -9 `sudo lsof -t -i:5000`
ignore_errors: yes
- name: Unmount volume
ansible.builtin.shell: sudo umount /dev/vdb
- name: Detach the volume and shelve machine
hosts: localhost
connection: local
tasks:
- name: Detach volume
os_server_volume:
state: absent
server: mlflow_env
volume: tracking_server_storage
device: /dev/vdb
- name: Shelve mlflow_env virtual machine
openstack.cloud.server_action:
action: shelve
server: mlflow_env