Compare commits

..

No commits in common. "ca1be26f356ba6d7c536a7b4862b0314c0c24301" and "5ed643e7c2bcf7844fa3f1123642004b42cebf65" have entirely different histories.

2 changed files with 40 additions and 25 deletions

View file

@ -0,0 +1,21 @@
#!/bin/sh -e
#
# 2021 Daniel Fancsali (fancsali@gmail.com)
#
# This file is part of cdist.
#
# cdist is free software: 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.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
echo "All your base are belong to us." >&2

View file

@ -3,49 +3,43 @@ cdist-type__nop(7)
NAME
----
cdist-type__nop - Do nothing, but allow dependencies to be specified.
cdist-type__nop - Do nothing.
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:
This type will literally do nothing; it's sole purpose is to provide an 'anchor point' in case one would have an empty manifest, but still needs to specify some dependencies.
- 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)
The only thing that one needs to specify is some kind of object name, which will be simply ignored.
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``.
It is advisible, though, to provide a name based on the parent object's id, so to make this call unique.
PARAMETERS
----------
REQUIRED PARAMETERS
-------------------
None.
The ``$__object_id`` is required though, so the type can be used several times.
OPTIONAL PARAMETERS
-------------------
None.
BOOLEAN PARAMETERS
------------------
None.
EXAMPLES
--------
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:
.. code-block:: sh
__spam
If, ``__spam`` has parameters, however, one would resort to this at the place of use:
require="__othertype/foo" __nop $__object_id # Use parent object's id to make the name unique
.. code-block:: sh
__spam --foo bar
require="__spam" __ham --baz
Or by using the ``__nop`` type, simply do away with the ``require``, and update ``__ham/manifest`` to specify the dependency:
.. code-block:: sh
require="__spam" __nop $__object_id
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
SEE ALSO
--------
*Nothing to see here...*
AUTHORS
-------