Hello, I currently have a static content as follows:
$body = "Application has been deployed on http://$::fqdn:8080/$path"
And the mail content is executed as follows:
$mailcommand = "echo \"${body}\" | mail -s \"${subject}\" -S from=${from} ${to}"
exec {'mail':
command => "${mailcommand}",
path => '/bin',
}
I need to refactor it so that I get an email that says what the details of puppet agent are. Right now even for the puppet agent that has completed with errors, I get the email saying "Application has been deployed successfully". IS there a way to append the content of /var/log/messages that include details of last puppet agent run with the email, if yes, how do i do that? Please provide examples.
PS : I spent 3 days experimenting tagmail and had no luck with it, the documentation in forge is very vague, so I am not looking for that as a solution. Thanks!
↧