Created
May 16, 2012 12:12
-
-
Save frbayart/2709892 to your computer and use it in GitHub Desktop.
mysql_user with cfengine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle agent mysql_user() { | |
vars: | |
any:: | |
"users_to_check" slist => { "francois", "benoit" }; | |
"user_is_not_here" string => execresult("/usr/local/bin/mysql_user_check $(users_to_check)","noshell"); | |
classes: | |
"mysql_check_OK" expression => strcmp("$(user_is_not_here)", "OK"); | |
"mysql_check_NOK" expression => strcmp("$(user_is_not_here)", "NOK"); | |
reports: | |
mysql_check_OK.!mysql_check_NOK:: | |
"users exists"; | |
mysql_check_NOK.!mysql_check_OK:: | |
"users unknown"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment