--- - name: updates a server # apt: # update_cache: yes # force: yes # upgrade: yes shell: cat /tmp/update.txt register: apt_update when: ansible_os_family == "Debian" #- name: upgrade a server # apt: upgrade=dist - debug: var=apt_update #.stdout_lines #- local_action: - mail: subject: "[U] {{ ansible_distribution }} Update Message # Installed updates on host {{ ansible_fqdn }}" to: update body: "{{ lookup('template', 'templates/mail_body.j2') }}" subtype: html delegate_to: localhost