container-storage-setup.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. - block:
  3. - name: create the docker-storage config file
  4. template:
  5. src: docker-storage-setup-overlayfs.j2
  6. dest: /etc/sysconfig/docker-storage-setup
  7. owner: root
  8. group: root
  9. mode: 0644
  10. when:
  11. - ansible_distribution_version is version('7.4', '>=')
  12. - ansible_distribution == "RedHat"
  13. - block:
  14. - name: create the docker-storage-setup config file
  15. template:
  16. src: docker-storage-setup-dm.j2
  17. dest: /etc/sysconfig/docker-storage-setup
  18. owner: root
  19. group: root
  20. mode: 0644
  21. when:
  22. - ansible_distribution_version is version('7.4', '<')
  23. - ansible_distribution == "RedHat"
  24. - block:
  25. - name: create the docker-storage-setup config file for CentOS
  26. template:
  27. src: docker-storage-setup-dm.j2
  28. dest: /etc/sysconfig/docker-storage-setup
  29. owner: root
  30. group: root
  31. mode: 0644
  32. # TODO(shadower): Find out which CentOS version supports overlayfs2
  33. when:
  34. - ansible_distribution == "CentOS"
  35. - name: restart docker after storage configuration
  36. become: yes
  37. systemd:
  38. name: "{{ openshift_docker_service_name }}"
  39. state: restarted
  40. register: l_docker_restart_docker_in_storage_setup_result
  41. until: not (l_docker_restart_docker_in_storage_setup_result is failed)
  42. retries: 3
  43. delay: 30
  44. when: not openshift_use_crio_only|default(None)