mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-28 22:33:10 +00:00
- output all relevant k8s resource to file on failure - output awx job list and job details to file on failure - output all pod logs to file on failure - added STORE_DEBUG_OUTPUT to enable debug output gathering - added DEBUG_OUTPUT_DIR to control where the debug output files will be stored - when molecule test fail in CI trigger artifact gathering
30 lines
907 B
YAML
30 lines
907 B
YAML
---
|
|
- name: Retrieve relevant k8s resources
|
|
kubernetes.core.k8s_info:
|
|
api_version: '{{ item.api_version }}'
|
|
kind: '{{ item.kind }}'
|
|
namespace: '{{ namespace }}'
|
|
loop:
|
|
- api_version: v1
|
|
kind: Pod
|
|
- api_version: apps/v1
|
|
kind: Deployment
|
|
- api_version: v1
|
|
kind: Secret
|
|
- api_version: v1
|
|
kind: ConfigMap
|
|
- api_version: "awx.ansible.com/v1beta1"
|
|
kind: AWX
|
|
register: debug_resources
|
|
|
|
- name: debug print item.kind and item.metadata.name
|
|
debug:
|
|
msg: '{{ item.kind }}-{{ item.metadata.name }}'
|
|
loop: "{{ debug_resources.results | map(attribute='resources') | flatten }}"
|
|
|
|
- name: Output gathered resource to files
|
|
ansible.builtin.copy:
|
|
content: '{{ item | to_nice_json }}'
|
|
dest: '{{ debug_output_dir }}/{{ item.kind }}-{{ item.metadata.name }}.json'
|
|
loop: "{{ debug_resources.results | map(attribute='resources') | flatten }}"
|