2020-04-01 22:23:29 +08:00
|
|
|
---
|
2020-07-28 16:39:08 +08:00
|
|
|
- name: Generate dump folder
|
|
|
|
command: "{{ bin_dir }}/kubectl cluster-info dump --all-namespaces --output-directory /tmp/cluster-dump"
|
2020-04-01 22:23:29 +08:00
|
|
|
no_log: true
|
2021-03-24 08:26:05 +08:00
|
|
|
when: inventory_hostname in groups['kube_control_plane']
|
2020-04-01 22:23:29 +08:00
|
|
|
|
|
|
|
- name: Compress directory cluster-dump
|
2023-06-26 18:15:45 +08:00
|
|
|
community.general.archive:
|
2020-04-01 22:23:29 +08:00
|
|
|
path: /tmp/cluster-dump
|
|
|
|
dest: /tmp/cluster-dump.tgz
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2021-03-24 08:26:05 +08:00
|
|
|
when: inventory_hostname in groups['kube_control_plane']
|
2020-04-01 22:23:29 +08:00
|
|
|
|
|
|
|
- name: Fetch dump file
|
|
|
|
fetch:
|
|
|
|
src: /tmp/cluster-dump.tgz
|
|
|
|
dest: "{{ lookup('env', 'CI_PROJECT_DIR') }}/cluster-dump/{{ inventory_hostname }}.tgz"
|
|
|
|
flat: true
|
2021-03-24 08:26:05 +08:00
|
|
|
when: inventory_hostname in groups['kube_control_plane']
|