Class: Ansible::Ruby::Modules::Mail

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/notification/mail.rb

Overview

This module is useful for sending emails from playbooks. One may wonder why automate sending emails? In complex environments there are from time to time processes that cannot be automated, either because you lack the authority to make it so, or because not everyone agrees to a common approach. If you cannot automate a specific step, but the step is non-blocking, sending out an email to the responsible party to make them perform their part of the bargain is an elegant way to put the responsibility in someone else’s lap. Of course sending out a mail can be equally useful as a way to notify one or more people in a team that a specific action has been (successfully) taken.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#attachObject?

Returns A list of pathnames of files to attach to the message.,Attached files will have their content-type set to C(application/octet-stream).

Returns:

  • (Object, nil)

    A list of pathnames of files to attach to the message.,Attached files will have their content-type set to C(application/octet-stream).



54
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 54

attribute :attach

#bccObject?

Returns The email-address(es) the mail is being ‘blind’ copied to.,This is a list, which may contain address and phrase portions.

Returns:

  • (Object, nil)

    The email-address(es) the mail is being ‘blind’ copied to.,This is a list, which may contain address and phrase portions.



27
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 27

attribute :bcc

#bodyString?

Returns The body of the email being sent.

Returns:

  • (String, nil)

    The body of the email being sent.



34
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 34

attribute :body

#ccString?

Returns The email-address(es) the mail is being copied to.,This is a list, which may contain address and phrase portions.

Returns:

  • (String, nil)

    The email-address(es) the mail is being copied to.,This is a list, which may contain address and phrase portions.



23
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 23

attribute :cc

#charsetString?

Returns The character set of email being sent.

Returns:

  • (String, nil)

    The character set of email being sent.



60
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 60

attribute :charset

#fromString?

Returns The email-address the mail is sent from. May contain address and phrase.

Returns:

  • (String, nil)

    The email-address the mail is sent from. May contain address and phrase.



15
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 15

attribute :from

#headersObject?

Returns A list of headers which should be added to the message.,Each individual header is specified as C(header=value) (see example below).

Returns:

  • (Object, nil)

    A list of headers which should be added to the message.,Each individual header is specified as C(header=value) (see example below).



57
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 57

attribute :headers

#hostString?

Returns The mail server.

Returns:

  • (String, nil)

    The mail server.



46
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 46

attribute :host

#passwordString?

Returns If SMTP requires password.

Returns:

  • (String, nil)

    If SMTP requires password.



42
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 42

attribute :password

#portInteger?

Returns The mail server port.,This must be a valid integer between 1 and 65534.

Returns:

  • (Integer, nil)

    The mail server port.,This must be a valid integer between 1 and 65534



50
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 50

attribute :port

#secure:always, ...

Returns If C(always), the connection will only send email if the connection is Encrypted. If the server doesn’t accept the encrypted connection it will fail.,If C(try), the connection will attempt to setup a secure SSL/TLS session, before trying to send.,If C(never), the connection will not attempt to setup a secure SSL/TLS session, before sending,If C(starttls), the connection will try to upgrade to a secure SSL/TLS connection, before sending. If it is unable to do so it will fail.

Returns:

  • (:always, :never, :starttls, :try, nil)

    If C(always), the connection will only send email if the connection is Encrypted. If the server doesn’t accept the encrypted connection it will fail.,If C(try), the connection will attempt to setup a secure SSL/TLS session, before trying to send.,If C(never), the connection will not attempt to setup a secure SSL/TLS session, before sending,If C(starttls), the connection will try to upgrade to a secure SSL/TLS connection, before sending. If it is unable to do so it will fail.



68
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 68

attribute :secure

#subjectString

Returns The subject of the email being sent.

Returns:

  • (String)

    The subject of the email being sent.



30
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 30

attribute :subject

#subtype:html, ...

Returns The minor mime type, can be either C(plain) or C(html).,The major type is always C(text).

Returns:

  • (:html, :plain, nil)

    The minor mime type, can be either C(plain) or C(html).,The major type is always C(text).



64
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 64

attribute :subtype

#timeoutInteger?

Returns Sets the timeout in seconds for connection attempts.

Returns:

  • (Integer, nil)

    Sets the timeout in seconds for connection attempts.



72
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 72

attribute :timeout

#toString?

Returns The email-address(es) the mail is being sent to.,This is a list, which may contain address and phrase portions.

Returns:

  • (String, nil)

    The email-address(es) the mail is being sent to.,This is a list, which may contain address and phrase portions.



19
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 19

attribute :to

#usernameString?

Returns If SMTP requires username.

Returns:

  • (String, nil)

    If SMTP requires username.



38
# File 'lib/ansible/ruby/modules/generated/notification/mail.rb', line 38

attribute :username