From 249d32dccabd7456bb38377dff6c7b4af404c890 Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Mon, 4 Jun 2018 17:01:54 -0400 Subject: [PATCH 1/7] Rework importing of os templates * Always load helper containers {linchpin,ansible}-executor * project_repo != sample_project_repo --- .../roles/os_temps/tasks/setup_containers.yml | 51 ++++--------- .../os_temps/tasks/setup_sample_proj.yml | 72 +++++++++++++++++++ 2 files changed, 84 insertions(+), 39 deletions(-) create mode 100644 playbooks/roles/os_temps/tasks/setup_sample_proj.yml diff --git a/playbooks/roles/os_temps/tasks/setup_containers.yml b/playbooks/roles/os_temps/tasks/setup_containers.yml index 1a7c231f..a203ca30 100644 --- a/playbooks/roles/os_temps/tasks/setup_containers.yml +++ b/playbooks/roles/os_temps/tasks/setup_containers.yml @@ -21,38 +21,14 @@ register: helper_os_templates when: project_repo != sample_project_repo -- name: "Get sample OpenShift s2i template names from {{ sample_os_template_dir }}/samples" - find: - paths: "{{ sample_project_dir }}/{{ sample_os_template_dir }}/samples" - patterns: '*.yml,*.yaml' - recurse: yes - register: sample_os_templates - when: (project_repo != sample_project_repo and setup_sample_project|bool == true) - -# Check if Jenkins is running -- name: "Check to see if a Jenkins Master instance is running" - shell: "{{ oc_bin }} get pods | grep -i 'running' | grep -i 'jenkins' | tail -1 | awk '{print $1}'" - register: jenkins_running - ignore_errors: yes - -- name: "Get sample jenkins OpenShift s2i template names from {{ sample_os_template_dir }}/jenkins" - find: - paths: "{{ sample_project_dir }}/{{ sample_os_template_dir }}/jenkins" - patterns: '*.yml,*.yaml' - recurse: yes - register: sample_jenkins_os_templates - when: (project_repo != sample_project_repo and setup_sample_project|bool == true and jenkins_running.stdout == "") - -- set_fact: +- name: "os_templates when project_repo == sample_project_repo" + set_fact: all_templates: "{{ os_templates.files }}" -- set_fact: +- name: "os_templates + helper_os_templates when project_repo != to sample_project_repo" + set_fact: all_templates: "{{ os_templates.files }} + {{ helper_os_templates.files }}" - when: (project_repo != sample_project_repo and setup_sample_project|bool == false) - -- set_fact: - all_templates: "{{ os_templates.files }} + {{ sample_os_templates.files }} + {{ helper_os_templates.files }} " - when: (project_repo != sample_project_repo and setup_sample_project|bool == true) + when: project_repo != sample_project_repo - debug: msg: "{{ item.path }}" @@ -71,15 +47,12 @@ # Load project_repo templates into OpenShift - include_tasks: "setup_os_templates.yml template_name={{ item.path }}.processed" - with_items: "{{ os_templates.files }}" - when: os_templates.files != "" - -# Set PARAMS to the sample ones -- set_fact: - PARAMS: "{{ SAMPLE_PARAMS }}" - when: sample_os_templates.files is defined + with_items: "{{ all_templates }}" + when: all_templates != "" -# Load project_repo templates into OpenShift -- include_tasks: "setup_os_templates.yml template_name={{ item.path }}" - with_items: "{{ sample_os_templates.files }}" +## Only run of project_repo != sample_project_repo and setup_sample_project == true +- include_tasks: "setup_sample_proj.yml" when: (project_repo != sample_project_repo and setup_sample_project|bool == true) + + + diff --git a/playbooks/roles/os_temps/tasks/setup_sample_proj.yml b/playbooks/roles/os_temps/tasks/setup_sample_proj.yml new file mode 100644 index 00000000..24a51f12 --- /dev/null +++ b/playbooks/roles/os_temps/tasks/setup_sample_proj.yml @@ -0,0 +1,72 @@ +--- +## Only run of project_repo != sample_project_repo and setup_sample_project == true +# Check if Jenkins is running +- name: "Check to see if a Jenkins Master instance is running" + shell: "{{ oc_bin }} get pods | grep -i 'running' | grep -i 'jenkins' | tail -1 | awk '{print $1}'" + register: jenkins_running + ignore_errors: yes + +## Only run if Jenkins Master is NOT present +- name: "Get sample Jenkins OpenShift s2i template names from {{ sample_os_template_dir }}/jenkins" + find: + paths: "{{ sample_project_dir }}/{{ sample_os_template_dir }}/jenkins" + patterns: '*.yml,*.yaml' + recurse: yes + register: sample_jenkins_os_templates + when: jenkins_running.stdout == "" + +- debug: + msg: "Sample OpenShift s2i Jenkins master/slave Template: {{ item.path }}" + with_items: "{{ sample_jenkins_os_templates.files }}" + when: jenkins_running.stdout == "" + +- name: "Process the sample Jenkins templates" + template: + src: "{{ item.path }}" + dest: "{{ item.path }}.processed" + with_items: "{{ sample_jenkins_os_templates.files }}" + when: jenkins_running.stdout == "" + +# Check that templates are valid +- name: "Check that sample Jenkins templates are valid" + shell: "{{ oc_bin }} process -f {{ item.path }}.processed" + with_items: "{{ sample_jenkins_os_templates.files }}" + when: jenkins_running.stdout == "" + +# Load sample_project_repo templates into OpenShift +- include_tasks: "setup_os_templates.yml template_name={{ item.path }}.processed" + with_items: "{{ sample_jenkins_os_templates.files }}" + when: jenkins_running.stdout == "" + + +## Sample project containers besides Jenkins master and slave +- name: "Get sample OpenShift s2i template names from {{ sample_os_template_dir }}/samples" + find: + paths: "{{ sample_project_dir }}/{{ sample_os_template_dir }}/samples" + patterns: '*.yml,*.yaml' + recurse: yes + register: sample_os_templates + +- debug: + msg: "Sample OpenShift s2i Template: {{ item.path }}" + with_items: "{{ sample_os_templates.files }}" + +- name: "Process the sample templates" + template: + src: "{{ item.path }}" + dest: "{{ item.path }}.processed" + with_items: "{{ sample_os_templates.files }}" + +# Check that sample templates are valid +- name: "Check that sample templates are valid" + shell: "{{ oc_bin }} process -f {{ item.path }}.processed" + with_items: "{{ sample_os_templates.files }}" + +# Set PARAMS to the sample ones +- set_fact: + PARAMS: "{{ SAMPLE_PARAMS }}" + when: sample_os_templates.files is defined + +# Load sample project_repo templates into OpenShift +- include_tasks: "setup_os_templates.yml template_name={{ item.path }}" + with_items: "{{ sample_os_templates.files }}" From 8b0095c42b9c5cac614552566796fa2862feb08d Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Mon, 4 Jun 2018 20:29:41 -0400 Subject: [PATCH 2/7] Rework importing of os templates * Always load helper containers {linchpin,ansible}-executor * project_repo != sample_project_repo * Reworked to reduce code duplication --- playbooks/group_vars/all/global.yml | 10 +++ playbooks/roles/os_temps/tasks/main.yml | 23 +++++- .../roles/os_temps/tasks/setup_containers.yml | 36 ++-------- .../os_temps/tasks/setup_sample_proj.yml | 72 ------------------- 4 files changed, 38 insertions(+), 103 deletions(-) delete mode 100644 playbooks/roles/os_temps/tasks/setup_sample_proj.yml diff --git a/playbooks/group_vars/all/global.yml b/playbooks/group_vars/all/global.yml index ec65a7c2..5201f34c 100644 --- a/playbooks/group_vars/all/global.yml +++ b/playbooks/group_vars/all/global.yml @@ -103,6 +103,16 @@ PARAMS: - key: REPO_REF val: "{{ project_branch }}" +# These are parameters that are passed to setup the helper containers in sample_project_repo +SAMPLE_HELPER_PARAMS: + - key: REPO_URL + val: "{{ sample_project_repo }}" + - key: REPO_REF + val: "{{ sample_project_branch }}" + +# These are parameters that are passed to setup the Jenkins master/slave containers in sample_project_repo +SAMPLE_JENKINS_PARAMS: "{{ SAMPLE_HELPER_CONTAINERS }}" + # These are parameters that are passed to setup the containers from the sample_project_repo SAMPLE_PARAMS: - key: REPO_URL diff --git a/playbooks/roles/os_temps/tasks/main.yml b/playbooks/roles/os_temps/tasks/main.yml index f12444a8..c10dc71b 100644 --- a/playbooks/roles/os_temps/tasks/main.yml +++ b/playbooks/roles/os_temps/tasks/main.yml @@ -37,10 +37,29 @@ import_tasks: "{{ playbook_dir }}/roles/prereqs/tasks/install_virtual_reqs.yml" when: setup_minishift|bool == true -# setup_containers.yml -- import_tasks: setup_containers.yml +# Setup project_repo containers +- import_tasks: "setup_containers.yml os_template_path={{ project_dir }}/{{ os_template_dir }}" when: setup_containers|bool == true +# Setup sample_project_repo helper containers +- import_tasks: "setup_containers.yml os_template_path={{ helper_project_dir }}/{{ helper_os_template_dir }}/helper PARAMS={{ SAMPLE_HELPER_PARAMS }}" + when: setup_containers|bool == true + when: (setup_containers|bool == true and project_repo != sample_project_repo) + +# Check if Jenkins is running +- name: "Check to see if a Jenkins Master instance is running" + shell: "{{ oc_bin }} get pods | grep -i 'running' | grep -i 'jenkins' | tail -1 | awk '{print $1}'" + register: jenkins_running + ignore_errors: yes + +# Setup sample_project_repo Jenkins master/slave sample containers +- import_tasks: "setup_containers.yml os_template_path={{ sample_project_dir }}/{{ sample_os_template_dir }}/jenkins PARAMS={{ SAMPLE_JENKINS_PARAMS }}" + when: (setup_containers|bool == true and project_repo != sample_project_repo and setup_sample_project|bool == true and jenkins_running.stdout == "") + +# Setup sample_project_repo sample containers +- import_tasks: "setup_containers.yml os_template_path={{ sample_project_dir }}/{{ sample_os_template_dir }}/samples PARAMS={{ SAMPLE_PARAMS }}" + when: (setup_containers|bool == true and project_repo != sample_project_repo and setup_sample_project|bool == true) + # Add security context constraints - import_tasks: add_scc.yml when: modify_scc|bool == true \ No newline at end of file diff --git a/playbooks/roles/os_temps/tasks/setup_containers.yml b/playbooks/roles/os_temps/tasks/setup_containers.yml index a203ca30..322894ce 100644 --- a/playbooks/roles/os_temps/tasks/setup_containers.yml +++ b/playbooks/roles/os_temps/tasks/setup_containers.yml @@ -6,53 +6,31 @@ container_config_name: "OpenShift s2i templates" # Use the repo's OpenShift s2i templates as the list to process -- name: "Get OpenShift s2i template names from {{ os_template_dir }}" +- name: "Get OpenShift s2i template names from {{ os_template_path }}" find: - paths: "{{ project_dir }}/{{ os_template_dir }}" + paths: "{{ os_template_path }}" patterns: '*.yml,*.yaml' recurse: yes register: os_templates -- name: "Get helper OpenShift s2i template names from {{ helper_os_template_dir }}/helper" - find: - paths: "{{ helper_project_dir }}/{{ helper_os_template_dir }}/helper" - patterns: '*.yml,*.yaml' - recurse: yes - register: helper_os_templates - when: project_repo != sample_project_repo - -- name: "os_templates when project_repo == sample_project_repo" - set_fact: - all_templates: "{{ os_templates.files }}" - -- name: "os_templates + helper_os_templates when project_repo != to sample_project_repo" - set_fact: - all_templates: "{{ os_templates.files }} + {{ helper_os_templates.files }}" - when: project_repo != sample_project_repo - - debug: msg: "{{ item.path }}" - with_items: "{{ all_templates }}" + with_items: "{{ os_templates.files }}" - name: "Process the templates" template: src: "{{ item.path }}" dest: "{{ item.path }}.processed" - with_items: "{{ all_templates }}" + with_items: "{{ os_templates.files }}" # Check that templates are valid - name: "Check that templates are valid" shell: "{{ oc_bin }} process -f {{ item.path }}.processed" - with_items: "{{ all_templates }}" + with_items: "{{ os_templates.files }}" # Load project_repo templates into OpenShift - include_tasks: "setup_os_templates.yml template_name={{ item.path }}.processed" - with_items: "{{ all_templates }}" - when: all_templates != "" - -## Only run of project_repo != sample_project_repo and setup_sample_project == true -- include_tasks: "setup_sample_proj.yml" - when: (project_repo != sample_project_repo and setup_sample_project|bool == true) - + with_items: "{{ os_templates.files }}" + when: os_templates.files != "" diff --git a/playbooks/roles/os_temps/tasks/setup_sample_proj.yml b/playbooks/roles/os_temps/tasks/setup_sample_proj.yml deleted file mode 100644 index 24a51f12..00000000 --- a/playbooks/roles/os_temps/tasks/setup_sample_proj.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -## Only run of project_repo != sample_project_repo and setup_sample_project == true -# Check if Jenkins is running -- name: "Check to see if a Jenkins Master instance is running" - shell: "{{ oc_bin }} get pods | grep -i 'running' | grep -i 'jenkins' | tail -1 | awk '{print $1}'" - register: jenkins_running - ignore_errors: yes - -## Only run if Jenkins Master is NOT present -- name: "Get sample Jenkins OpenShift s2i template names from {{ sample_os_template_dir }}/jenkins" - find: - paths: "{{ sample_project_dir }}/{{ sample_os_template_dir }}/jenkins" - patterns: '*.yml,*.yaml' - recurse: yes - register: sample_jenkins_os_templates - when: jenkins_running.stdout == "" - -- debug: - msg: "Sample OpenShift s2i Jenkins master/slave Template: {{ item.path }}" - with_items: "{{ sample_jenkins_os_templates.files }}" - when: jenkins_running.stdout == "" - -- name: "Process the sample Jenkins templates" - template: - src: "{{ item.path }}" - dest: "{{ item.path }}.processed" - with_items: "{{ sample_jenkins_os_templates.files }}" - when: jenkins_running.stdout == "" - -# Check that templates are valid -- name: "Check that sample Jenkins templates are valid" - shell: "{{ oc_bin }} process -f {{ item.path }}.processed" - with_items: "{{ sample_jenkins_os_templates.files }}" - when: jenkins_running.stdout == "" - -# Load sample_project_repo templates into OpenShift -- include_tasks: "setup_os_templates.yml template_name={{ item.path }}.processed" - with_items: "{{ sample_jenkins_os_templates.files }}" - when: jenkins_running.stdout == "" - - -## Sample project containers besides Jenkins master and slave -- name: "Get sample OpenShift s2i template names from {{ sample_os_template_dir }}/samples" - find: - paths: "{{ sample_project_dir }}/{{ sample_os_template_dir }}/samples" - patterns: '*.yml,*.yaml' - recurse: yes - register: sample_os_templates - -- debug: - msg: "Sample OpenShift s2i Template: {{ item.path }}" - with_items: "{{ sample_os_templates.files }}" - -- name: "Process the sample templates" - template: - src: "{{ item.path }}" - dest: "{{ item.path }}.processed" - with_items: "{{ sample_os_templates.files }}" - -# Check that sample templates are valid -- name: "Check that sample templates are valid" - shell: "{{ oc_bin }} process -f {{ item.path }}.processed" - with_items: "{{ sample_os_templates.files }}" - -# Set PARAMS to the sample ones -- set_fact: - PARAMS: "{{ SAMPLE_PARAMS }}" - when: sample_os_templates.files is defined - -# Load sample project_repo templates into OpenShift -- include_tasks: "setup_os_templates.yml template_name={{ item.path }}" - with_items: "{{ sample_os_templates.files }}" From 01313141e64298af19828e26e656a98d72678f76 Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Mon, 4 Jun 2018 21:13:39 -0400 Subject: [PATCH 3/7] Rework importing of os templates * Always load helper containers {linchpin,ansible}-executor * project_repo != sample_project_repo * Reworked to reduce code duplication --- playbooks/roles/os_temps/tasks/main.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/playbooks/roles/os_temps/tasks/main.yml b/playbooks/roles/os_temps/tasks/main.yml index c10dc71b..1e663a82 100644 --- a/playbooks/roles/os_temps/tasks/main.yml +++ b/playbooks/roles/os_temps/tasks/main.yml @@ -38,12 +38,11 @@ when: setup_minishift|bool == true # Setup project_repo containers -- import_tasks: "setup_containers.yml os_template_path={{ project_dir }}/{{ os_template_dir }}" +- include_tasks: "setup_containers.yml os_template_path={{ project_dir }}/{{ os_template_dir }}" when: setup_containers|bool == true # Setup sample_project_repo helper containers -- import_tasks: "setup_containers.yml os_template_path={{ helper_project_dir }}/{{ helper_os_template_dir }}/helper PARAMS={{ SAMPLE_HELPER_PARAMS }}" - when: setup_containers|bool == true +- include_tasks: "setup_containers.yml os_template_path={{ helper_project_dir }}/{{ helper_os_template_dir }}/helper PARAMS={{ SAMPLE_HELPER_PARAMS }}" when: (setup_containers|bool == true and project_repo != sample_project_repo) # Check if Jenkins is running @@ -53,11 +52,11 @@ ignore_errors: yes # Setup sample_project_repo Jenkins master/slave sample containers -- import_tasks: "setup_containers.yml os_template_path={{ sample_project_dir }}/{{ sample_os_template_dir }}/jenkins PARAMS={{ SAMPLE_JENKINS_PARAMS }}" +- include_tasks: "setup_containers.yml os_template_path={{ sample_project_dir }}/{{ sample_os_template_dir }}/jenkins PARAMS={{ SAMPLE_JENKINS_PARAMS }}" when: (setup_containers|bool == true and project_repo != sample_project_repo and setup_sample_project|bool == true and jenkins_running.stdout == "") # Setup sample_project_repo sample containers -- import_tasks: "setup_containers.yml os_template_path={{ sample_project_dir }}/{{ sample_os_template_dir }}/samples PARAMS={{ SAMPLE_PARAMS }}" +- include_tasks: "setup_containers.yml os_template_path={{ sample_project_dir }}/{{ sample_os_template_dir }}/samples PARAMS={{ SAMPLE_PARAMS }}" when: (setup_containers|bool == true and project_repo != sample_project_repo and setup_sample_project|bool == true) # Add security context constraints From c47a7307a0ed41fef086b05e413e372c2ed6e52a Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Tue, 5 Jun 2018 15:10:08 -0400 Subject: [PATCH 4/7] Rework importing of os templates * Always load helper containers {linchpin,ansible}-executor * project_repo != sample_project_repo * Reworked to reduce code duplication * Added switch to project shell command before making changes to the current project --- playbooks/roles/os_temps/tasks/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/playbooks/roles/os_temps/tasks/main.yml b/playbooks/roles/os_temps/tasks/main.yml index 1e663a82..3ed97318 100644 --- a/playbooks/roles/os_temps/tasks/main.yml +++ b/playbooks/roles/os_temps/tasks/main.yml @@ -11,6 +11,12 @@ import_tasks: install_oc_bin.yml when: setup_minishift|bool == false +# Switch to right OpenShift project defined in {{ {{ openshift_project }}" }} +- name: "Switch to project {{ openshift_project }}" + shell: "{{ oc_bin }} project {{ openshift_project }}" + register: cluster_ip_register + when: openshift_cluster_ip == "" + # Get ip of the cluster unless it was provided - name: "Get the cluster Server URL for project {{ openshift_project }}" shell: "{{ oc_bin }} status | egrep '{{ openshift_project }}.*server' | awk '{print $NF}'" From 84693ccf51d1061b5d868ca7ba4fcd36300bc4cc Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Tue, 5 Jun 2018 15:14:21 -0400 Subject: [PATCH 5/7] Rework importing of os templates * Always load helper containers {linchpin,ansible}-executor * project_repo != sample_project_repo * Reworked to reduce code duplication * Added switch to project shell command before making changes to the current project * fixed issue - remvoed when and register --- playbooks/roles/os_temps/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/playbooks/roles/os_temps/tasks/main.yml b/playbooks/roles/os_temps/tasks/main.yml index 3ed97318..9e1ac037 100644 --- a/playbooks/roles/os_temps/tasks/main.yml +++ b/playbooks/roles/os_temps/tasks/main.yml @@ -14,8 +14,6 @@ # Switch to right OpenShift project defined in {{ {{ openshift_project }}" }} - name: "Switch to project {{ openshift_project }}" shell: "{{ oc_bin }} project {{ openshift_project }}" - register: cluster_ip_register - when: openshift_cluster_ip == "" # Get ip of the cluster unless it was provided - name: "Get the cluster Server URL for project {{ openshift_project }}" From 2938dd2156f719e7cda668096e8453447896cd0d Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Tue, 5 Jun 2018 18:12:35 -0400 Subject: [PATCH 6/7] Rework importing of os templates * Always load helper containers {linchpin,ansible}-executor * project_repo != sample_project_repo * Reworked to reduce code duplication * Remove switch to project we already do that --- playbooks/roles/os_temps/tasks/main.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/playbooks/roles/os_temps/tasks/main.yml b/playbooks/roles/os_temps/tasks/main.yml index 9e1ac037..1a9d73c9 100644 --- a/playbooks/roles/os_temps/tasks/main.yml +++ b/playbooks/roles/os_temps/tasks/main.yml @@ -11,13 +11,9 @@ import_tasks: install_oc_bin.yml when: setup_minishift|bool == false -# Switch to right OpenShift project defined in {{ {{ openshift_project }}" }} -- name: "Switch to project {{ openshift_project }}" - shell: "{{ oc_bin }} project {{ openshift_project }}" - # Get ip of the cluster unless it was provided - name: "Get the cluster Server URL for project {{ openshift_project }}" - shell: "{{ oc_bin }} status | egrep '{{ openshift_project }}.*server' | awk '{print $NF}'" + shell: "{{ oc_bin }} status | grep 'https' | awk '{print $NF}'" register: cluster_ip_register when: openshift_cluster_ip == "" From 5c74fcf3ba67c460399c719e5c8fd649b94d498e Mon Sep 17 00:00:00 2001 From: Ari LiVigni Date: Wed, 6 Jun 2018 09:16:20 -0400 Subject: [PATCH 7/7] Rework importing of os templates * Always load helper containers {linchpin,ansible}-executor * project_repo != sample_project_repo * Reworked to reduce code duplication * Remove switch to project we already do that * Narrow match with head -1 --- playbooks/roles/os_temps/tasks/get_set_project.yml | 6 +----- playbooks/roles/os_temps/tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/playbooks/roles/os_temps/tasks/get_set_project.yml b/playbooks/roles/os_temps/tasks/get_set_project.yml index 511fe983..39e0c1ea 100644 --- a/playbooks/roles/os_temps/tasks/get_set_project.yml +++ b/playbooks/roles/os_temps/tasks/get_set_project.yml @@ -11,8 +11,4 @@ when: project_query.stdout == "" - name: add-role-to-user - shell: "{{ oc_bin }} policy add-role-to-user edit -z default -n '{{ openshift_project }}'" - - - - + shell: "{{ oc_bin }} policy add-role-to-user edit -z default -n '{{ openshift_project }}'" \ No newline at end of file diff --git a/playbooks/roles/os_temps/tasks/main.yml b/playbooks/roles/os_temps/tasks/main.yml index 1a9d73c9..4af9e927 100644 --- a/playbooks/roles/os_temps/tasks/main.yml +++ b/playbooks/roles/os_temps/tasks/main.yml @@ -13,7 +13,7 @@ # Get ip of the cluster unless it was provided - name: "Get the cluster Server URL for project {{ openshift_project }}" - shell: "{{ oc_bin }} status | grep 'https' | awk '{print $NF}'" + shell: "{{ oc_bin }} status | grep 'https' | awk '{print $NF}' | head -1" register: cluster_ip_register when: openshift_cluster_ip == ""