updating requisite documentation to include cmd_opts_exclude.

This commit is contained in:
Gareth J. Greenaway 2023-03-28 12:08:11 -07:00 committed by Megan Wilhite
parent 1a2e2c0c98
commit 35fb908059

View file

@ -917,6 +917,29 @@ In the above case, ``some_check`` will be run prior to _each_ name -- once for
key: not-existing
get_return: res
.. versionchanged:: 3006
Since the ``unless`` requisite utilizes ``cmd.retcode``, certain parameters
included in the state are passed along to ``cmd.retcode``. On occasion this
can cause issues, particularly if the ``shell`` option in a ``user.present``
is set to /sbin/nologin and this shell is passed along to ``cmd.retcode``.
This would cause ``cmd.retcode`` to run the command using that shell which
would fail regardless of the result of the command.
By include ``shell`` in ``cmd_opts_exclude``, that parameter would not be
passed along to the call to ``cmd.retcode``.
.. code-block:: yaml
jim_nologin:
user.present:
- name: jim
- shell: /sbin/nologin
- unless:
- echo hello world
- cmd_opts_exclude:
- shell
.. _onlyif-requisite:
onlyif
@ -1005,6 +1028,28 @@ if the gluster commands return a 0 ret value.
key: does-exist
get_return: res
.. versionchanged:: 3006
Since the ``onlyif`` requisite utilizes ``cmd.retcode``, certain parameters
included in the state are passed along to ``cmd.retcode``. On occasion this
can cause issues, particularly if the ``shell`` option in a ``user.present``
is set to /sbin/nologin and this shell is passed along to ``cmd.retcode``.
This would cause ``cmd.retcode`` to run the command using that shell which
would fail regardless of the result of the command.
By include ``shell`` in ``cmd_opts_exclude``, that parameter would not be
passed along to the call to ``cmd.retcode``.
.. code-block:: yaml
jim_nologin:
user.present:
- name: jim
- shell: /sbin/nologin
- onlyif:
- echo hello world
- cmd_opts_exclude:
- shell
.. _creates-requisite: