summaryrefslogtreecommitdiffstats
path: root/roles/container_runtime/tasks/common/setup_docker_symlink.yml
blob: d7aeb192eb20ddcc3412ca874659fce0e1d56cc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
- block:
    - name: stop the current running docker
      systemd:
        state: stopped
        name: "{{ openshift_docker_service_name }}"

    - name: copy "{{ docker_default_storage_path }}" to "{{ docker_alt_storage_path }}"
      command: "cp -r {{ docker_default_storage_path }} {{ docker_alt_storage_path }}"
      register: results
      failed_when:
        - results.rc != 0

    - name: "Set the selinux context on {{ docker_alt_storage_path }}"
      command: "semanage fcontext -a -e {{ docker_default_storage_path }} {{ docker_alt_storage_path }}"
      register: results
      failed_when:
        - results.rc == 1
        - "'already exists' not in results.stderr"

    - name: "restorecon the {{ docker_alt_storage_path }}"
      command: "restorecon -r {{ docker_alt_storage_path }}"

    - name: Remove the old docker location
      file:
        state: absent
        path: "{{ docker_default_storage_path }}"

    - name: Setup the link
      file:
        state: link
        src: "{{ docker_alt_storage_path }}"
        path: "{{ docker_default_storage_path }}"

    - name: start docker
      systemd:
        state: started
        name: "{{ openshift_docker_service_name }}"