mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
enable_fqdns_grains default to false on Windows
This commit is contained in:
parent
a148efbc94
commit
443be978ea
4 changed files with 36 additions and 1 deletions
10
conf/minion
10
conf/minion
|
@ -157,6 +157,16 @@
|
||||||
# Set the directory used to hold unix sockets.
|
# Set the directory used to hold unix sockets.
|
||||||
#sock_dir: /var/run/salt/minion
|
#sock_dir: /var/run/salt/minion
|
||||||
|
|
||||||
|
# In order to calculate the fqdns grain, all the IP addresses from the minion
|
||||||
|
# are processed with underlying calls to `socket.gethostbyaddr` which can take
|
||||||
|
# 5 seconds to be released (after reaching `socket.timeout`) when there is no
|
||||||
|
# fqdn for that IP. These calls to `socket.gethostbyaddr` are processed
|
||||||
|
# asynchronously, however, it still adds 5 seconds every time grains are
|
||||||
|
# generated if an IP does not resolve. In Windows grains are regenerated each
|
||||||
|
# time a new process is spawned. Therefore, the default for Windows is `False`.
|
||||||
|
# All other OSes default to `True`
|
||||||
|
# enable_fqdn_grains: True
|
||||||
|
|
||||||
# The minion can take a while to start up when lspci and/or dmidecode is used
|
# The minion can take a while to start up when lspci and/or dmidecode is used
|
||||||
# to populate the grains for the minion. Set this to False if you do not need
|
# to populate the grains for the minion. Set this to False if you do not need
|
||||||
# GPU hardware grains for your minion.
|
# GPU hardware grains for your minion.
|
||||||
|
|
|
@ -1053,6 +1053,26 @@ The directory where Unix sockets will be kept.
|
||||||
|
|
||||||
sock_dir: /var/run/salt/minion
|
sock_dir: /var/run/salt/minion
|
||||||
|
|
||||||
|
.. conf_minion:: enable_fqdns_grains
|
||||||
|
|
||||||
|
``enable_fqdns_grains``
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Default: ``True``
|
||||||
|
|
||||||
|
In order to calculate the fqdns grain, all the IP addresses from the minion are
|
||||||
|
processed with underlying calls to ``socket.gethostbyaddr`` which can take 5 seconds
|
||||||
|
to be released (after reaching ``socket.timeout``) when there is no fqdn for that IP.
|
||||||
|
These calls to ``socket.gethostbyaddr`` are processed asynchronously, however, it still
|
||||||
|
adds 5 seconds every time grains are generated if an IP does not resolve. In Windows
|
||||||
|
grains are regenerated each time a new process is spawned. Therefore, the default for
|
||||||
|
Windows is ``False``. All other OSes default to ``True``. This options was
|
||||||
|
added `here <https://github.com/saltstack/salt/pull/55581>`_.
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
enable_fqdns_grains: False
|
||||||
|
|
||||||
.. conf_minion:: enable_gpu_grains
|
.. conf_minion:: enable_gpu_grains
|
||||||
|
|
||||||
``enable_gpu_grains``
|
``enable_gpu_grains``
|
||||||
|
|
|
@ -66,12 +66,14 @@ if salt.utils.platform.is_windows():
|
||||||
# support in ZeroMQ, we want the default to be something that has a
|
# support in ZeroMQ, we want the default to be something that has a
|
||||||
# chance of working.
|
# chance of working.
|
||||||
_DFLT_IPC_MODE = "tcp"
|
_DFLT_IPC_MODE = "tcp"
|
||||||
|
_DFLT_FQDNS_GRAINS = False
|
||||||
_MASTER_TRIES = -1
|
_MASTER_TRIES = -1
|
||||||
# This needs to be SYSTEM in order for salt-master to run as a Service
|
# This needs to be SYSTEM in order for salt-master to run as a Service
|
||||||
# Otherwise, it will not respond to CLI calls
|
# Otherwise, it will not respond to CLI calls
|
||||||
_MASTER_USER = "SYSTEM"
|
_MASTER_USER = "SYSTEM"
|
||||||
else:
|
else:
|
||||||
_DFLT_IPC_MODE = "ipc"
|
_DFLT_IPC_MODE = "ipc"
|
||||||
|
_DFLT_FQDNS_GRAINS = True
|
||||||
_MASTER_TRIES = 1
|
_MASTER_TRIES = 1
|
||||||
_MASTER_USER = salt.utils.user.get_user()
|
_MASTER_USER = salt.utils.user.get_user()
|
||||||
|
|
||||||
|
@ -352,6 +354,8 @@ VALID_OPTS = immutabletypes.freeze(
|
||||||
"test": bool,
|
"test": bool,
|
||||||
# Tell the loader to attempt to import *.pyx cython files if cython is available
|
# Tell the loader to attempt to import *.pyx cython files if cython is available
|
||||||
"cython_enable": bool,
|
"cython_enable": bool,
|
||||||
|
# Whether or not to load grains for FQDNs
|
||||||
|
"enable_fqdns_grains": bool,
|
||||||
# Whether or not to load grains for the GPU
|
# Whether or not to load grains for the GPU
|
||||||
"enable_gpu_grains": bool,
|
"enable_gpu_grains": bool,
|
||||||
# Tell the loader to attempt to import *.zip archives
|
# Tell the loader to attempt to import *.zip archives
|
||||||
|
@ -1133,6 +1137,7 @@ DEFAULT_MINION_OPTS = immutabletypes.freeze(
|
||||||
"test": False,
|
"test": False,
|
||||||
"ext_job_cache": "",
|
"ext_job_cache": "",
|
||||||
"cython_enable": False,
|
"cython_enable": False,
|
||||||
|
"enable_fqdns_grains": _DFLT_FQDNS_GRAINS,
|
||||||
"enable_gpu_grains": True,
|
"enable_gpu_grains": True,
|
||||||
"enable_zip_modules": False,
|
"enable_zip_modules": False,
|
||||||
"state_verbose": True,
|
"state_verbose": True,
|
||||||
|
|
|
@ -2352,7 +2352,7 @@ def fqdns():
|
||||||
# Provides:
|
# Provides:
|
||||||
# fqdns
|
# fqdns
|
||||||
opt = {"fqdns": []}
|
opt = {"fqdns": []}
|
||||||
if __opts__.get("enable_fqdns_grains", True):
|
if __opts__.get("enable_fqdns_grains", False if salt.utils.platform.is_windows() else True):
|
||||||
opt = __salt__["network.fqdns"]()
|
opt = __salt__["network.fqdns"]()
|
||||||
return opt
|
return opt
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue