Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 1 | --- |
| 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 Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 9 | project_src: "{{ head_cord_profile_dir }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 10 | 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 Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 25 | path: "{{ head_cord_profile_dir }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 26 | state: absent |
| 27 | ignore_errors: yes |
Andy Bavier | 0792988 | 2017-03-26 13:21:30 -0400 | [diff] [blame] | 28 | when: delete_cord_profile_dir |