mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Added example to module state with a function that takes many kwargs
This commit is contained in:
parent
2991913ebc
commit
ecc7b9c8a1
@ -29,8 +29,19 @@ for this the :mod:`module.wait <salt.states.module.wait>` state can be used:
|
|||||||
- watch:
|
- watch:
|
||||||
- file: /etc/network/interfaces
|
- file: /etc/network/interfaces
|
||||||
|
|
||||||
All arguments are passed through to the module function being executed.
|
All arguments that the ``module`` state does not consume are passed through to
|
||||||
However, due to how the state system works, if a module function accepts an
|
the execution module function being executed:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
fetch_out_of_band:
|
||||||
|
module.run:
|
||||||
|
- name: git.fetch
|
||||||
|
- cwd: /path/to/my/repo
|
||||||
|
- user: myuser
|
||||||
|
- opts: '--all'
|
||||||
|
|
||||||
|
Due to how the state system works, if a module function accepts an
|
||||||
argument called, ``name``, then ``m_name`` must be used to specify that
|
argument called, ``name``, then ``m_name`` must be used to specify that
|
||||||
argument, to avoid a collision with the ``name`` argument. For example:
|
argument, to avoid a collision with the ``name`` argument. For example:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user