uninstall_docker.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # This deletes *ALL* Origin and OpenShift Container Platform content installed by
  2. # ansible. This includes:
  3. #
  4. # configuration
  5. # containers
  6. # example templates and imagestreams
  7. # images
  8. # RPMs
  9. ---
  10. - hosts: OSEv3:children
  11. become: yes
  12. tasks:
  13. - name: Detecting Operating System
  14. shell: ls /run/ostree-booted
  15. ignore_errors: yes
  16. failed_when: false
  17. register: ostree_output
  18. # Since we're not calling openshift_facts we'll do this for now
  19. - set_fact:
  20. openshift_is_atomic: "{{ ostree_output.rc == 0 }}"
  21. - hosts: nodes:masters
  22. become: yes
  23. tasks:
  24. - name: Stop docker service
  25. service:
  26. name: docker
  27. state: stopped
  28. enabled: no
  29. failed_when: false
  30. register: l_docker_restart_docker_in_pb_result
  31. until: not (l_docker_restart_docker_in_pb_result is failed)
  32. retries: 3
  33. delay: 30
  34. - name: Reset docker-storage-setup
  35. shell: docker-storage-setup --reset
  36. failed_when: False
  37. - name: rm -rf docker config files
  38. shell: "rm {{ item }} -rf"
  39. failed_when: False
  40. with_items:
  41. - /etc/docker*
  42. - /etc/sysconfig/docker*
  43. - /etc/systemd/system/docker*