Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

How do i send dynamic email content based on puppet run using exec cmd

$
0
0
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!

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>