Skip to content

Uses the phone_home module to email you when cloud-init finishes its job.

Notifications You must be signed in to change notification settings

knobik/cloud-init-mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Just a Cloud-init Mailer

Uses the phone home module to email you when cloud-init finishes its job.

Run

docker run -d -p 80:8000 -e MAIL_TO=[WHERE_TO_SEND_NOTIFICATIONS] MAIL_USERNAME=[YOUR_SMTP_LOGIN] -e MAIL_PASSWORD=[YOUR_SMTP_PASSWORD] knobik/cloud-init-mailer:latest

default env values:

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS="${MAIL_USERNAME}"
MAIL_FROM_NAME="${APP_NAME}"
MAIL_TO=

custom mail template (based on laravel blade):

-v your-template.blade.php:/app/resources/views/mails/init-finished.blade.php
<div>
    <p>
        Host called home with data:
    </p>
    <p>
        Host: {{ $hostname }}<br />
        IP: {{ $ip }}
    </p>
</div>

cloud-init datasource example

phone_home:
  url: http://your-server-hosting-this:8080/api/notify
  post:
   - hostname
  tries: 3

About

Uses the phone_home module to email you when cloud-init finishes its job.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages