summaryrefslogtreecommitdiffstats
path: root/roles/openshift_master/tasks
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-02-12 10:27:03 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2016-02-12 10:27:03 -0500
commit77ca4cdafdda5df48467b85d5ae1469c36d0fff4 (patch)
treef637720a0e8845ce1eef69b1f9a0d7e5e17b0f4c /roles/openshift_master/tasks
parent2fd931794bf82cf3e11ad9267df9e0885dde7b1d (diff)
parent81345f2ee5365708a3895f182645c42f2ee0efac (diff)
downloadopenshift-77ca4cdafdda5df48467b85d5ae1469c36d0fff4.tar.gz
openshift-77ca4cdafdda5df48467b85d5ae1469c36d0fff4.tar.bz2
openshift-77ca4cdafdda5df48467b85d5ae1469c36d0fff4.tar.xz
openshift-77ca4cdafdda5df48467b85d5ae1469c36d0fff4.zip
Merge pull request #1362 from detiber/fixLoopback
Fix loopback cluster name, context name, and user
Diffstat (limited to 'roles/openshift_master/tasks')
-rw-r--r--roles/openshift_master/tasks/main.yml32
-rw-r--r--roles/openshift_master/tasks/set_loopback_context.yml31
2 files changed, 33 insertions, 30 deletions
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml
index 3613808b6..4aede31f6 100644
--- a/roles/openshift_master/tasks/main.yml
+++ b/roles/openshift_master/tasks/main.yml
@@ -240,36 +240,8 @@
- restart master api
- restart master controllers
-- name: Test local loopback context
- command: >
- {{ openshift.common.client_binary }} config view
- --config={{ openshift_master_loopback_config }}
- changed_when: false
- register: loopback_config
-
-- command: >
- {{ openshift.common.client_binary }} config set-cluster
- --certificate-authority={{ openshift_master_config_dir }}/ca.crt
- --embed-certs=true --server={{ openshift.master.loopback_api_url }}
- {{ openshift.master.loopback_cluster_name }}
- --config={{ openshift_master_loopback_config }}
- when: loopback_context_string not in loopback_config.stdout
- register: set_loopback_cluster
-
-- command: >
- {{ openshift.common.client_binary }} config set-context
- --cluster={{ openshift.master.loopback_cluster_name }}
- --namespace=default --user={{ openshift.master.loopback_user }}
- {{ openshift.master.loopback_context_name }}
- --config={{ openshift_master_loopback_config }}
- when: set_loopback_cluster | changed
- register: set_loopback_context
-
-- command: >
- {{ openshift.common.client_binary }} config use-context {{ openshift.master.loopback_context_name }}
- --config={{ openshift_master_loopback_config }}
- when: set_loopback_context | changed
- register: set_current_context
+- include: set_loopback_context.yml
+ when: openshift.common.version_gte_3_2_or_1_2
- name: Start and enable master
service: name={{ openshift.common.service_type }}-master enabled=yes state=started
diff --git a/roles/openshift_master/tasks/set_loopback_context.yml b/roles/openshift_master/tasks/set_loopback_context.yml
new file mode 100644
index 000000000..9c3fb31dc
--- /dev/null
+++ b/roles/openshift_master/tasks/set_loopback_context.yml
@@ -0,0 +1,31 @@
+---
+- name: Test local loopback context
+ command: >
+ {{ openshift.common.client_binary }} config view
+ --config={{ openshift_master_loopback_config }}
+ changed_when: false
+ register: loopback_config
+
+- command: >
+ {{ openshift.common.client_binary }} config set-cluster
+ --certificate-authority={{ openshift_master_config_dir }}/ca.crt
+ --embed-certs=true --server={{ openshift.master.loopback_api_url }}
+ {{ openshift.master.loopback_cluster_name }}
+ --config={{ openshift_master_loopback_config }}
+ when: loopback_context_string not in loopback_config.stdout
+ register: set_loopback_cluster
+
+- command: >
+ {{ openshift.common.client_binary }} config set-context
+ --cluster={{ openshift.master.loopback_cluster_name }}
+ --namespace=default --user={{ openshift.master.loopback_user }}
+ {{ openshift.master.loopback_context_name }}
+ --config={{ openshift_master_loopback_config }}
+ when: set_loopback_cluster | changed
+ register: set_loopback_context
+
+- command: >
+ {{ openshift.common.client_binary }} config use-context {{ openshift.master.loopback_context_name }}
+ --config={{ openshift_master_loopback_config }}
+ when: set_loopback_context | changed
+ register: set_current_context