Skip to content

Commit

Permalink
Merge pull request #174 from lslebodn/cleanup_fix
Browse files Browse the repository at this point in the history
Do not remove .kube directory without setup_minishift
  • Loading branch information
dirgim committed Sep 10, 2020
2 parents 6232bcc + 8c3ae6c commit 447a57c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions playbooks/roles/cleanup/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
- name: "Stop minishift if running"
shell: "{{ minishift_bin }} stop --profile {{ profile }}"
ignore_errors: yes
when:
- setup_minishift|bool == true

- name: "Delete minishift profile {{ profile }}"
shell: "{{ minishift_bin }} delete --profile {{ profile }} --force"
ignore_errors: yes
when:
- setup_minishift|bool == true

- name: "Cleanup files and directories {{ minishift_dest_dir }}"
file:
Expand All @@ -20,16 +24,25 @@
- "README.adoc"
ignore_errors: yes

- name: "Cleanup certain files in {{ contra_env_setup_dir }}, kube config, and minishift profile"
- name: "Cleanup certain files in {{ contra_env_setup_dir }}"
file:
path: "{{ item }}"
state: absent
with_items:
- "{{ contra_env_setup_dir }}/.yml"
- "{{ contra_env_setup_dir }}/.yaml"
ignore_errors: yes

- name: "Cleanup certain files in kube config and minishift profile"
file:
path: "{{ item }}"
state: absent
with_items:
- "{{ ansible_env.HOME }}/.minishift/profiles/{{ profile }}"
- "{{ ansible_env.HOME }}/.kube"
ignore_errors: yes
when:
- setup_minishift|bool == true

# Determine if project directory exists
- name: "Is project repository present in {{ project_dir }}"
Expand All @@ -46,4 +59,4 @@
- "{{ contra_env_setup_dir }}/{{ project_dir }}"
when:
- pd_is_found.stat.exists
- force_repo_clone|bool == true
- force_repo_clone|bool == true

0 comments on commit 447a57c

Please sign in to comment.