System Role Handlers
This is a mechanism that allows to execute specific code depending on the system
role selected during the installation which was introduced in version 3.2.21
(originally in 18.104.22.168 in the
If you prefer, you could think of them as hooks for system roles.
Types of handlers
Currently only one type of handlers exist:
finish. Those handlers will be
executed through the
Defining a new handler
Handlers are just plain classes which implement a
run method and live in the
lib/y2system_role_handlers. The name of the file/class depends on the type of
handler they implement.
For instance, if you want to define a finish handler for an ExampleRole role,
just drop a file like this into
module Y2SystemRoleHandlers class ExampleRoleFinish def run # Handler implementation goes here end end end
run method won't receive any argument and is also not expected to return
any special value. Finally, exceptions will be handled like any other YaST
Please, check out the yast2-caasp package for examples.