summaryrefslogtreecommitdiffstats
path: root/roles/openshift_examples
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-07-19 14:10:43 -0400
committerGitHub <noreply@github.com>2016-07-19 14:10:43 -0400
commit4b6d7cfad66e2b5fd3bd1ecb340604b3bda40363 (patch)
treec490269923329517caa82d3228fa11867531a75d /roles/openshift_examples
parent3b9c6afe1684c0c9be6dd1c3a12c493c85c38751 (diff)
parent9967c0a34a673a64966ac2b3fbba929e5efab9bf (diff)
downloadopenshift-4b6d7cfad66e2b5fd3bd1ecb340604b3bda40363.tar.gz
openshift-4b6d7cfad66e2b5fd3bd1ecb340604b3bda40363.tar.bz2
openshift-4b6d7cfad66e2b5fd3bd1ecb340604b3bda40363.tar.xz
openshift-4b6d7cfad66e2b5fd3bd1ecb340604b3bda40363.zip
Merge pull request #2176 from tbielawa/respeedy
We have proper ansible support and requirements in place now, de-reveā€¦
Diffstat (limited to 'roles/openshift_examples')
-rw-r--r--roles/openshift_examples/tasks/main.yml43
1 files changed, 40 insertions, 3 deletions
diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml
index 7ea39f51e..8d2248578 100644
--- a/roles/openshift_examples/tasks/main.yml
+++ b/roles/openshift_examples/tasks/main.yml
@@ -1,9 +1,46 @@
---
-- name: Copy openshift examples
- copy:
- src: "examples/{{ content_version }}/"
+######################################################################
+# Copying Examples
+#
+# We used to use the copy module to transfer the openshift examples to
+# the remote. Then it started taking more than a minute to transfer
+# the files. As noted in the module:
+#
+# "The 'copy' module recursively copy facility does not scale to
+# lots (>hundreds) of files."
+#
+# The `synchronize` module is suggested as an alternative, we can't
+# use it either due to changes introduced in Ansible 2.x.
+- name: Create local temp dir for OpenShift examples copy
+ local_action: command mktemp -d /tmp/openshift-ansible-XXXXXXX
+ become: False
+ register: copy_examples_mktemp
+ run_once: True
+
+- name: Create tar of OpenShift examples
+ local_action: command tar -C "{{ role_path }}/files/examples/{{ content_version }}/" -cvf "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar" .
+ become: False
+ register: copy_examples_tar
+
+- name: Create the remote OpenShift examples directory
+ file:
+ dest: "{{ examples_base }}"
+ state: directory
+ mode: 0755
+
+- name: Unarchive the OpenShift examples on the remote
+ unarchive:
+ src: "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar"
dest: "{{ examples_base }}/"
+- name: Cleanup the OpenShift Examples temp dir
+ become: False
+ local_action: file dest="{{ copy_examples_mktemp.stdout }}" state=absent
+
+# Done copying examples
+######################################################################
+# Begin image streams
+
- name: Modify registry paths if registry_url is not registry.access.redhat.com
shell: >
find {{ examples_base }} -type f | xargs -n 1 sed -i 's|registry.access.redhat.com|{{ registry_host | quote }}|g'