2 Concepts
PICA relies on several important concepts:
-
Objects
- Objects are “thingies” we want installed in our servers. Of
course, one thingie can be different depending on the server it is to be
installed in. For this purpose, objects are represented with files which
can contain special directives, interpreted by the Perl PreProcessor (one of
the PICA components). There are two types of thingies (also called
“distribution files”, or “distributed files”): files and alarms.
- Files
- Regular files to be installed in a given path of the remote
machine.
- Alarms
- Alarms are executable files, to be installed in special
directories which PICA takes care of. Alarms are executed from time to time,
and they are supposed to produce some output if there is something to notify.
Furthermore, alarms can have dependencies, which are files that have to
be (re)installed if the alarm depending on them is (re)installed.
- Hosts
- Your (theoretically remote) machines. You are supposed to have
your configuration files in one host, to copy them in a bunch of machines.
These machines are the “hosts”.
- Groups
- PICA recognized two types of groups: host groups and object
groups. Groups are used to organize and easily manage large collections of
objects. More on groups later.
- Attributes
- Attributes are object properties. There are mandatory
and optional attributes, depending on the type of object (file or alarm).
- Variables
- You can use “variables” that can be referred to in the
preprocessor and the files to be distributed. Sometimes we use the adjective
“local” to refer to object variables, and “group” to refer to those
of…you get the idea.
- Definitions
- They are variables defined as command line arguments
(more on that later).
2.1 Groups
If one refers to a group, the action affects all the objects in
that group. You can think of alarm dependencies as implicit groups, only that
the group is an object per se. There is one important difference between
host groups and object groups: one host can belong to an arbitrary number of
groups, but an object belongs to one group or to none at all.
2.2 Attributes
Attributes are properties associated with objects (both files and
alarms). They are used to define local and remote paths to the objects,
permissions to be set on installing, and so on. They are not to be
confused with local variables (rather different concept). The difference
is that attributes are for pica to know about them and behave accordingly,
while local variables are used-defined variables to substitute into the
installed objects, or to make conditionals or other references in Perl code.
2.3 Definitions
Definitions are very useful for changing little things (or big, for that
matter) at command line. They are defined with the +D flag. One can
define (the existence of) a variable, or assign it some value. The syntax is
+D myvariable for the former or +D myvariable=myvalue for the
latter.