Giter Site home page Giter Site logo

ansible-role-sendmail's Introduction

Sendmail

Quick and easy way to send an email message from Tower, Jenkins or any job stream.

Requirements

Requires v2 of the mail module. If you are not running v2 of ansible, you can install v2 of the mail module. Create a library directory in the path where you run playbooks, and download a copy of the latest mail module to library/mail.py.

Role Variables

All of the mail module parameters have been turned into variables.

SMTP server connection.

sendmail_host: smtp.google.com
sendmail_port: 587
sendmail_username: "[email protected]"
sendmail_password: "password1!"

Construct the email message.

sendmail_to: "[email protected]"
sendmail_cc: "[email protected], [email protected]"
sendmail_from: "[email protected]"
sendmail_subject: "The upgrade process complete!"
sendmail_body: {{ lookup('file','/tmp/email_body.txt') }} 

Provide a path to a temporary file space the user running the playbook can write to. Defaults to '/tmp'.

sendmail_tmp: "/home/username"

Add any optional special headers

sendmail_headers: "[email protected]|X-Special='Something or other'"

Set the character set. Defaults to 'utf8'.

sendmail_charset: 'us-ascii'

Set the type of message - text or html. Defaults to html.

sendmail_subtype: html

Provide an optional space separated list of file attachments.

sendmail_attachments: "/etc/group /tmp/pavatar2.png"

Dependencies

None.

Example Playbook

A simple playbook to send an email:

# sendmail.yml
---
- name: Sending email
  hosts: local
  roles:
  - { role: sendmail }

Run the playbook with something like:

ansible-playbook sendmail.yml -i inventory.txt -e "@vars.yml"

License

MIT

Author Information

Thanks for checking out the sendmail role. Hopefully it makes sending email messages from your job streams super easy.

For questions, comments suggestions please open an issue here or add a review at Ansible Galaxy.

{{ foo }}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.