New configuration option to disable lspci queries for GPU data on master.

This commit is contained in:
Mike Place 2013-10-21 15:20:47 -06:00
parent e77f7eb985
commit 5aa4691a09
3 changed files with 17 additions and 1 deletions

View File

@ -90,6 +90,12 @@
# Set the directory used to hold unix sockets
#sock_dir: /var/run/salt/master
# The master can take a while to start up when lspci and/or dmidecode is used
# to populate the grains for the master. Enable if you want to see GPU hardware
# data for your master.
#
# enable_gpu_grains: False
# The master maintains a job cache, while this is a great addition it can be
# a burden on the master for larger deployments (over 5000 minions).
# Disabling the job cache will make previously executed jobs unavailable to

View File

@ -166,6 +166,7 @@ VALID_OPTS = {
'win_gitrepos': list,
'modules_max_memory': int,
'grains_refresh_every': int,
'enable_lspci': bool,
}
# default configurations
@ -347,9 +348,10 @@ DEFAULT_MASTER_OPTS = {
'loop_interval': 60,
'nodegroups': {},
'cython_enable': False,
'enable_gpu_grains': False,
# XXX: Remove 'key_logfile' support in 0.18.0
'key_logfile': os.path.join(syspaths.LOGS_DIR, 'key'),
'verify_env': True,
'verify_env': False,
'permissive_pki_access': False,
'default_include': 'master.d/*.conf',
'win_repo': os.path.join(syspaths.BASE_FILE_ROOTS_DIR, 'win', 'repo'),

View File

@ -143,6 +143,14 @@ def _linux_gpu_data():
)
return {}
elif not __opts__.get('enable_gpu_grains', None):
log.debug(__opts__.get('enable_gpu_grains', None))
log.info(
'Skipping lspci call because enable_gpu_grains was set to False in the config. '
'GPU grains will not be available.'
)
return {}
# dominant gpu vendors to search for (MUST be lowercase for matching below)
known_vendors = ['nvidia', 'amd', 'ati', 'intel']