Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > b50d8ee6d7871fcc13c0677a9364ed59 > files > 230

bcfg2-doc-1.3.0-1.fc17.noarch.rpm

.. -*- mode: rst -*-

.. _server-plugins-misc-trigger:

=======
Trigger
=======

Trigger is a plugin that calls external scripts (on the server) at the
end of each client run.

Setup
=====

First, add Trigger to the **plugins** line in ``bcfg2.conf``. Then do the
following::

    mkdir /var/lib/bcfg2/Trigger
    echo "#!/bin/sh\necho $1\n" > /var/lib/bcfg2/Trigger/test.sh
    chmod +x /var/lib/bcfg2/Trigger/test.sh

Use cases
=========

#. Completing network builds (ie resetting from the build target to the
   boot PXE target)
#. Integration with external systems

Trigger Arguments
=================

Triggers are run with a series of arguments.

#. client hostname
#. -p
#. client profile
#. -g
#. group1:group2:..:groupN (all client groups)