2020-04-01 22:23:29 +08:00
|
|
|
---
|
2020-07-27 21:24:17 +08:00
|
|
|
- name: Generate dump folder # noqa 305
|
2020-04-01 22:23:29 +08:00
|
|
|
shell: "{{ bin_dir }}/kubectl cluster-info dump --all-namespaces --output-directory /tmp/cluster-dump"
|
|
|
|
no_log: true
|
|
|
|
when: inventory_hostname in groups['kube-master']
|
|
|
|
|
|
|
|
- name: Compress directory cluster-dump
|
|
|
|
archive:
|
|
|
|
path: /tmp/cluster-dump
|
|
|
|
dest: /tmp/cluster-dump.tgz
|
|
|
|
when: inventory_hostname in groups['kube-master']
|
|
|
|
|
|
|
|
- name: Fetch dump file
|
|
|
|
fetch:
|
|
|
|
src: /tmp/cluster-dump.tgz
|
|
|
|
dest: "{{ lookup('env', 'CI_PROJECT_DIR') }}/cluster-dump/{{ inventory_hostname }}.tgz"
|
|
|
|
flat: true
|
|
|
|
when: inventory_hostname in groups['kube-master']
|