|
@@ -55,7 +55,7 @@
|
|
|
state: present
|
|
|
with_items: "{{ openshift_hosted_routers }}"
|
|
|
|
|
|
-- name: Grant the router serivce account(s) access to the appropriate scc
|
|
|
+- name: Grant the router service account(s) access to the appropriate scc
|
|
|
oc_adm_policy_user:
|
|
|
user: "system:serviceaccount:{{ item.namespace }}:{{ item.serviceaccount }}"
|
|
|
namespace: "{{ item.namespace }}"
|
|
@@ -89,18 +89,37 @@
|
|
|
ports: "{{ item.ports }}"
|
|
|
stats_port: "{{ item.stats_port }}"
|
|
|
with_items: "{{ openshift_hosted_routers }}"
|
|
|
- register: routerout
|
|
|
|
|
|
-# This should probably move to module
|
|
|
-- name: wait for deploy
|
|
|
- pause:
|
|
|
- seconds: 30
|
|
|
- when: routerout.changed
|
|
|
+- name: Ensure OpenShift router correctly rolls out (best-effort today)
|
|
|
+ command: |
|
|
|
+ oc rollout status deploymentconfig {{ item.name }} \
|
|
|
+ --namespace {{ item.namespace | default('default') }} \
|
|
|
+ --config {{ openshift.common.config_base }}/master/admin.kubeconfig
|
|
|
+ async: 600
|
|
|
+ poll: 15
|
|
|
+ with_items: "{{ openshift_hosted_routers }}"
|
|
|
+ failed_when: false
|
|
|
|
|
|
-- name: Ensure router replica count matches desired
|
|
|
- oc_scale:
|
|
|
- kind: dc
|
|
|
- name: "{{ item.name | default('router') }}"
|
|
|
- namespace: "{{ item.namespace | default('default') }}"
|
|
|
- replicas: "{{ item.replicas }}"
|
|
|
+- name: Determine the latest version of the OpenShift router deployment
|
|
|
+ command: |
|
|
|
+ oc get deploymentconfig {{ item.name }} \
|
|
|
+ --namespace {{ item.namespace }} \
|
|
|
+ --config {{ openshift.common.config_base }}/master/admin.kubeconfig \
|
|
|
+ -o jsonpath='{ .status.latestVersion }'
|
|
|
+ register: openshift_hosted_routers_latest_version
|
|
|
with_items: "{{ openshift_hosted_routers }}"
|
|
|
+
|
|
|
+- name: Poll for OpenShift router deployment success
|
|
|
+ command: |
|
|
|
+ oc get replicationcontroller {{ item.0.name }}-{{ item.1.stdout }} \
|
|
|
+ --namespace {{ item.0.namespace }} \
|
|
|
+ --config {{ openshift.common.config_base }}/master/admin.kubeconfig \
|
|
|
+ -o jsonpath='{ .metadata.annotations.openshift\.io/deployment\.phase }'
|
|
|
+ register: openshift_hosted_router_rc_phase
|
|
|
+ until: "'Running' not in openshift_hosted_router_rc_phase.stdout"
|
|
|
+ delay: 15
|
|
|
+ retries: 40
|
|
|
+ failed_when: "'Failed' in openshift_hosted_router_rc_phase.stdout"
|
|
|
+ with_together:
|
|
|
+ - "{{ openshift_hosted_routers }}"
|
|
|
+ - "{{ openshift_hosted_routers_latest_version.results }}"
|