Advertisement
k3NGuru

ansible-mail

Jan 14th, 2024
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.94 KB | None | 0 0
  1. ---
  2. - name: Kubectl get pods
  3.   ansible.builtin.command:
  4.     kubectl get deploy -n tks -o custom-columns='IMAGE:.spec.template.spec.containers[*].image'  
  5.   register: pods
  6.  
  7. - name: Задаем список сервисов для поставки
  8.   ansible.builtin.set_fact:
  9.     pod: "{{ (pods.stdout).splitlines() }}"
  10.  
  11. - name: Отправляем отчет об установленной поставке
  12.   community.general.mail:
  13.     host: gw
  14.     port: 25
  15.     subject: Установлена поставка {{ VERSION }} на {{ MAINHOST }}
  16.     body: |
  17.       Версия поставки {{ VERSION }}
  18.  
  19.       Состав поставки (модули): "{{ applist | default('Отсутствуют в поставке') }}"
  20.  
  21.       Файлы в поставке: "{{ filelist | default('Отсутствуют в поставке') }}"
  22.  
  23.       Список подов "{{ pod }}"
  24.     from: support
  25.     to: user
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement