setup_docker_symlink.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ---
  2. - block:
  3. - name: stop the current running docker
  4. systemd:
  5. state: stopped
  6. name: "{{ openshift_docker_service_name }}"
  7. - name: copy "{{ docker_default_storage_path }}" to "{{ docker_alt_storage_path }}"
  8. command: "cp -r {{ docker_default_storage_path }} {{ docker_alt_storage_path }}"
  9. register: results
  10. failed_when:
  11. - results.rc != 0
  12. - name: "Set the selinux context on {{ docker_alt_storage_path }}"
  13. command: "semanage fcontext -a -e {{ docker_default_storage_path }} {{ docker_alt_storage_path }}"
  14. register: results
  15. failed_when:
  16. - results.rc == 1
  17. - "'already exists' not in results.stderr"
  18. - name: "restorecon the {{ docker_alt_storage_path }}"
  19. command: "restorecon -r {{ docker_alt_storage_path }}"
  20. - name: Remove the old docker location
  21. file:
  22. state: absent
  23. path: "{{ docker_default_storage_path }}"
  24. - name: Setup the link
  25. file:
  26. state: link
  27. src: "{{ docker_alt_storage_path }}"
  28. path: "{{ docker_default_storage_path }}"
  29. - name: start docker
  30. systemd:
  31. state: started
  32. name: "{{ openshift_docker_service_name }}"