blob: 365c087fd65035c565536e58540b454989dbf061 [file] [log] [blame]
Zack Williamsa2763112017-01-03 11:38:38 -07001---
2# teardown-profile/tasks/main.yml
3# Destroys the currently created profile
4# NOTE: ignoring errors so that incomplete builds can be removed
5
6- name: Stop and remove XOS containers
7 docker_service:
8 project_name: "{{ cord_profile | regex_replace('\\W','') }}"
Zack Williamsc989f262017-05-11 13:02:59 -07009 project_src: "{{ head_cord_profile_dir }}"
Zack Williamsa2763112017-01-03 11:38:38 -070010 state: absent
11 remove_images: local
12 ignore_errors: yes
13
14# need to remove images using docker_images here?
15
16- name: Remove docker networks
17 docker_network:
18 name: "{{ item }}"
19 state: absent
20 with_items: "{{ xos_docker_networks }}"
21 ignore_errors: yes
22
23- name: Remove the cord_profile directory
24 file:
Zack Williamsc989f262017-05-11 13:02:59 -070025 path: "{{ head_cord_profile_dir }}"
Zack Williamsa2763112017-01-03 11:38:38 -070026 state: absent
27 ignore_errors: yes
Andy Bavier07929882017-03-26 13:21:30 -040028 when: delete_cord_profile_dir