zuul-jobs/roles/install-kubernetes/tasks/minikube.yaml
Tristan Cacqueray 3d5ee8637f install-kubernetes: fix minikube config permission
It seems like new minikube changed the default minikube config
permission. This change ensures the minikube config is owned by
the ansible_user

Change-Id: Ic1af1541fb1f32253678f989d7b62d21074514d5
2019-02-19 08:19:53 +00:00

55 lines
1.3 KiB
YAML

- name: Check for Minikube install
stat:
path: /tmp/minikube
register: stat_result
- name: Download Minikube
get_url:
url: https://storage.googleapis.com/minikube/releases/{{ minikube_version }}/minikube-linux-amd64
dest: /tmp/minikube
mode: 0755
when: stat_result.stat.exists == False
- name: Run install-docker role
include_role:
name: install-docker
- name: Create .kube directory
file:
path: "{{ ansible_user_dir }}/.kube"
state: directory
mode: 0755
- name: Create .kube/config file
file:
path: "{{ ansible_user_dir }}/.kube/config"
state: touch
mode: 0644
- name: Create .minikube directory
file:
path: "{{ ansible_user_dir }}/.minikube"
state: directory
mode: 0755
- name: Start Minikube
become: yes
command: /tmp/minikube --vm-driver=none start
environment:
MINIKUBE_WANTUPDATENOTIFICATION: false
MINIKUBE_WANTREPORTERRORPROMPT: false
MINIKUBE_WANTNONEDRIVERWARNING: false
MINIKUBE_WANTKUBECTLDOWNLOADMSG: false
CHANGE_MINIKUBE_NONE_USER: true
MINIKUBE_HOME: "{{ ansible_user_dir }}"
KUBECONFIG: "{{ ansible_user_dir }}/.kube/config"
- name: Ensure minikube config is owned by ansible_user
become: yes
file:
path: "{{ ansible_user_dir }}/.minikube/client.key"
owner: "{{ ansible_user }}"
- name: Get cluster info
command: kubectl cluster-info