Skip to content

Instantly share code, notes, and snippets.

@smford22
Last active October 29, 2015 13:32
Show Gist options
  • Save smford22/b581ebeb714895e0df37 to your computer and use it in GitHub Desktop.
Save smford22/b581ebeb714895e0df37 to your computer and use it in GitHub Desktop.
Local user account creation rule
rules 'local-user-account-creation'
  rule on run_resource
  when
    resource_type = 'user'
      and
    resource_result = 'create'
  then
   alert:warn('Local user account {{message.resource_name}} created on {{message.run.node_name}}')
   notify('slack', '
{
"username": "Chef Server",
"icon_emoji": ":chef:",
"attachments": [ {
"text": "Local user account {{message.resource_name}} created on {{message.run.node_name}} -- COOKBOOK: {{message.cookbook_name}}-{{message.cookbook_version}}",
"color": "warning"
}]
}
')
 end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment