Skip to content
Merged
35 changes: 35 additions & 0 deletions doc/ref/configuration/minion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,41 @@ have other services that need to go with it.

update_restart_services: ['salt-minion']

.. conf_minion:: winrepo_cache_expire_min

``winrepo_cache_expire_min``
----------------------------

.. versionadded:: Carbon

Default: ``0``

If set to a nonzero integer, then passing ``refresh=True`` to functions in the
:mod:`windows pkg module <salt.modules.win_pkg>` will not refresh the windows
repo metadata if the age of the metadata is less than this value. The exception
to this is :py:func:`pkg.refresh_db <salt.modules.win_pkg.refresh_db>`, which
will always refresh the metadata, regardless of age.

.. code-block:: yaml

winrepo_cache_expire_min: 1800

.. conf_minion:: winrepo_cache_expire_max

``winrepo_cache_expire_max``
----------------------------

.. versionadded:: Carbon

Default: ``21600``

If the windows repo metadata is older than this value, and the metadata is
needed by a function in the :mod:`windows pkg module <salt.modules.win_pkg>`,
the metadata will be refreshed.

.. code-block:: yaml

winrepo_cache_expire_max: 86400

.. _winrepo-minion-config-opts:

Expand Down
4 changes: 4 additions & 0 deletions salt/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,8 @@ def _gather_buffer_space():
'winrepo_dir': str,
'winrepo_dir_ng': str,
'winrepo_cachefile': str,
'winrepo_cache_expire_max': int,
'winrepo_cache_expire_min': int,
'winrepo_remotes': list,
'winrepo_remotes_ng': list,
'winrepo_branch': str,
Expand Down Expand Up @@ -1079,6 +1081,8 @@ def _gather_buffer_space():
'winrepo_dir': os.path.join(salt.syspaths.BASE_FILE_ROOTS_DIR, 'win', 'repo'),
'winrepo_dir_ng': os.path.join(salt.syspaths.BASE_FILE_ROOTS_DIR, 'win', 'repo-ng'),
'winrepo_cachefile': 'winrepo.p',
'winrepo_cache_expire_max': 21600,
'winrepo_cache_expire_min': 0,
'winrepo_remotes': ['https://github.com/saltstack/salt-winrepo.git'],
'winrepo_remotes_ng': ['https://github.com/saltstack/salt-winrepo-ng.git'],
'winrepo_branch': 'master',
Expand Down
Loading