cdist/cdist/conf/type/__nop/man.rst

61 lines
1.8 KiB
ReStructuredText
Raw Normal View History

2021-01-18 18:52:34 +00:00
cdist-type__nop(7)
==================
NAME
----
cdist-type__nop - Do nothing, but allow dependencies to be specified.
2021-01-18 18:52:34 +00:00
DESCRIPTION
-----------
If one has a type without any logic in the ``manifest`` (i.e. only some ``gencode-*`` logic), that depends on some other type, there are two ways make sure the dependencies taken into consideration:
2021-01-18 18:52:34 +00:00
- Either remember to specify them "externally" *every time*, wherever and whenever those types are used
- Include a ``manifest`` in the *dependent* type, that does something useless (or even nothing)
2021-01-18 18:52:34 +00:00
This type provides a convenient solution for the latter one. It is guaranteed to have no effect on the target host, but it provides an 'anchor point' for type-writers to include in an otherwise empty ``manifest``.
2021-01-18 18:52:34 +00:00
PARAMETERS
----------
2021-01-18 18:52:34 +00:00
None.
The ``$__object_id`` is required though, so the type can be used several times.
2021-01-18 18:52:34 +00:00
EXAMPLES
--------
2021-01-18 18:52:34 +00:00
Let's assume type ``__eggs`` depends on type ``__spam``, but has nothing in it's ``manifest``. In the simplest case, it's manifest can contain this:
2021-01-18 18:52:34 +00:00
.. code-block:: sh
__spam
2021-01-18 18:52:34 +00:00
If, ``__spam`` has parameters, however, one would resort to this at the place of use:
2021-01-18 18:52:34 +00:00
.. code-block:: sh
__spam --foo bar
require="__spam" __ham --baz
2021-01-18 18:52:34 +00:00
Or by using the ``__nop`` type, simply do away with the ``require``, and update ``__ham/manifest`` to specify the dependency:
2021-01-18 18:52:34 +00:00
.. code-block:: sh
require="__spam" __nop $__object_id
2021-01-18 18:52:34 +00:00
In this case, when the type is used, the depencency is automatic, and one could simply write:
.. code-block:: sh
__spam --foo bar
__ham --baz
2021-01-18 18:52:34 +00:00
AUTHORS
-------
Daniel Fancsali <fancsali@gmail.com>
COPYING
-------
Copyright \(C) 2021 Daniel Fancsali. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.