Mail

This service shouldn't need any introduction; Ansible can be configured to send emails using all sorts of configuration. The following example shows an email being sent through an external SMTP server:

- name: Send an email using external mail servers  mail:    host: "{{ mail.smtp_host }}"    port: "{{ mail.smtp_port }}"    username: "{{ mail.smtp_username }}"    password: "{{ mail.smtp_password }}"    to: "Russ McKendrick <russ@mckendrick.io>"    subject: "Task Success"    body: "The task has completed and all is well"  delegate_to: localhost

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.