forked from ungleich-public/cdist
Compare commits
3 commits
5ed643e7c2
...
ca1be26f35
Author | SHA1 | Date | |
---|---|---|---|
ca1be26f35 | |||
5a3e3d870c | |||
4c81808496 |
2 changed files with 25 additions and 40 deletions
|
@ -1,21 +0,0 @@
|
|||
#!/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
|
|
@ -3,43 +3,49 @@ cdist-type__nop(7)
|
|||
|
||||
NAME
|
||||
----
|
||||
cdist-type__nop - Do nothing.
|
||||
cdist-type__nop - Do nothing, but allow dependencies to be specified.
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
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.
|
||||
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:
|
||||
|
||||
The only thing that one needs to specify is some kind of object name, which will be simply ignored.
|
||||
- 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)
|
||||
|
||||
It is advisible, though, to provide a name based on the parent object's id, so to make this call unique.
|
||||
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``.
|
||||
|
||||
REQUIRED PARAMETERS
|
||||
-------------------
|
||||
PARAMETERS
|
||||
----------
|
||||
None.
|
||||
|
||||
|
||||
OPTIONAL PARAMETERS
|
||||
-------------------
|
||||
None.
|
||||
|
||||
|
||||
BOOLEAN PARAMETERS
|
||||
------------------
|
||||
None.
|
||||
The ``$__object_id`` is required though, so the type can be used several times.
|
||||
|
||||
|
||||
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
|
||||
|
||||
require="__othertype/foo" __nop $__object_id # Use parent object's id to make the name unique
|
||||
If, ``__spam`` has parameters, however, one would resort to this at the place of use:
|
||||
|
||||
.. code-block:: sh
|
||||
__spam --foo bar
|
||||
require="__spam" __ham --baz
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*Nothing to see here...*
|
||||
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
|
||||
|
||||
AUTHORS
|
||||
-------
|
||||
|
|
Loading…
Reference in a new issue