Hi Mikhail
On Thu, Jul 28, 2011 at 10:55:29AM +0200, Mikhail Gusarov said:
> You could try to move promise which checks status to separate bundle,
> which is executed before repair one.
Thanks! After a bit of mucking around, I came up with the code below,
which works a treat.
Is there a short circuit in here that I'm missing? Rather than testing
each promise in the second bundle for a class set in the first bundle,
is there a way to go something like:
set_mysql_root::
bundle agent app_db_mysql_check_root {
...
}
such that app_db_mysql_check_root is only evaluated if set_mysql_root is
set?
the code that works:
bundle agent app_db_mysql_check_root {
commands:
"/usr/bin/mysqladmin status"
repair_failed => { "set_mysql_root" };
}
bundle agent app_db_mysql_set_root
{
vars:
set_mysql_root::
"newpass" string => execresult("/usr/bin/makepasswd --chars 12","noshell"),
commands:
set_mysql_root::
"/usr/bin/mysqladmin --password= password $(newpass)"
}
--
Simon Blake [email protected]
Geek for hire +64 22 402 0044
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine