Everyone might think about #vRO being complex and a bit difficult to do your basic automation for vSphere / Cloud Platform (vRA / AWS /Azure…) / Whatever you wish to be honest, but sometimes simple automation tasks can facilitate your life of administrator! Your LIFE;
Today’s example: Send notifications / information via mail
Maybe when a specific Task is completed or maybe sending results from your workflow output to a “second step” (Let’s say you have to send a list of VMs to your billing department every week; Creating a Service Request via mail thread… etc). It can be numerous what are the possibilities here!
So I will start within basic scenario where we can use this workflow to send Text Subject/Content to your pre-defined <or> list of mail addresses.
Most of things in IT world, Google “knows everything” and you can always Copy & Adapt (Don’t forget to mention your source… 🙂 )
Send Notification workflow
1) Pre-Built workflow for sending notifications are in place under Library>Mail>Send Notification
2) Copy it to your own folder, so we can modify according your needs.
3) To facilitate our “Common Input Parameters”, let’s use Configuration Elements
This is totally up to your decision if use or not as well which parameters to be added there.
The use of Configuration Elements avoid some good part of coding and input parameters, helps you to keep a single source of values as well. A good example of Configuration Elements is Usernames/Passwords/Hostnames/Etc; Where it can be easily replaced at later stage without going investigating all workflows you have created.
This example I am using the attributes below:
- username – user for authentication
- password – user’s password
- smtpServer – IP/DNS
- smtpPort – Port (25/465/589/etc…)
- nameDescription – name will appear in your mail as Sender
- mailRecipients – Pre-Defined list of mails as recipients
Moving Inputs to Attributes
We can use Configuration elements via coding some calls to read it for us or simply (KIS) put the values as attributes and link them to CI. Hereby the link we are doing for all the parameters created above.
Results: This will make you workflow running always with same parameters (SMTP Server / User / Password / Etc).
Are you READY for the Error! 🙂
Most of internal SMTP Servers, still use non-authenticated or non-secure connections on port 25, although the most secure ones use SSL/TLS 🙂
So Expected Error is if you are Configuring SMTP for GMAIL (or any other SSL mail system)
TIP : Don’t Forget >> Certificates <<
Pre-Built workflow for importing certificates are available in Library>Configuration>Import Certificate from URL
Run Baby… Run…
After this quick workflow, you will be able to see your green box & a mail in your inbox 😉
Extending notifications to other workflows
Simple extension for your mail notification workflow, would be incorporating it into other workflows. As example given early, you create a script to receive execute your tasks + send the output to your Mail workflow.
Enjoy this little POST and I am always glad to have you here…