Skip to content

Instantly share code, notes, and snippets.

@EmmanuelKasper
Last active April 6, 2021 12:32
Show Gist options
  • Save EmmanuelKasper/0563efab29127fc187a784af4ee6e659 to your computer and use it in GitHub Desktop.
Save EmmanuelKasper/0563efab29127fc187a784af4ee6e659 to your computer and use it in GitHub Desktop.
From: Emmanuel Kasper <[email protected]>
Date: Fri, 2 Apr 2021 14:25:28 +0200
Subject: [PATCH] Use absolute path to oc binary, as we install it outside of
$PATH
---
.../openshift-4-cluster/tasks/post-install-storage-nfs.yml | 2 +-
ansible/roles/openshift-4-cluster/tasks/post-install.yml | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ansible/roles/openshift-4-cluster/tasks/post-install-storage-nfs.yml b/ansible/roles/openshift-4-cluster/tasks/post-install-storage-nfs.yml
index 7769cac..95a516b 100644
--- a/ansible/roles/openshift-4-cluster/tasks/post-install-storage-nfs.yml
+++ b/ansible/roles/openshift-4-cluster/tasks/post-install-storage-nfs.yml
@@ -100,7 +100,7 @@
- name: Add pvc registry-storage to image registry
command: |
- oc patch configs.imageregistry.operator.openshift.io cluster --type='json' -p='[{"op": "remove", "path": "/spec/storage" },{"op": "add", "path": "/spec/storage", "value": {"pvc":{"claim": "registry-storage"}}}]' --kubeconfig {{ openshift_install_dir }}/auth/kubeconfig
+ /opt/openshift-client-{{ openshift_version }}/oc patch configs.imageregistry.operator.openshift.io cluster --type='json' -p='[{"op": "remove", "path": "/spec/storage" },{"op": "add", "path": "/spec/storage", "value": {"pvc":{"claim": "registry-storage"}}}]' --kubeconfig {{ openshift_install_dir }}/auth/kubeconfig
register: registry_status
retries: 60
delay: 30
diff --git a/ansible/roles/openshift-4-cluster/tasks/post-install.yml b/ansible/roles/openshift-4-cluster/tasks/post-install.yml
index 5e46e27..02bb056 100644
--- a/ansible/roles/openshift-4-cluster/tasks/post-install.yml
+++ b/ansible/roles/openshift-4-cluster/tasks/post-install.yml
@@ -22,9 +22,9 @@
shell: |
while true
do
- oc --kubeconfig="{{ openshift_install_dir }}/auth/kubeconfig" get csr --no-headers | \
+ /opt/openshift-client-{{ openshift_version }}/oc --kubeconfig="{{ openshift_install_dir }}/auth/kubeconfig" get csr --no-headers | \
awk '/Pending/ {print $1}' | \
- xargs --no-run-if-empty oc --kubeconfig="{{ openshift_install_dir }}/auth/kubeconfig" adm certificate approve
+ xargs --no-run-if-empty /opt/openshift-client-{{ openshift_version }}/oc --kubeconfig="{{ openshift_install_dir }}/auth/kubeconfig" adm certificate approve
sleep 1
done
@@ -45,7 +45,7 @@
tags: storage
- name: Set image registry managementState from Removed to Managed
- command: "oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{\"spec\":{\"managementState\": \"Managed\"}}' --kubeconfig {{ openshift_install_dir }}/auth/kubeconfig"
+ command: "/opt/openshift-client-{{ openshift_version }}/oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{\"spec\":{\"managementState\": \"Managed\"}}' --kubeconfig {{ openshift_install_dir }}/auth/kubeconfig"
register: registry_status
retries: 60
delay: 30
--
2.27.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment