Skip to content

Instantly share code, notes, and snippets.

@sbrinkmeyer
Created February 26, 2016 21:52
Show Gist options
  • Save sbrinkmeyer/e3a4ebc070314200226a to your computer and use it in GitHub Desktop.
Save sbrinkmeyer/e3a4ebc070314200226a to your computer and use it in GitHub Desktop.
// Catch cookbook changes not made by the 'pipeline' user
rules 'catch cookbook changes'
with priority=50
rule on action
when
parent_type = 'cookbook'
and
requestor_name != 'go-agent'
then
// Not passing a second parameter(notification string)
// in order to send the default json CONTENT
notify('infracoe-email', "{{message.cookbook_name}}")
notify( 'mattermost_infracoe', '{
"username": "Chef Analytics Notifications",
"attachments": [ {"text": "`{{message.requestor_name}}` uploaded cookbook `{{message.cookbook_name}}` on machine `{{message.remote_hostname}}` to organization `{{message.organization_name}}`",
"color": "danger"
}]
}')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment