You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.1 KiB

  1. ---
  2. - name: Cri-o | load vars
  3. import_tasks: load_vars.yml
  4. - name: CRI-O | Kubic repo name for debian os family
  5. set_fact:
  6. crio_kubic_debian_repo_name: "{{ ((ansible_distribution == 'Ubuntu') | ternary('x', '')) ~ ansible_distribution ~ '_' ~ ansible_distribution_version }}"
  7. when: ansible_os_family == "Debian"
  8. tags:
  9. - reset_crio
  10. - name: CRI-O | Remove kubic apt repo
  11. apt_repository:
  12. repo: "deb http://{{ crio_download_base }}/{{ crio_kubic_debian_repo_name }}/ /"
  13. state: absent
  14. when: crio_kubic_debian_repo_name is defined
  15. tags:
  16. - reset_crio
  17. - name: CRI-O | Remove cri-o apt repo
  18. apt_repository:
  19. repo: "deb {{ crio_download_crio }}{{ crio_version }}/{{ crio_kubic_debian_repo_name }}/ /"
  20. state: absent
  21. filename: devel-kubic-libcontainers-stable-cri-o
  22. when: crio_kubic_debian_repo_name is defined
  23. tags:
  24. - reset_crio
  25. - name: CRI-O | Remove CRI-O kubic yum repo
  26. yum_repository:
  27. name: devel_kubic_libcontainers_stable
  28. state: absent
  29. when: ansible_distribution in ["Amazon"]
  30. tags:
  31. - reset_crio
  32. - name: CRI-O | Remove CRI-O kubic yum repo
  33. yum_repository:
  34. name: "devel_kubic_libcontainers_stable_cri-o_{{ crio_version }}"
  35. state: absent
  36. when:
  37. - ansible_os_family == "RedHat"
  38. - ansible_distribution not in ["Amazon", "Fedora"]
  39. tags:
  40. - reset_crio
  41. - name: CRI-O | Run yum-clean-metadata
  42. command: yum clean metadata
  43. when:
  44. - ansible_os_family == "RedHat"
  45. tags:
  46. - reset_crio
  47. - name: CRI-O | Remove crictl
  48. file:
  49. name: "{{ item }}"
  50. state: absent
  51. loop:
  52. - /etc/crictl.yaml
  53. - "{{ bin_dir }}/crictl"
  54. tags:
  55. - reset_crio
  56. - name: CRI-O | Stop crio service
  57. service:
  58. name: crio
  59. daemon_reload: true
  60. enabled: false
  61. state: stopped
  62. tags:
  63. - reset_crio
  64. - name: CRI-O | Remove CRI-O configuration files
  65. file:
  66. name: "{{ item }}"
  67. state: absent
  68. loop:
  69. - /etc/crio
  70. - /etc/containers
  71. - /etc/systemd/system/crio.service.d
  72. tags:
  73. - reset_crio
  74. - name: CRI-O | Remove CRI-O binaries
  75. file:
  76. name: "{{ item }}"
  77. state: absent
  78. with_items: "{{ crio_bin_files }}"
  79. tags:
  80. - reset_crio