diff --git a/playbooks/kubernetes/post.yaml b/playbooks/kubernetes/post.yaml index 4639af1..a1893cd 100644 --- a/playbooks/kubernetes/post.yaml +++ b/playbooks/kubernetes/post.yaml @@ -1,5 +1,6 @@ - hosts: all roles: - collect-container-logs # for some of minikube logs + - collect-minikube-logs - collect-kubernetes-state - collect-kubernetes-pods-logs diff --git a/roles/collect-minikube-logs/tasks/main.yaml b/roles/collect-minikube-logs/tasks/main.yaml new file mode 100644 index 0000000..56b253a --- /dev/null +++ b/roles/collect-minikube-logs/tasks/main.yaml @@ -0,0 +1,23 @@ +- name: Create minikube logs dir + file: + path: "{{ ansible_user_dir }}/zuul-output/logs/minikube" + state: directory + mode: 0755 + +- name: Collect default minikube logs + shell: "minikube logs > {{ ansible_user_dir }}/zuul-output/logs/minikube/minikube.txt" + failed_when: false + +- name: Collect all minikube cri-o logs + shell: "minikube ssh 'sudo journalctl -u crio' > {{ ansible_user_dir }}/zuul-output/logs/minikube/crio.txt" + failed_when: false + +- name: Collect all minikube kubelet logs + shell: "minikube ssh 'sudo journalctl -u kubelet' > {{ ansible_user_dir }}/zuul-output/logs/minikube/kubelet.txt" + failed_when: false + +- name: Open minikube logs permissions + file: + dest: "{{ ansible_user_dir }}/zuul-output/logs/minikube" + mode: u=rwX,g=rX,o=rX + recurse: true