The Defaults plugin can be used to populate default attributes for entries. Defaults is not a Generator plugin, so it does not actually bind an entry; Defaults are applied after an entry has been bound, and only populate attributes that are not yet set.

Like Rules, Defaults supports regular expressions in the name attribute.

For instance, to make all Service entries use the systemd tool on Fedora 15 and the chkconfig tool on Fedora 14, you could do:

<Defaults priority="0">
  <Group name="fedora-15">
    <Service name=".*" type="systemd"/>
  <Group name="fedora-14">
    <Service name=".*" type="chkconfig"/>

If you were to specify a type attribute for a Service entry in Rules (or a type attribute for a BoundService entry in Bundler), that would take precendence over the default.

Like Rules, Defaults can also replace %{name} in attributes with the real name of the entry. To enable this, add the following setting to bcfg2.conf:

replace_name = yes

Previous topic


Next topic


This Page