- hosts: all
  roles:
    - collect-container-logs
  post_tasks:
    - name: Describe resources
      command: "bash -c 'kubectl describe {{ item }} > ~/zuul-output/logs/describe-{{ item }}.txt'"
      ignore_errors: yes
      loop:
        - issuer
        - certificate
        - pods
        - deployments
        - statefulsets
        - services
        - secrets
        - configmaps

    - name: Delete empty container logs
      command: "find {{ ansible_user_dir }}/zuul-output/logs/ -type f -empty -delete"
      ignore_errors: yes