main.yml 977 B

123456789101112131415161718192021222324
  1. ---
  2. - name: updates a server
  3. # apt:
  4. # update_cache: yes
  5. # force: yes
  6. # upgrade: yes
  7. shell: cat /tmp/update.txt
  8. register: apt_update
  9. when: ansible_os_family == "Debian"
  10. #- name: upgrade a server
  11. # apt: upgrade=dist
  12. - debug: var=apt_update
  13. #.stdout_lines
  14. #- local_action:
  15. - mail:
  16. subject: "[U] {{ ansible_distribution }} Update Message # Installed updates on host {{ ansible_fqdn }}"
  17. to: update <erdo@ichalsroot.de>
  18. body: "{{ lookup('template', 'templates/mail_body.j2') }}"
  19. subtype: html
  20. delegate_to: localhost