summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_service_catalog/defaults/main.yml2
-rw-r--r--roles/openshift_service_catalog/tasks/install.yml6
-rw-r--r--roles/openshift_service_catalog/tasks/start_api_server.yml22
3 files changed, 27 insertions, 3 deletions
diff --git a/roles/openshift_service_catalog/defaults/main.yml b/roles/openshift_service_catalog/defaults/main.yml
index dc573e78a..01ee2544d 100644
--- a/roles/openshift_service_catalog/defaults/main.yml
+++ b/roles/openshift_service_catalog/defaults/main.yml
@@ -1,3 +1,3 @@
---
openshift_service_catalog_remove: false
-openshift_service_catalog_nodeselector: {}
+openshift_service_catalog_nodeselector: {"openshift-infra": "apiserver"}
diff --git a/roles/openshift_service_catalog/tasks/install.yml b/roles/openshift_service_catalog/tasks/install.yml
index 6a2b94bc8..c1773b5f6 100644
--- a/roles/openshift_service_catalog/tasks/install.yml
+++ b/roles/openshift_service_catalog/tasks/install.yml
@@ -98,7 +98,7 @@
cpu_requests: none
memory_request: none
cors_allowed_origin: localhost
- node_selector: {"openshift-infra": "apiserver"}
+ node_selector: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) }}"
- name: Set Service Catalog API Server daemonset
oc_obj:
@@ -146,7 +146,7 @@
image: ""
cpu_limit: none
memory_limit: none
- node_selector: {"openshift-infra": "apiserver"}
+ node_selector: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) }}"
- name: Set Controller Manager deployment
oc_obj:
@@ -172,6 +172,8 @@
- "{{ mktemp.stdout }}/controller_manager_service.yml"
delete_after: yes
+- include: start_api_server.yml
+
- name: Delete temp directory
file:
name: "{{ mktemp.stdout }}"
diff --git a/roles/openshift_service_catalog/tasks/start_api_server.yml b/roles/openshift_service_catalog/tasks/start_api_server.yml
new file mode 100644
index 000000000..b143292b6
--- /dev/null
+++ b/roles/openshift_service_catalog/tasks/start_api_server.yml
@@ -0,0 +1,22 @@
+---
+# Label nodes and wait for apiserver and controller to be running (at least one)
+- name: Label {{ openshift.node.nodename }} for APIServer and controller deployment
+ oc_label:
+ name: "{{ openshift.node.nodename }}"
+ kind: node
+ state: add
+ labels: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) | oo_dict_to_list_of_dict }}"
+
+# wait to see that the apiserver is available
+- name: wait for api server to be ready
+ command: >
+ curl -k https://apiserver.kube-service-catalog.svc/healthz
+ args:
+ # Disables the following warning:
+ # Consider using get_url or uri module rather than running curl
+ warn: no
+ register: api_health
+ until: api_health.stdout == 'ok'
+ retries: 120
+ delay: 1
+ changed_when: false