Skip to content

Instantly share code, notes, and snippets.

@nukemberg
Created April 12, 2016 12:47
Show Gist options
  • Save nukemberg/8d8e5886af34f83bcfb1071c8eaea11d to your computer and use it in GitHub Desktop.
Save nukemberg/8d8e5886af34f83bcfb1071c8eaea11d to your computer and use it in GitHub Desktop.
motd puppet template
<% if @ec2_instance_id -%>
🍻 This is a <%= scope.lookupvar("ec2_instance_type") %>, an EC2 <%= scope.lookupvar("virtual") %> server managed by Puppet.
<% else -%>
🍻 This is a  <%= scope.lookupvar("manufacturer") %> <%= scope.lookupvar("productname") %> server, a  <%= scope.lookupvar("virtual") %> server managed by Puppet.
<% end -%>
Hostname...: <%= scope.lookupvar("fqdn") %>
Environment: <%= scope.lookupvar("environment") %>
Role.......: <%= scope.lookupvar("role") %>
<% if @ec2_security_groups -%>SecurityGrp: <%= scope.lookupvar("ec2_security_groups") %><% end %>
DC.........: <%= scope.lookupvar("dc") %>, <% if @ec2_placement_availability_zone -%> Availability Zone: <%= scope.lookupvar("ec2_placement_availability_zone") %> <% else -%>Rack: <%= scope.lookupvar("dc_rack") %>, Switch port: <%= scope.lookupvar("dc_switch_port") %><% end %>
Processors.: <%= scope.lookupvar("processorcount") %>
Memory.....: <%= scope.lookupvar("memorysize") %>
Timezone...: <%= scope.lookupvar("timezone") %>
OS.........: <%= scope.lookupvar("operatingsystem") %> version <%= scope.lookupvar("operatingsystemrelease") %>
Puppet ver.: <%= scope.lookupvar("puppetversion") %>
IP Addresss: <%= scope.lookupvar("interface_private") %>: <%= scope.lookupvar("ipaddress_private") %>, <%= scope.lookupvar("interface_public") %>: <%= scope.lookupvar("ipaddress_public") %>

👉 For more information about this host use the `facter -p` command.
👉 Most system logs go to /var/log/messages, you may want to look there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment