Project

General

Profile

Provisioning Email Reports » History » Version 1

Josh Baird, 06/04/2012 03:55 PM

1 1 Josh Baird
h1. Provisioning Email Reports
2
3
Some may find it useful to have a host email you a small report once it has been provisioned.  Cobbler does this out of the box.  This is how I made it work using Foreman.  
4
5
1.  Browse to More -> Provisioning Templates
6
2.  Click "New Template"
7
3.  Name the report 
8
4.  Choose "Finish" for the "Template kind"
9
5.  Paste the following in the box:
10
11
@#!/bin/sh
12
# Generate an email report once the host is provisioned
13
14
echo "
15
Foreman build report.
16
==========================================================
17
http://foreman.domain.com/
18
19
The system has been provisioned and is now ready for use.  Additional Puppet modules may be assigned from Foreman.
20
21
Hostname: <%25= @host %25> (<%25= @host.ip %25>)
22
Foreman Host-Group: <%25= @host.hostgroup %25>
23
MAC: <%25= @host.mac %25>
24
OS: <%25= @host.os %25> 
25
Puppet Master: <%25= @host.puppetmaster %25>
26
Puppet Environment: <%25= @host.environment %25>
27
28
==========================================================
29
30
Questions?  Contact EIT UNIX TEAM (eitunixteam@follett.com)" | mail -s "Linux Build Report (<%25= @host %25> [<%25= @host.ip %25>])" -r "Foreman (foreman@domain.com)" tunixteam@domain.com@
31
32
You can use other variables that Foreman makes available to you as well.  This email will be generated FROM the host that you are provisioning, not from the Foreman host.