summaryrefslogtreecommitdiffstats
path: root/roles/container_runtime/tasks/common/setup_docker_symlink.yml
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2017-12-05 15:14:49 -0500
committerMichael Gugino <mgugino@redhat.com>2017-12-07 09:25:31 -0500
commit2249ba3d08d1e6c55bf008609c9e4eace16bd917 (patch)
tree849e51214d2bd93e3fe8f9f4537d8f843416d4d8 /roles/container_runtime/tasks/common/setup_docker_symlink.yml
parent4bcb53654635de775c60d0176e3aeeed4856fc86 (diff)
downloadopenshift-2249ba3d08d1e6c55bf008609c9e4eace16bd917.tar.gz
openshift-2249ba3d08d1e6c55bf008609c9e4eace16bd917.tar.bz2
openshift-2249ba3d08d1e6c55bf008609c9e4eace16bd917.tar.xz
openshift-2249ba3d08d1e6c55bf008609c9e4eace16bd917.zip
Implement container_runtime playbooks and changes
This commit refactors some duplicate code, removes usage of set_fact where not needed, and reorganizes container_runtime role to use include_role.
Diffstat (limited to 'roles/container_runtime/tasks/common/setup_docker_symlink.yml')
-rw-r--r--roles/container_runtime/tasks/common/setup_docker_symlink.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/roles/container_runtime/tasks/common/setup_docker_symlink.yml b/roles/container_runtime/tasks/common/setup_docker_symlink.yml
new file mode 100644
index 000000000..d7aeb192e
--- /dev/null
+++ b/roles/container_runtime/tasks/common/setup_docker_symlink.yml
@@ -0,0 +1,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 }}"