Workaround Minikube issue on MacOS and enable preflights

This commit is contained in:
Marcelo Moreira de Mello 2021-07-19 15:19:02 -04:00
parent c073583663
commit 7e46499e18
3 changed files with 36 additions and 1 deletions

View File

@ -1,6 +1,10 @@
---
sources_dest: '_sources'
driver: 'docker'
addons:
- default-storageclass
- storage-provisioner
- dashboard
minikube_url_linux: 'https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64'
minikube_url_macos: 'https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64'

View File

@ -1,4 +1,7 @@
---
- name: Include pre-flight checks
include_tasks: preflight.yml
- name: Create _sources directory
file:
path: "{{ sources_dest }}"
@ -40,7 +43,23 @@
- ansible_system == "Darwin"
- name: Starting Minikube
shell: "{{ sources_dest }}/minikube start --driver={{ driver }} --install-addons=true --addons=ingress"
shell: "{{ sources_dest }}/minikube start --driver={{ driver }} --install-addons=true --addons={{ addons | join(',') }}"
register: minikube_stdout
- name: Enable Ingress Controller on Minikube
shell: "{{ sources_dest }}/minikube addons enable ingress"
when:
- minikube_stdout.rc == 0
register: _minikube_ingress
ignore_errors: true
- name: Show Minikube Ingress known-issue 7332 warning
pause:
seconds: 5
prompt: "The Minikube Ingress addon has been disabled since it looks like you are hitting https://github.com/kubernetes/minikube/issues/7332"
when:
- '"minikube/issues/7332" in _minikube_ingress.stderr'
- ansible_system == "Darwin"
- name: Create ServiceAccount and clusterRoleBinding
k8s:

View File

@ -0,0 +1,12 @@
---
- name: Check if Kubernetes python module is installed
shell: pip freeze | grep openshift
register: _pip_openshift
ignore_errors: true
- name: Preflight check - require openshift python module
assert:
fail_msg: "The openshift python module was not found. You can either install it via 'pip install openshift' or using your distro package manager."
that:
- _pip_openshift.rc == 0
- "'openshift==' in _pip_openshift.stdout"