From 15bcfb3e59e6e31c00e23725547f896c03c93290 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Fri, 19 Jun 2015 10:00:41 -0400 Subject: Add openshift_examples role This role installs db-templates, image-streams, and quickstart-templates into /usr/share/openshift/examples on the master and then uses `oc create` to import them. --- roles/openshift_examples/tasks/main.yml | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 roles/openshift_examples/tasks/main.yml (limited to 'roles/openshift_examples/tasks') diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml new file mode 100644 index 000000000..da8f603d7 --- /dev/null +++ b/roles/openshift_examples/tasks/main.yml @@ -0,0 +1,53 @@ +--- +- name: Copy openshift examples + synchronize: src=examples dest=/usr/share/openshift + +# RHEL and Centos image streams are mutually exclusive +- name: Import RHEL streams + command: > + {{ openshift.common.client_binary }} create -n openshift -f {{ rhel_image_streams }} + when: openshift_examples_load_rhel + register: oex_import_rhel_streams + failed_when: "'already exists' not in oex_import_rhel_streams.stderr and oex_import_rhel_streams.rc != 0" + changed_when: false + +- name: Import Centos Image streams + command: > + {{ openshift.common.client_binary }} create -n openshift -f {{ centos_image_streams }} + when: openshift_examples_load_centos | bool + register: oex_import_centos_streams + failed_when: "'already exists' not in oex_import_centos_streams.stderr and oex_import_centos_streams.rc != 0" + changed_when: false + +- name: Import db templates + command: > + {{ openshift.common.client_binary }} create -n openshift -f {{ db_templates_base }} + when: openshift_examples_load_db_templates | bool + register: oex_import_db_templates + failed_when: "'already exists' not in oex_import_db_templates.stderr and oex_import_db_templates.rc != 0" + changed_when: false + +- name: Import quickstart-templates + command: > + {{ openshift.common.client_binary }} create -n openshift -f {{ quickstarts_base }} + when: openshift_examples_load_quickstarts + register: oex_import_quickstarts + failed_when: "'already exists' not in oex_import_quickstarts.stderr and oex_import_quickstarts.rc != 0" + changed_when: false + + +- name: Import xPaas image streams + command: > + {{ openshift.common.client_binary }} create -n openshift -f {{ xpaas_image_streams }} + when: openshift_examples_load_xpaas | bool + register: oex_import_xpaas_streams + failed_when: "'already exists' not in oex_import_xpaas_streams.stderr and oex_import_xpaas_streams.rc != 0" + changed_when: false + +- name: Import xPaas templates + command: > + {{ openshift.common.client_binary }} create -n openshift -f {{ xpaas_templates_base }} + when: openshift_examples_load_xpaas | bool + register: oex_import_xpaas_templates + failed_when: "'already exists' not in oex_import_xpaas_templates.stderr and oex_import_xpaas_templates.rc != 0" + changed_when: false -- cgit v1.2.3 From 8ea29b009698e829a866c2eba80117dfe6face93 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Wed, 24 Jun 2015 14:39:42 -0700 Subject: Use copy instead of synchronize * synchronize failed for a number of users --- roles/openshift_examples/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'roles/openshift_examples/tasks') diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml index da8f603d7..bfc6dfb0a 100644 --- a/roles/openshift_examples/tasks/main.yml +++ b/roles/openshift_examples/tasks/main.yml @@ -1,6 +1,8 @@ --- - name: Copy openshift examples - synchronize: src=examples dest=/usr/share/openshift + copy: + src: examples + dest: /usr/share/openshift # RHEL and Centos image streams are mutually exclusive - name: Import RHEL streams -- cgit v1.2.3 From 44f2904159c5a3e0045eb413287a9c1778f91adb Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Thu, 10 Sep 2015 10:27:35 -0400 Subject: Upgrades --- roles/openshift_examples/tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'roles/openshift_examples/tasks') diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml index bfc6dfb0a..3a829a4c6 100644 --- a/roles/openshift_examples/tasks/main.yml +++ b/roles/openshift_examples/tasks/main.yml @@ -7,7 +7,7 @@ # RHEL and Centos image streams are mutually exclusive - name: Import RHEL streams command: > - {{ openshift.common.client_binary }} create -n openshift -f {{ rhel_image_streams }} + {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ rhel_image_streams }} when: openshift_examples_load_rhel register: oex_import_rhel_streams failed_when: "'already exists' not in oex_import_rhel_streams.stderr and oex_import_rhel_streams.rc != 0" @@ -15,7 +15,7 @@ - name: Import Centos Image streams command: > - {{ openshift.common.client_binary }} create -n openshift -f {{ centos_image_streams }} + {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ centos_image_streams }} when: openshift_examples_load_centos | bool register: oex_import_centos_streams failed_when: "'already exists' not in oex_import_centos_streams.stderr and oex_import_centos_streams.rc != 0" @@ -23,7 +23,7 @@ - name: Import db templates command: > - {{ openshift.common.client_binary }} create -n openshift -f {{ db_templates_base }} + {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ db_templates_base }} when: openshift_examples_load_db_templates | bool register: oex_import_db_templates failed_when: "'already exists' not in oex_import_db_templates.stderr and oex_import_db_templates.rc != 0" @@ -31,7 +31,7 @@ - name: Import quickstart-templates command: > - {{ openshift.common.client_binary }} create -n openshift -f {{ quickstarts_base }} + {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ quickstarts_base }} when: openshift_examples_load_quickstarts register: oex_import_quickstarts failed_when: "'already exists' not in oex_import_quickstarts.stderr and oex_import_quickstarts.rc != 0" @@ -40,7 +40,7 @@ - name: Import xPaas image streams command: > - {{ openshift.common.client_binary }} create -n openshift -f {{ xpaas_image_streams }} + {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ xpaas_image_streams }} when: openshift_examples_load_xpaas | bool register: oex_import_xpaas_streams failed_when: "'already exists' not in oex_import_xpaas_streams.stderr and oex_import_xpaas_streams.rc != 0" @@ -48,7 +48,7 @@ - name: Import xPaas templates command: > - {{ openshift.common.client_binary }} create -n openshift -f {{ xpaas_templates_base }} + {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ xpaas_templates_base }} when: openshift_examples_load_xpaas | bool register: oex_import_xpaas_templates failed_when: "'already exists' not in oex_import_xpaas_templates.stderr and oex_import_xpaas_templates.rc != 0" -- cgit v1.2.3 From 94c2ba099a87c3dc6b87f9bf916c1282a7266e45 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Thu, 8 Oct 2015 17:52:01 -0400 Subject: Adjust the logic as to when examples are deployed --- roles/openshift_examples/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'roles/openshift_examples/tasks') diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml index 3a829a4c6..ef98237cd 100644 --- a/roles/openshift_examples/tasks/main.yml +++ b/roles/openshift_examples/tasks/main.yml @@ -9,7 +9,7 @@ command: > {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ rhel_image_streams }} when: openshift_examples_load_rhel - register: oex_import_rhel_streams + register: oex_import_rhel_streams | bool failed_when: "'already exists' not in oex_import_rhel_streams.stderr and oex_import_rhel_streams.rc != 0" changed_when: false @@ -32,7 +32,7 @@ - name: Import quickstart-templates command: > {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ quickstarts_base }} - when: openshift_examples_load_quickstarts + when: openshift_examples_load_quickstarts | bool register: oex_import_quickstarts failed_when: "'already exists' not in oex_import_quickstarts.stderr and oex_import_quickstarts.rc != 0" changed_when: false -- cgit v1.2.3 From 46879ab6e7425804471a3902fda85a5085b88655 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Thu, 22 Oct 2015 10:57:05 -0400 Subject: Fix openshift_examples --- roles/openshift_examples/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/openshift_examples/tasks') diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml index ef98237cd..40b7a5d6e 100644 --- a/roles/openshift_examples/tasks/main.yml +++ b/roles/openshift_examples/tasks/main.yml @@ -9,7 +9,7 @@ command: > {{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ rhel_image_streams }} when: openshift_examples_load_rhel - register: oex_import_rhel_streams | bool + register: oex_import_rhel_streams failed_when: "'already exists' not in oex_import_rhel_streams.stderr and oex_import_rhel_streams.rc != 0" changed_when: false -- cgit v1.2.3