-
-
Save jooooooon/2709917 to your computer and use it in GitHub Desktop.
mysql_user with cfengine
This file contains 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" }; | |
classes: | |
"user_is_not_here_$(users_to_check)" expression => returnszero("/usr/local/bin/mysql_user_check $(users_to_check)","noshell"); | |
"mysql_users_check_NOK" expression => classmatch("user_is_not_here_.*"); | |
commands: | |
mysql_users_check_NOK:: | |
"/bin/echo je vais creer les users qui manquent"; | |
reports: | |
mysql_users_check_NOK:: | |
"Au moins un user MySQL manque"; | |
cfengine:: | |
"Le user MySQL $(users_to_check) manque" | |
ifvarclass => "user_is_not_here_$(users_to_check)"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment