martin f. krafft | 8acd49d | 2013-08-26 21:22:25 +0200 | [diff] [blame] | 1 | ============= |
| 2 | Using reclass |
| 3 | ============= |
martin f. krafft | cc8851d | 2013-08-27 13:43:16 +0200 | [diff] [blame^] | 4 | .. todo:: |
| 5 | |
| 6 | With |reclass| now in Debian, as well as installable from source, the |
| 7 | following should be checked for path consistency… |
| 8 | |
martin f. krafft | 8acd49d | 2013-08-26 21:22:25 +0200 | [diff] [blame] | 9 | For information on how to use |reclass| directly, call ``reclass --help`` |
| 10 | and study the output, or have a look at its :doc:`manual page <manpage>`. |
| 11 | |
| 12 | The three options, ``--inventory-base-uri``, ``--nodes-uri``, and |
| 13 | ``--classes-uri`` together specify the location of the inventory. If the base |
| 14 | URI is specified, then it is prepended to the other two URIs, unless they are |
| 15 | absolute URIs. If these two URIs are not specified, they default to ``nodes`` |
| 16 | and ``classes``. Therefore, if your inventory is in ``/etc/reclass/nodes`` and |
| 17 | ``/etc/reclass/classes``, all you need to specify is the base URI as |
| 18 | ``/etc/reclass`` — which is actually the default (specified in |
| 19 | ``reclass/defaults.py``). |
| 20 | |
| 21 | If you've installed |reclass| from source as per the :doc:`installation |
| 22 | instructions <install>`, try to run it from the source directory like this:: |
| 23 | |
| 24 | $ reclass -b examples/ --inventory |
| 25 | $ reclass -b examples/ --node localhost |
| 26 | |
| 27 | This will make it use the data from ``examples/nodes`` and |
| 28 | ``examples/classes``, and you can surely make your own way from here. |
| 29 | |
| 30 | On Debian-systems, use the following:: |
| 31 | |
| 32 | $ reclass -b /usr/share/doc/reclass/examples/ --inventory |
| 33 | $ reclass -b /usr/share/doc/reclass/examples/ --node localhost |
| 34 | |
| 35 | More commonly, however, use of |reclass| will happen indirectly, and through |
| 36 | so-called adapters. The job of an adapter is to translate between different |
| 37 | invocation paradigms, provide a sane set of default options, and massage the |
| 38 | data from |reclass| into the format expected by the automation tool in use. |
| 39 | Please have a look at the respective README files for these adapters, i.e. |
| 40 | for :doc:`Salt <salt>`, for :doc:`Ansible <ansible>`, and for :doc:`Puppet |
| 41 | <puppet>`. |
| 42 | |
| 43 | .. include:: substs.inc |