Rulesets are a fundimental concept for Rover development. This section describes what rulesets are, how to create them, and how to use and reuse them.
Rover executes commands in groups called a Ruleset. Each ruleset consists
of actions to be taken against a remote machine. These rulests are
then configured to be ran against an operating system type (OS).
For example, we create a ruleset call "Unix_Uptime" that executes the uptime command on a UNIX machine. We can then specify to run the ruleset on all OS types, or we can chose to run it only on Linux, AIX, SunOS, and HP-UX machines.
The contents of a ruleset are really function calls using Perl syntax. The functions used are called ruleset commands, which are specifically imported in order to perform specialized tasks. The most common is the command execute(). Here is an example of a ruleset definition using the execute() command:
Ruleset commands are imported to Rover using modules. Rover ships with several modules which supply everything you'll probably ever need. Here are the supplied modules and the commands they provide:
Run_Commands: Execute and send commands
- execute() - Execute a single command, returning to the prompt
- send() - Send text followed by a return, ignoring the response
File_Transfer: Transfer files to and from remote machine
- get_file() - Get a file from a remote machine
- put_file() - Copy a local file to the remote machine
User_Admin: User administration commands
- userlist() - List usernames
- grouplist() - List group names
- useradd() - Add a local user account
- userdel() - Delete a local user account
- groupadd() - Add a local group
- groupdel() - Delete a local group
- unlock() - Set the password and unlock a user account
Password: Run passwd command as a normal user
- passwd() - Change the password for the current user
As an example, we are going to create a ruleset called "Unix_Uptime". This ruleset will simply execute the command "uptime" on a remote machine. We will be creating The command two ways, first using the command line script "rover", then using "rovergtk".
Once in the shell you can type help for a list of available commands. Next, create the ruleset "Unix_Uptime" using the following syntax:
$ rover -s
This will launch a VI session where we can edit the ruleset. Enter into insert mode (press "i") and type the following:
rover> new Unix_Uptime
Save the ruleset as you would normally save a file in vi (escape, then ZZ or :wq).
Once a ruleset is created and saved, it is used by assigning it an OS type. Available OS types are as follows:
Using the command line, you can enter an interactive shell to modify the runlist. Alternatively you can use the command line switch "-r|--ruleset <name>" to specify a ruleset be ran on all OS types. See "man rover" for more details.
ALL UNKNOWN Linux AIX SunOS HP_UX FreeBSD OpenBSD Windows
For the graphical user interface, you can add a ruleset to an OS by selecting the ruleset, checking the OS or OS's you wish to run that on, and clicking the "Add" button.
rover> runmod Linux
Change runlist for Linux:
Chose one or more of the following rulesets, enter blank line to finish