Saltstack Official Salt Formula
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

986 lines
40KB

  1. # This file managed by Salt, do not edit by hand!!
  2. # Based on salt version 2015.8.7 default config
  3. #
  4. {% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs'] -%}
  5. {% set cfg_salt = pillar.get('salt', {}) -%}
  6. {% set cfg_minion = cfg_salt.get('minion', {}) -%}
  7. {%- macro get_config(configname, default_value) -%}
  8. {%- if configname in cfg_minion -%}
  9. {{ configname }}: {{ cfg_minion[configname]|json }}
  10. {%- elif configname in cfg_salt and configname not in reserved_keys -%}
  11. {{ configname }}: {{ cfg_salt[configname]|json }}
  12. {%- else -%}
  13. #{{ configname }}: {{ default_value|json }}
  14. {%- endif -%}
  15. {%- endmacro -%}
  16. {%- from 'salt/formulas.jinja' import file_roots, formulas with context -%}
  17. ##### Primary configuration settings #####
  18. ##########################################
  19. # This configuration file is used to manage the behavior of the Salt Minion.
  20. # With the exception of the location of the Salt Master Server, values that are
  21. # commented out but have an empty line after the comment are defaults that need
  22. # not be set in the config. If there is no blank line after the comment, the
  23. # value is presented as an example and is not the default.
  24. # Per default the minion will automatically include all config files
  25. # from minion.d/*.conf (minion.d is a directory in the same directory
  26. # as the main minion config file).
  27. {{ get_config('default_include', 'minion.d/*.conf') }}
  28. # Set the location of the salt master server. If the master server cannot be
  29. # resolved, then the minion will fail to start.
  30. {%- if 'master' in cfg_minion and cfg_minion['master'] is not string %}
  31. master:
  32. {% for name in cfg_minion['master'] -%}
  33. - {{ name }}
  34. {% endfor -%}
  35. {%- else %}
  36. {{ get_config('master', 'salt') }}
  37. {%- endif %}
  38. # If multiple masters are specified in the 'master' setting, the default behavior
  39. # is to always try to connect to them in the order they are listed. If random_master is
  40. # set to True, the order will be randomized instead. This can be helpful in distributing
  41. # the load of many minions executing salt-call requests, for example, from a cron job.
  42. # If only one master is listed, this setting is ignored and a warning will be logged.
  43. # NOTE: If master_type is set to failover, use master_shuffle instead.
  44. {{ get_config('random_master', 'False') }}
  45. # Use if master_type is set to failover.
  46. {{ get_config('master_shuffle', 'False') }}
  47. # Minions can connect to multiple masters simultaneously (all masters
  48. # are "hot"), or can be configured to failover if a master becomes
  49. # unavailable. Multiple hot masters are configured by setting this
  50. # value to "str". Failover masters can be requested by setting
  51. # to "failover". MAKE SURE TO SET master_alive_interval if you are
  52. # using failover.
  53. {{ get_config('master_type', 'str') }}
  54. # verify_master_pubkey_sign
  55. {{ get_config('verify_master_pubkey_sign', 'False') }}
  56. # Poll interval in seconds for checking if the master is still there. Only
  57. # respected if master_type above is "failover". To disable the interval entirely,
  58. # set the value to -1. (This may be necessary on machines which have high numbers
  59. # of TCP connections, such as load balancers.)
  60. {{ get_config('master_alive_interval', '30') }}
  61. # Set whether the minion should connect to the master via IPv6:
  62. {{ get_config('ipv6', 'False') }}
  63. # Set the number of seconds to wait before attempting to resolve
  64. # the master hostname if name resolution fails. Defaults to 30 seconds.
  65. # Set to zero if the minion should shutdown and not retry.
  66. {{ get_config('retry_dns', '30') }}
  67. # Set the port used by the master reply and authentication server.
  68. {{ get_config('master_port', '4506') }}
  69. # The user to run salt.
  70. {{ get_config('user', 'root') }}
  71. # Setting sudo_user will cause salt to run all execution modules under an sudo
  72. # to the user given in sudo_user. The user under which the salt minion process
  73. # itself runs will still be that provided in the user config above, but all
  74. # execution modules run by the minion will be rerouted through sudo.
  75. {{ get_config('sudo_user', 'saltdev') }}
  76. # Specify the location of the daemon process ID file.
  77. {{ get_config('pidfile', '/var/run/salt-minion.pid') }}
  78. # The root directory prepended to these options: pki_dir, cachedir, log_file,
  79. # sock_dir, pidfile.
  80. {{ get_config('root_dir', '/') }}
  81. # The directory to store the pki information in
  82. {{ get_config('pki_dir', '/etc/salt/pki/minion') }}
  83. # Explicitly declare the id for this minion to use, if left commented the id
  84. # will be the hostname as returned by the python call: socket.getfqdn()
  85. # Since salt uses detached ids it is possible to run multiple minions on the
  86. # same machine but with different ids, this can be useful for salt compute
  87. # clusters.
  88. {% if 'id' in cfg_minion -%}
  89. id: {{ cfg_minion['id'] }}
  90. {% else -%}
  91. #id:
  92. {%- endif %}
  93. # Append a domain to a hostname in the event that it does not exist. This is
  94. # useful for systems where socket.getfqdn() does not actually result in a
  95. # FQDN (for instance, Solaris).
  96. {{ get_config('append_domain', '') }}
  97. # Custom static grains for this minion can be specified here and used in SLS
  98. # files just like all other grains. This example sets 4 custom grains, with
  99. # the 'roles' grain having two values that can be matched against.
  100. #grains:
  101. # roles:
  102. # - webserver
  103. # - memcache
  104. # deployment: datacenter4
  105. # cabinet: 13
  106. # cab_u: 14-15
  107. {{ get_config('grains', '{}') }}
  108. # Where cache data goes.
  109. # This data may contain sensitive data and should be protected accordingly.
  110. {{ get_config('cachedir', '/var/cache/salt/minion') }}
  111. # Verify and set permissions on configuration directories at startup.
  112. {{ get_config('verify_env', 'True') }}
  113. # The minion can locally cache the return data from jobs sent to it, this
  114. # can be a good way to keep track of jobs the minion has executed
  115. # (on the minion side). By default this feature is disabled, to enable, set
  116. # cache_jobs to True.
  117. {{ get_config('cache_jobs', 'False') }}
  118. # Set the directory used to hold unix sockets.
  119. {{ get_config('sock_dir', '/var/run/salt/minion') }}
  120. # Set the default outputter used by the salt-call command. The default is
  121. # "nested".
  122. {{ get_config('output', 'nested') }}
  123. # By default output is colored. To disable colored output, set the color value
  124. # to False.
  125. {{ get_config('color', 'True') }}
  126. # Do not strip off the colored output from nested results and state outputs
  127. # (true by default).
  128. {{ get_config('strip_colors', 'False') }}
  129. # Backup files that are replaced by file.managed and file.recurse under
  130. # 'cachedir'/file_backups relative to their original location and appended
  131. # with a timestamp. The only valid setting is "minion". Disabled by default.
  132. #
  133. # Alternatively this can be specified for each file in state files:
  134. # /etc/ssh/sshd_config:
  135. # file.managed:
  136. # - source: salt://ssh/sshd_config
  137. # - backup: minion
  138. #
  139. {{ get_config('backup_mode', 'minion') }}
  140. # When waiting for a master to accept the minion's public key, salt will
  141. # continuously attempt to reconnect until successful. This is the time, in
  142. # seconds, between those reconnection attempts.
  143. {{ get_config('acceptance_wait_time', '10') }}
  144. # If this is nonzero, the time between reconnection attempts will increase by
  145. # acceptance_wait_time seconds per iteration, up to this maximum. If this is
  146. # set to zero, the time between reconnection attempts will stay constant.
  147. {{ get_config('acceptance_wait_time_max', '0') }}
  148. # If the master rejects the minion's public key, retry instead of exiting.
  149. # Rejected keys will be handled the same as waiting on acceptance.
  150. {{ get_config('rejected_retry', 'False') }}
  151. # When the master key changes, the minion will try to re-auth itself to receive
  152. # the new master key. In larger environments this can cause a SYN flood on the
  153. # master because all minions try to re-auth immediately. To prevent this and
  154. # have a minion wait for a random amount of time, use this optional parameter.
  155. # The wait-time will be a random number of seconds between 0 and the defined value.
  156. {{ get_config('random_reauth_delay', '60') }}
  157. # When waiting for a master to accept the minion's public key, salt will
  158. # continuously attempt to reconnect until successful. This is the timeout value,
  159. # in seconds, for each individual attempt. After this timeout expires, the minion
  160. # will wait for acceptance_wait_time seconds before trying again. Unless your master
  161. # is under unusually heavy load, this should be left at the default.
  162. {{ get_config('auth_timeout', '60') }}
  163. # Number of consecutive SaltReqTimeoutError that are acceptable when trying to
  164. # authenticate.
  165. {{ get_config('auth_tries', '7') }}
  166. # If authentication fails due to SaltReqTimeoutError during a ping_interval,
  167. # cause sub minion process to restart.
  168. {{ get_config('auth_safemode', 'False') }}
  169. # Ping Master to ensure connection is alive (minutes).
  170. {{ get_config('ping_interval', '0') }}
  171. {%- if 'mine_functions' in cfg_minion %}
  172. mine_functions:
  173. {%- for func, args in cfg_minion['mine_functions'].items() %}
  174. {{ func }}: {{ args }}
  175. {%- endfor %}
  176. {%- endif %}
  177. # To auto recover minions if master changes IP address (DDNS)
  178. # auth_tries: 10
  179. # auth_safemode: False
  180. # ping_interval: 90
  181. #
  182. # Minions won't know master is missing until a ping fails. After the ping fail,
  183. # the minion will attempt authentication and likely fails out and cause a restart.
  184. # When the minion restarts it will resolve the masters IP and attempt to reconnect.
  185. # If you don't have any problems with syn-floods, don't bother with the
  186. # three recon_* settings described below, just leave the defaults!
  187. #
  188. # The ZeroMQ pull-socket that binds to the masters publishing interface tries
  189. # to reconnect immediately, if the socket is disconnected (for example if
  190. # the master processes are restarted). In large setups this will have all
  191. # minions reconnect immediately which might flood the master (the ZeroMQ-default
  192. # is usually a 100ms delay). To prevent this, these three recon_* settings
  193. # can be used.
  194. # recon_default: the interval in milliseconds that the socket should wait before
  195. # trying to reconnect to the master (1000ms = 1 second)
  196. #
  197. # recon_max: the maximum time a socket should wait. each interval the time to wait
  198. # is calculated by doubling the previous time. if recon_max is reached,
  199. # it starts again at recon_default. Short example:
  200. #
  201. # reconnect 1: the socket will wait 'recon_default' milliseconds
  202. # reconnect 2: 'recon_default' * 2
  203. # reconnect 3: ('recon_default' * 2) * 2
  204. # reconnect 4: value from previous interval * 2
  205. # reconnect 5: value from previous interval * 2
  206. # reconnect x: if value >= recon_max, it starts again with recon_default
  207. #
  208. # recon_randomize: generate a random wait time on minion start. The wait time will
  209. # be a random value between recon_default and recon_default +
  210. # recon_max. Having all minions reconnect with the same recon_default
  211. # and recon_max value kind of defeats the purpose of being able to
  212. # change these settings. If all minions have the same values and your
  213. # setup is quite large (several thousand minions), they will still
  214. # flood the master. The desired behavior is to have timeframe within
  215. # all minions try to reconnect.
  216. #
  217. # Example on how to use these settings. The goal: have all minions reconnect within a
  218. # 60 second timeframe on a disconnect.
  219. # recon_default: 1000
  220. # recon_max: 59000
  221. # recon_randomize: True
  222. #
  223. # Each minion will have a randomized reconnect value between 'recon_default'
  224. # and 'recon_default + recon_max', which in this example means between 1000ms
  225. # 60000ms (or between 1 and 60 seconds). The generated random-value will be
  226. # doubled after each attempt to reconnect. Lets say the generated random
  227. # value is 11 seconds (or 11000ms).
  228. # reconnect 1: wait 11 seconds
  229. # reconnect 2: wait 22 seconds
  230. # reconnect 3: wait 33 seconds
  231. # reconnect 4: wait 44 seconds
  232. # reconnect 5: wait 55 seconds
  233. # reconnect 6: wait time is bigger than 60 seconds (recon_default + recon_max)
  234. # reconnect 7: wait 11 seconds
  235. # reconnect 8: wait 22 seconds
  236. # reconnect 9: wait 33 seconds
  237. # reconnect x: etc.
  238. #
  239. # In a setup with ~6000 thousand hosts these settings would average the reconnects
  240. # to about 100 per second and all hosts would be reconnected within 60 seconds.
  241. {{ get_config('recon_default', '100') }}
  242. {{ get_config('recon_max', '5000') }}
  243. {{ get_config('recon_randomize', 'False') }}
  244. # The loop_interval sets how long in seconds the minion will wait between
  245. # evaluating the scheduler and running cleanup tasks. This defaults to a
  246. # sane 60 seconds, but if the minion scheduler needs to be evaluated more
  247. # often lower this value
  248. {{ get_config('loop_interval', '60') }}
  249. # The grains_refresh_every setting allows for a minion to periodically check
  250. # its grains to see if they have changed and, if so, to inform the master
  251. # of the new grains. This operation is moderately expensive, therefore
  252. # care should be taken not to set this value too low.
  253. #
  254. # Note: This value is expressed in __minutes__!
  255. #
  256. # A value of 10 minutes is a reasonable default.
  257. #
  258. # If the value is set to zero, this check is disabled.
  259. {{ get_config('grains_refresh_every', '1') }}
  260. # Cache grains on the minion. Default is False.
  261. {{ get_config('grains_cache', 'False') }}
  262. # Grains cache expiration, in seconds. If the cache file is older than this
  263. # number of seconds then the grains cache will be dumped and fully re-populated
  264. # with fresh data. Defaults to 5 minutes. Will have no effect if 'grains_cache'
  265. # is not enabled.
  266. {{ get_config('grains_cache_expiration', '300') }}
  267. # Windows platforms lack posix IPC and must rely on slower TCP based inter-
  268. # process communications. Set ipc_mode to 'tcp' on such systems
  269. {{ get_config('ipc_mode', 'ipc') }}
  270. # Overwrite the default tcp ports used by the minion when in tcp mode
  271. {{ get_config('tcp_pub_port', '4510') }}
  272. {{ get_config('tcp_pull_port', '4511') }}
  273. # Passing very large events can cause the minion to consume large amounts of
  274. # memory. This value tunes the maximum size of a message allowed onto the
  275. # minion event bus. The value is expressed in bytes.
  276. {{ get_config('max_event_size', '1048576') }}
  277. # To detect failed master(s) and fire events on connect/disconnect, set
  278. # master_alive_interval to the number of seconds to poll the masters for
  279. # connection events.
  280. #
  281. {{ get_config('master_alive_interval', '30') }}
  282. # The minion can include configuration from other files. To enable this,
  283. # pass a list of paths to this option. The paths can be either relative or
  284. # absolute; if relative, they are considered to be relative to the directory
  285. # the main minion configuration file lives in (this file). Paths can make use
  286. # of shell-style globbing. If no files are matched by a path passed to this
  287. # option then the minion will log a warning message.
  288. #
  289. # Include a config file from some other path:
  290. {% if 'include' in cfg_minion -%}
  291. {% if isinstance(cfg_minion['include'], list) -%}
  292. include:
  293. {% for include in cfg_minion['include'] -%}
  294. - {{ include }}
  295. {% endfor -%}
  296. {% else -%}
  297. include: cfg_minion['include']
  298. {% endif -%}
  299. {% elif 'include' in cfg_salt -%}
  300. {% if isinstance(cfg_salt['include'], list) -%}
  301. include:
  302. {% for include in cfg_salt['include'] -%}
  303. - {{ include }}
  304. {% endfor -%}
  305. {% else -%}
  306. include: cfg_salt['include']
  307. {% endif -%}
  308. {% endif -%}
  309. ##### Minion module management #####
  310. ##########################################
  311. # Disable specific modules. This allows the admin to limit the level of
  312. # access the master has to the minion.
  313. {{ get_config('disable_modules', '[cmd,test]') }}
  314. {{ get_config('disable_returners', '[]') }}
  315. # Modules can be loaded from arbitrary paths. This enables the easy deployment
  316. # of third party modules. Modules for returners and minions can be loaded.
  317. # Specify a list of extra directories to search for minion modules and
  318. # returners. These paths must be fully qualified!
  319. {{ get_config('module_dirs', '[]') }}
  320. {{ get_config('returner_dirs', '[]') }}
  321. {{ get_config('states_dirs', '[]') }}
  322. {{ get_config('render_dirs', '[]') }}
  323. {{ get_config('utils_dirs', '[]') }}
  324. # A module provider can be statically overwritten or extended for the minion
  325. # via the providers option, in this case the default module will be
  326. # overwritten by the specified module. In this example the pkg module will
  327. # be provided by the yumpkg5 module instead of the system default.
  328. #providers:
  329. # pkg: yumpkg5
  330. {{ get_config('providers', '{}') }}
  331. # Enable Cython modules searching and loading. (Default: False)
  332. {{ get_config('cython_enable', 'False') }}
  333. # Specify a max size (in bytes) for modules on import. This feature is currently
  334. # only supported on *nix operating systems and requires psutil.
  335. {{ get_config('modules_max_memory', '-1') }}
  336. ##### State Management Settings #####
  337. ###########################################
  338. # The state management system executes all of the state templates on the minion
  339. # to enable more granular control of system state management. The type of
  340. # template and serialization used for state management needs to be configured
  341. # on the minion, the default renderer is yaml_jinja. This is a yaml file
  342. # rendered from a jinja template, the available options are:
  343. # yaml_jinja
  344. # yaml_mako
  345. # yaml_wempy
  346. # json_jinja
  347. # json_mako
  348. # json_wempy
  349. #
  350. {{ get_config('renderer', 'yaml_jinja') }}
  351. # The failhard option tells the minions to stop immediately after the first
  352. # failure detected in the state execution. Defaults to False.
  353. {{ get_config('failhard', 'False') }}
  354. # Reload the modules prior to a highstate run.
  355. {{ get_config('autoload_dynamic_modules', 'True') }}
  356. # clean_dynamic_modules keeps the dynamic modules on the minion in sync with
  357. # the dynamic modules on the master, this means that if a dynamic module is
  358. # not on the master it will be deleted from the minion. By default, this is
  359. # enabled and can be disabled by changing this value to False.
  360. {{ get_config('clean_dynamic_modules', 'True') }}
  361. # Normally, the minion is not isolated to any single environment on the master
  362. # when running states, but the environment can be isolated on the minion side
  363. # by statically setting it. Remember that the recommended way to manage
  364. # environments is to isolate via the top file.
  365. {{ get_config('environment', 'None') }}
  366. # If using the local file directory, then the state top file name needs to be
  367. # defined, by default this is top.sls.
  368. {{ get_config('state_top', 'top.sls') }}
  369. # Run states when the minion daemon starts. To enable, set startup_states to:
  370. # 'highstate' -- Execute state.highstate
  371. # 'sls' -- Read in the sls_list option and execute the named sls files
  372. # 'top' -- Read top_file option and execute based on that file on the Master
  373. {{ get_config('startup_states', "''") }}
  374. # List of states to run when the minion starts up if startup_states is 'sls':
  375. #sls_list:
  376. # - edit.vim
  377. # - hyper
  378. {{ get_config('sls_list', '[]') }}
  379. # Top file to execute if startup_states is 'top':
  380. {{ get_config('top_file', "''") }}
  381. # Automatically aggregate all states that have support for mod_aggregate by
  382. # setting to True. Or pass a list of state module names to automatically
  383. # aggregate just those types.
  384. #
  385. # state_aggregate:
  386. # - pkg
  387. #
  388. #state_aggregate: False
  389. {{ get_config('state_aggregate', '{}') }}
  390. ##### File Directory Settings #####
  391. ##########################################
  392. # The Salt Minion can redirect all file server operations to a local directory,
  393. # this allows for the same state tree that is on the master to be used if
  394. # copied completely onto the minion. This is a literal copy of the settings on
  395. # the master but used to reference a local directory on the minion.
  396. # Set the file client. The client defaults to looking on the master server for
  397. # files, but can be directed to look at the local file directory setting
  398. # defined below by setting it to "local". Setting a local file_client runs the
  399. # minion in masterless mode.
  400. {%- if standalone %}
  401. file_client: local
  402. {%- else %}
  403. {{ get_config('file_client', 'remote') }}
  404. {%- endif %}
  405. # The file directory works on environments passed to the minion, each environment
  406. # can have multiple root directories, the subdirectories in the multiple file
  407. # roots cannot match, otherwise the downloaded files will not be able to be
  408. # reliably ensured. A base environment is required to house the top file.
  409. # Example:
  410. # file_roots:
  411. # base:
  412. # - /srv/salt/
  413. # dev:
  414. # - /srv/salt/dev/services
  415. # - /srv/salt/dev/states
  416. # prod:
  417. # - /srv/salt/prod/services
  418. # - /srv/salt/prod/states
  419. {% if 'file_roots' in cfg_minion -%}
  420. {{ file_roots(cfg_minion['file_roots']) }}
  421. {%- elif 'file_roots' in cfg_salt -%}
  422. {{ file_roots(cfg_salt['file_roots']) }}
  423. {%- elif formulas|length -%}
  424. {{ file_roots({'base': ['/srv/salt']}) }}
  425. {%- else -%}
  426. #file_roots:
  427. # base:
  428. # - /srv/salt
  429. {%- endif %}
  430. # File Server Backend
  431. #
  432. # Salt supports a modular fileserver backend system, this system allows
  433. # the salt minion to link directly to third party systems to gather and
  434. # manage the files available to minions. Multiple backends can be
  435. # configured and will be searched for the requested file in the order in which
  436. # they are defined here. The default setting only enables the standard backend
  437. # "roots" which uses the "file_roots" option.
  438. #fileserver_backend:
  439. # - roots
  440. #
  441. # To use multiple backends list them in the order they are searched:
  442. #fileserver_backend:
  443. # - git
  444. # - roots
  445. {% if 'fileserver_backend' in cfg_minion -%}
  446. fileserver_backend:
  447. {%- for backend in cfg_minion['fileserver_backend'] %}
  448. - {{ backend }}
  449. {%- endfor -%}
  450. {%- endif %}
  451. # By default, the Salt fileserver recurses fully into all defined environments
  452. # to attempt to find files. To limit this behavior so that the fileserver only
  453. # traverses directories with SLS files and special Salt directories like _modules,
  454. # enable the option below. This might be useful for installations where a file root
  455. # has a very large number of files and performance is negatively impacted. Default
  456. # is False.
  457. {{ get_config('fileserver_limit_traversal', 'False') }}
  458. # The hash_type is the hash to use when discovering the hash of a file in
  459. # the local fileserver. The default is md5, but sha1, sha224, sha256, sha384
  460. # and sha512 are also supported.
  461. #
  462. # Warning: Prior to changing this value, the minion should be stopped and all
  463. # Salt caches should be cleared.
  464. {{ get_config('hash_type', 'md5') }}
  465. # gitfs provider
  466. {{ get_config('gitfs_provider', 'pygit2') }}
  467. # Along with gitfs_password, is used to authenticate to HTTPS remotes.
  468. {{ get_config('gitfs_user', 'git') }}
  469. # Along with gitfs_user, is used to authenticate to HTTPS remotes.
  470. # This parameter is not required if the repository does not use authentication.
  471. {{ get_config('gitfs_password', '') }}
  472. # By default, Salt will not authenticate to an HTTP (non-HTTPS) remote.
  473. # This parameter enables authentication over HTTP. Enable this at your own risk.
  474. {{ get_config('gitfs_insecure_auth', 'False') }}
  475. # Along with gitfs_privkey (and optionally gitfs_passphrase), is used to
  476. # authenticate to SSH remotes. This parameter (or its per-remote counterpart)
  477. # is required for SSH remotes.
  478. {{ get_config('gitfs_pubkey', '') }}
  479. # Along with gitfs_pubkey (and optionally gitfs_passphrase), is used to
  480. # authenticate to SSH remotes. This parameter (or its per-remote counterpart)
  481. # is required for SSH remotes.
  482. {{ get_config('gitfs_privkey', '') }}
  483. # This parameter is optional, required only when the SSH key being used to
  484. # authenticate is protected by a passphrase.
  485. {{ get_config('gitfs_passphrase', '') }}
  486. # When using the git fileserver backend at least one git remote needs to be
  487. # defined. The user running the salt master will need read access to the repo.
  488. #
  489. # The repos will be searched in order to find the file requested by a client
  490. # and the first repo to have the file will return it.
  491. # When using the git backend branches and tags are translated into salt
  492. # environments.
  493. # Note: file:// repos will be treated as a remote, so refs you want used must
  494. # exist in that repo as *local* refs.
  495. {% if 'gitfs_remotes' in cfg_minion -%}
  496. gitfs_remotes:
  497. {%- for remote in cfg_minion['gitfs_remotes'] %}
  498. {%- if remote is iterable and remote is not string %}
  499. {%- for repo, children in remote.items() %}
  500. - {{ repo }}:
  501. {%- for child in children %}
  502. {%- for key, value in child.items() %}
  503. - {{ key }}: {{ value }}
  504. {%- endfor -%}
  505. {%- endfor -%}
  506. {%- endfor -%}
  507. {%- else %}
  508. - {{ remote }}
  509. {%- endif -%}
  510. {%- endfor -%}
  511. {%- endif %}
  512. # The gitfs_ssl_verify option specifies whether to ignore ssl certificate
  513. # errors when contacting the gitfs backend. You might want to set this to
  514. # false if you're using a git backend that uses a self-signed certificate but
  515. # keep in mind that setting this flag to anything other than the default of True
  516. # is a security concern, you may want to try using the ssh transport.
  517. {{ get_config('gitfs_ssl_verify', 'True') }}
  518. # The gitfs_root option gives the ability to serve files from a subdirectory
  519. # within the repository. The path is defined relative to the root of the
  520. # repository and defaults to the repository root.
  521. {{ get_config('gitfs_root', 'somefolder/otherfolder') }}
  522. # The gitfs_env_whitelist and gitfs_env_blacklist parameters allow for greater
  523. # control over which branches/tags are exposed as fileserver environments.
  524. {% if 'gitfs_env_whitelist' in cfg_minion -%}
  525. gitfs_env_whitelist:
  526. {%- for git_env in cfg_minion['gitfs_env_whitelist'] %}
  527. - {{ git_env }}
  528. {%- endfor -%}
  529. {% else -%}
  530. # gitfs_env_whitelist:
  531. # - base
  532. # - v1.*
  533. {% endif %}
  534. {% if 'gitfs_env_blacklist' in cfg_minion -%}
  535. gitfs_env_blacklist:
  536. {%- for git_env in cfg_minion['gitfs_env_blacklist'] %}
  537. - {{ git_env }}
  538. {%- endfor -%}
  539. {% else -%}
  540. # gitfs_env_blacklist:
  541. # - bug/*
  542. # - feature/*
  543. {% endif %}
  544. ##### Pillar settings #####
  545. ##########################################
  546. # The Salt pillar is searched for locally if file_client is set to local. If
  547. # this is the case, and pillar data is defined, then the pillar_roots need to
  548. # also be configured on the minion:
  549. {% if 'pillar_roots' in cfg_minion -%}
  550. pillar_roots:
  551. {%- for name, roots in cfg_minion['pillar_roots']|dictsort %}
  552. {{ name }}:
  553. {%- for dir in roots %}
  554. - {{ dir }}
  555. {%- endfor -%}
  556. {%- endfor -%}
  557. {% elif 'pillar_roots' in cfg_salt -%}
  558. pillar_roots:
  559. {%- for name, roots in cfg_salt['pillar_roots']|dictsort %}
  560. {{ name }}:
  561. {%- for dir in roots %}
  562. - {{ dir }}
  563. {%- endfor -%}
  564. {%- endfor -%}
  565. {%- else -%}
  566. #pillar_roots:
  567. # base:
  568. # - /srv/pillar
  569. {%- endif %}
  570. {% if 'ext_pillar' in cfg_minion %}
  571. ext_pillar:
  572. {%- for pillar in cfg_minion['ext_pillar'] -%}
  573. {%- for key in pillar -%}
  574. {%- if pillar[key] is string %}
  575. - {{ key }}: {{ pillar[key] }}
  576. {%- elif pillar[key] is iterable and pillar[key] is not mapping %}
  577. - {{ key }}:
  578. {%- for parameter in pillar[key] %}
  579. - {{ parameter }}
  580. {%- endfor -%}
  581. {%- elif pillar[key] is mapping and pillar[key] is not string %}
  582. - {{ key }}:
  583. {%- for parameter in pillar[key] %}
  584. {{ parameter }}: {{pillar[key][parameter]}}
  585. {%- endfor %}
  586. {%- else %}
  587. # Error in rendering {{ key }}, please read https://docs.saltstack.com/en/latest/topics/development/external_pillars.html#configuration
  588. {% endif %}
  589. {%- endfor -%}
  590. {%- endfor %}
  591. {% elif 'ext_pillar' in cfg_salt %}
  592. ext_pillar:
  593. {% for pillar in cfg_salt['ext_pillar'] %}
  594. - {{ pillar.items()[0][0] }}: {{ pillar.items()[0][1] }}
  595. {% endfor %}
  596. {% else %}
  597. #ext_pillar:
  598. # - hiera: /etc/hiera.yaml
  599. # - cmd_yaml: cat /etc/salt/yaml
  600. {% endif %}
  601. # The ext_pillar_first option allows for external pillar sources to populate
  602. # before file system pillar. This allows for targeting file system pillar from
  603. # ext_pillar.
  604. {{ get_config('ext_pillar_first', 'False') }}
  605. # The pillar_gitfs_ssl_verify option specifies whether to ignore ssl certificate
  606. # errors when contacting the pillar gitfs backend. You might want to set this to
  607. # false if you're using a git backend that uses a self-signed certificate but
  608. # keep in mind that setting this flag to anything other than the default of True
  609. # is a security concern, you may want to try using the ssh transport.
  610. {{ get_config('pillar_gitfs_ssl_verify', 'True') }}
  611. # The pillar_opts option adds the master configuration file data to a dict in
  612. # the pillar called "master". This is used to set simple configurations in the
  613. # master config file that can then be used on minions.
  614. {{ get_config('pillar_opts', 'True') }}
  615. # The pillar_safe_render_error option prevents the master from passing pillar
  616. # render errors to the minion. This is set on by default because the error could
  617. # contain templating data which would give that minion information it shouldn't
  618. # have, like a password! When set true the error message will only show:
  619. # Rendering SLS 'my.sls' failed. Please see master log for details.
  620. {{ get_config('pillar_safe_render_error', 'True') }}
  621. # The pillar_source_merging_strategy option allows you to configure merging strategy
  622. # between different sources. It accepts four values: recurse, aggregate, overwrite,
  623. # or smart. Recurse will merge recursively mapping of data. Aggregate instructs
  624. # aggregation of elements between sources that use the #!yamlex renderer. Overwrite
  625. # will verwrite elements according the order in which they are processed. This is
  626. # behavior of the 2014.1 branch and earlier. Smart guesses the best strategy based
  627. # on the "renderer" setting and is the default value.
  628. {{ get_config('pillar_source_merging_strategy', 'smart') }}
  629. # Recursively merge lists by aggregating them instead of replacing them.
  630. {{ get_config('pillar_merge_lists', False) }}
  631. # Git External Pillar (git_pillar) Configuration Options
  632. #
  633. # Specify the provider to be used for git_pillar. Must be either pygit2 or
  634. # gitpython. If unset, then both will be tried in that same order, and the
  635. # first one with a compatible version installed will be the provider that
  636. # is used.
  637. {{ get_config('git_pillar_provider', 'pygit2') }}
  638. # If the desired branch matches this value, and the environment is omitted
  639. # from the git_pillar configuration, then the environment for that git_pillar
  640. # remote will be base.
  641. {{ get_config('git_pillar_base', 'master') }}
  642. # If the branch is omitted from a git_pillar remote, then this branch will
  643. # be used instead.
  644. {{ get_config('git_pillar_branch', 'master') }}
  645. # Environment to use for git_pillar remotes. This is normally derived from
  646. # the branch/tag (or from a per-remote env parameter), but if set this will
  647. # override the process of deriving the env from the branch/tag name.
  648. {{ get_config('git_pillar_env', '') }}
  649. # Path relative to the root of the repository where the git_pillar top file
  650. # and SLS files are located.
  651. {{ get_config('git_pillar_root', 'pillar') }}
  652. # Specifies whether or not to ignore SSL certificate errors when contacting
  653. # the remote repository.
  654. {{ get_config('git_pillar_ssl_verify', True) }}
  655. # When set to False, if there is an update/checkout lock for a git_pillar
  656. # remote and the pid written to it is not running on the master, the lock
  657. # file will be automatically cleared and a new lock will be obtained.
  658. {{ get_config('git_pillar_global_lock', False) }}
  659. # Git External Pillar Authentication Options
  660. #
  661. # Along with git_pillar_password, is used to authenticate to HTTPS remotes.
  662. {{ get_config('git_pillar_user', '') }}
  663. # Along with git_pillar_user, is used to authenticate to HTTPS remotes.
  664. # This parameter is not required if the repository does not use authentication.
  665. {{ get_config('git_pillar_password', '') }}
  666. # By default, Salt will not authenticate to an HTTP (non-HTTPS) remote.
  667. # This parameter enables authentication over HTTP.
  668. {{ get_config('git_pillar_insecure_auth', False) }}
  669. # Along with git_pillar_privkey (and optionally git_pillar_passphrase),
  670. # is used to authenticate to SSH remotes.
  671. {{ get_config('git_pillar_pubkey', '') }}
  672. # Along with git_pillar_pubkey (and optionally git_pillar_passphrase),
  673. # is used to authenticate to SSH remotes.
  674. {{ get_config('git_pillar_privkey', '') }}
  675. # This parameter is optional, required only when the SSH key being used
  676. # to authenticate is protected by a passphrase.
  677. {{ get_config('git_pillar_passphrase', '') }}
  678. ###### Security settings #####
  679. ###########################################
  680. # Enable "open mode", this mode still maintains encryption, but turns off
  681. # authentication, this is only intended for highly secure environments or for
  682. # the situation where your keys end up in a bad state. If you run in open mode
  683. # you do so at your own risk!
  684. {{ get_config('open_mode', 'False') }}
  685. # Enable permissive access to the salt keys. This allows you to run the
  686. # master or minion as root, but have a non-root group be given access to
  687. # your pki_dir. To make the access explicit, root must belong to the group
  688. # you've given access to. This is potentially quite insecure.
  689. {{ get_config('permissive_pki_access', 'False') }}
  690. # The state_verbose and state_output settings can be used to change the way
  691. # state system data is printed to the display. By default all data is printed.
  692. # The state_verbose setting can be set to True or False, when set to False
  693. # all data that has a result of True and no changes will be suppressed.
  694. {{ get_config('state_verbose', 'True') }}
  695. # The state_output setting changes if the output is the full multi line
  696. # output for each changed state if set to 'full', but if set to 'terse'
  697. # the output will be shortened to a single line.
  698. {{ get_config('state_output', 'full') }}
  699. # The state_output_diff setting changes whether or not the output from
  700. # successful states is returned. Useful when even the terse output of these
  701. # states is cluttering the logs. Set it to True to ignore them.
  702. {{ get_config('state_output_diff', 'False') }}
  703. # The state_output_profile setting changes whether profile information
  704. # will be shown for each state run.
  705. {{ get_config('state_output_profile', 'True') }}
  706. # Fingerprint of the master public key to validate the identity of your Salt master
  707. # before the initial key exchange. The master fingerprint can be found by running
  708. # "salt-key -F master" on the Salt master.
  709. {{ get_config('master_finger', "''") }}
  710. ###### Thread settings #####
  711. ###########################################
  712. # Disable multiprocessing support, by default when a minion receives a
  713. # publication a new process is spawned and the command is executed therein.
  714. {{ get_config('multiprocessing', 'True') }}
  715. ##### Logging settings #####
  716. ##########################################
  717. # The location of the minion log file
  718. # The minion log can be sent to a regular file, local path name, or network
  719. # location. Remote logging works best when configured to use rsyslogd(8) (e.g.:
  720. # ``file:///dev/log``), with rsyslogd(8) configured for network logging. The URI
  721. # format is: <file|udp|tcp>://<host|socketpath>:<port-if-required>/<log-facility>
  722. #log_file: /var/log/salt/minion
  723. #log_file: file:///dev/log
  724. #log_file: udp://loghost:10514
  725. #
  726. {{ get_config('log_file', '/var/log/salt/minion') }}
  727. {{ get_config('key_logfile', ' /var/log/salt/key') }}
  728. # The level of messages to send to the console.
  729. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  730. #
  731. # The following log levels are considered INSECURE and may log sensitive data:
  732. # ['garbage', 'trace', 'debug']
  733. #
  734. # Default: 'warning'
  735. {{ get_config('log_level', 'warning') }}
  736. # The level of messages to send to the log file.
  737. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  738. # If using 'log_granular_levels' this must be set to the highest desired level.
  739. # Default: 'warning'
  740. {{ get_config('log_level_logfile', '') }}
  741. # The date and time format used in log messages. Allowed date/time formating
  742. # can be seen here: http://docs.python.org/library/time.html#time.strftime
  743. {{ get_config('log_datefmt', "'%H:%M:%S'") }}
  744. {{ get_config('log_datefmt_logfile', "'%Y-%m-%d %H:%M:%S'") }}
  745. # The format of the console logging messages. Allowed formatting options can
  746. # be seen here: http://docs.python.org/library/logging.html#logrecord-attributes
  747. #
  748. # Console log colors are specified by these additional formatters:
  749. #
  750. # %(colorlevel)s
  751. # %(colorname)s
  752. # %(colorprocess)s
  753. # %(colormsg)s
  754. #
  755. # Since it is desirable to include the surrounding brackets, '[' and ']', in
  756. # the coloring of the messages, these color formatters also include padding as
  757. # well. Color LogRecord attributes are only available for console logging.
  758. #
  759. {{ get_config('log_fmt_console', "'%(colorlevel)s %(colormsg)s'") }}
  760. {{ get_config('log_fmt_console', "'[%(levelname)-8s] %(message)s'") }}
  761. #
  762. {{ get_config('log_fmt_logfile', "'%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'") }}
  763. # This can be used to control logging levels more specificically. This
  764. # example sets the main salt library at the 'warning' level, but sets
  765. # 'salt.modules' to log at the 'debug' level:
  766. # log_granular_levels:
  767. # 'salt': 'warning'
  768. # 'salt.modules': 'debug'
  769. #
  770. {{ get_config('log_granular_levels', '{}') }}
  771. # To diagnose issues with minions disconnecting or missing returns, ZeroMQ
  772. # supports the use of monitor sockets to log connection events. This
  773. # feature requires ZeroMQ 4.0 or higher.
  774. #
  775. # To enable ZeroMQ monitor sockets, set 'zmq_monitor' to 'True' and log at a
  776. # debug level or higher.
  777. #
  778. # A sample log event is as follows:
  779. #
  780. # [DEBUG ] ZeroMQ event: {'endpoint': 'tcp://127.0.0.1:4505', 'event': 512,
  781. # 'value': 27, 'description': 'EVENT_DISCONNECTED'}
  782. #
  783. # All events logged will include the string 'ZeroMQ event'. A connection event
  784. # should be logged as the minion starts up and initially connects to the
  785. # master. If not, check for debug log level and that the necessary version of
  786. # ZeroMQ is installed.
  787. #
  788. {{ get_config('zmq_monitor', 'False') }}
  789. ###### Module configuration #####
  790. ###########################################
  791. # Salt allows for modules to be passed arbitrary configuration data, any data
  792. # passed here in valid yaml format will be passed on to the salt minion modules
  793. # for use. It is STRONGLY recommended that a naming convention be used in which
  794. # the module name is followed by a . and then the value. Also, all top level
  795. # data must be applied via the yaml dict construct, some examples:
  796. #
  797. # You can specify that all modules should run in test mode:
  798. {{ get_config('test', 'True') }}
  799. # A simple value for the test module:
  800. #test.foo: foo
  801. #
  802. # A list for the test module:
  803. #test.bar: [baz,quo]
  804. #
  805. # A dict for the test module:
  806. #test.baz: {spam: sausage, cheese: bread}
  807. #
  808. #
  809. ###### Update settings ######
  810. ###########################################
  811. # Using the features in Esky, a salt minion can both run as a frozen app and
  812. # be updated on the fly. These options control how the update process
  813. # (saltutil.update()) behaves.
  814. #
  815. # The url for finding and downloading updates. Disabled by default.
  816. {{ get_config('update_url', 'False') }}
  817. #
  818. # The list of services to restart after a successful update. Empty by default.
  819. {{ get_config('update_restart_services', '[]') }}
  820. ###### Keepalive settings ######
  821. ############################################
  822. # ZeroMQ now includes support for configuring SO_KEEPALIVE if supported by
  823. # the OS. If connections between the minion and the master pass through
  824. # a state tracking device such as a firewall or VPN gateway, there is
  825. # the risk that it could tear down the connection the master and minion
  826. # without informing either party that their connection has been taken away.
  827. # Enabling TCP Keepalives prevents this from happening.
  828. # Overall state of TCP Keepalives, enable (1 or True), disable (0 or False)
  829. # or leave to the OS defaults (-1), on Linux, typically disabled. Default True, enabled.
  830. {{ get_config('tcp_keepalive', 'True') }}
  831. # How long before the first keepalive should be sent in seconds. Default 300
  832. # to send the first keepalive after 5 minutes, OS default (-1) is typically 7200 seconds
  833. # on Linux see /proc/sys/net/ipv4/tcp_keepalive_time.
  834. {{ get_config('tcp_keepalive_idle', '300') }}
  835. # How many lost probes are needed to consider the connection lost. Default -1
  836. # to use OS defaults, typically 9 on Linux, see /proc/sys/net/ipv4/tcp_keepalive_probes.
  837. {{ get_config('tcp_keepalive_cnt', '-1') }}
  838. # How often, in seconds, to send keepalives after the first one. Default -1 to
  839. # use OS defaults, typically 75 seconds on Linux, see
  840. # /proc/sys/net/ipv4/tcp_keepalive_intvl.
  841. {{ get_config('tcp_keepalive_intvl', '-1') }}
  842. ###### Windows Software settings ######
  843. ############################################
  844. # Location of the repository cache file on the master:
  845. {{ get_config('win_repo_cachefile', 'salt://win/repo/winrepo.p') }}
  846. ###### Returner settings ######
  847. ############################################
  848. # Which returner(s) will be used for minion's result:
  849. {{ get_config('return', '') }}
  850. ###### Miscellaneous settings ######
  851. ############################################
  852. # Default match type for filtering events tags: startswith, endswith, find, regex, fnmatch
  853. #event_match_type: startswith
  854. {{ get_config('event_match_type', 'startswith') }}