Saltstack Official Salt Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

f_defaults.conf 43KB

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