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 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. # This file managed by Salt, do not edit by hand!!
  2. # Based on salt version 0.17.4 default config
  3. {% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs'] -%}
  4. {% set cfg_salt = pillar.get('salt', {}) -%}
  5. {% set cfg_minion = cfg_salt.get('minion', {}) -%}
  6. {%- macro get_config(configname, default_value) -%}
  7. {%- if configname in cfg_minion -%}
  8. {{ configname }}: {{ cfg_minion[configname] }}
  9. {%- elif configname in cfg_salt and configname not in reserved_keys -%}
  10. {{ configname }}: {{ cfg_salt[configname] }}
  11. {%- else -%}
  12. #{{ configname }}: {{ default_value }}
  13. {%- endif -%}
  14. {%- endmacro -%}
  15. {%- from 'salt/formulas.jinja' import file_roots, formulas with context -%}
  16. ##### Primary configuration settings #####
  17. ##########################################
  18. # minion includes
  19. {{ get_config('default_include', 'minion.d/*.conf') }}
  20. # master configs
  21. {%- if 'master' in cfg_minion -%}
  22. {%- if cfg_minion['master'] is not string %}
  23. master:
  24. {% for name in cfg_minion['master'] -%}
  25. - {{ name }}
  26. {% endfor -%}
  27. {%- else %}
  28. {{ get_config('master', 'salt') }}
  29. {%- endif %}
  30. {% elif 'master' in cfg_salt -%}
  31. {%- if cfg_salt['master'] is not string %}
  32. master:
  33. {% for name in cfg_salt['master'] -%}
  34. - {{ name }}
  35. {% endfor -%}
  36. {%- else %}
  37. {{ get_config('master', 'salt') }}
  38. {%- endif -%}
  39. {%- endif %}
  40. # choose a random master
  41. {{ get_config('random_master', 'False') }}
  42. # use IPv6
  43. {{ get_config('ipv6', 'False') }}
  44. # name resolution retries
  45. {{ get_config('retry_dns', '30') }}
  46. # master port
  47. {{ get_config('master_port', '4506') }}
  48. # user to run salt.
  49. {{ get_config('user', 'root') }}
  50. # PID file
  51. {{ get_config('pidfile', '/var/run/salt-minion.pid') }}
  52. # root dir
  53. {{ get_config('root_dir', '/') }}
  54. # pki dir
  55. {{ get_config('pki_dir', '/etc/salt/pki/minion') }}
  56. # minion id
  57. {% if 'id' in cfg_minion -%}
  58. id: {{ cfg_minion['id'] }}
  59. {% else -%}
  60. #id:
  61. {%- endif %}
  62. # domain name for hostnames
  63. {{ get_config('append_domain', '') }}
  64. # custom grains
  65. {{ get_config('grains', '{}') }}
  66. # cache location
  67. {{ get_config('cachedir', '/var/cache/salt/minion') }}
  68. # environment verification
  69. {{ get_config('verify_env', 'True') }}
  70. # cache executed jobs
  71. {{ get_config('cache_jobs', 'False') }}
  72. # unix socket location
  73. {{ get_config('sock_dir', '/var/run/salt/minion') }}
  74. # output formatter
  75. {{ get_config('output', 'nested') }}
  76. # output color
  77. {{ get_config('color', 'True') }}
  78. # remove nested color
  79. {{ get_config('strip_colors', 'False') }}
  80. # backup modified files
  81. {{ get_config('backup_mode', 'minion') }}
  82. # key acceptance time
  83. {{ get_config('acceptance_wait_time', '10') }}
  84. # maximum acceptance wait
  85. {{ get_config('acceptance_wait_time_max', '0') }}
  86. # retry key
  87. {{ get_config('rejected_retry', 'False') }}
  88. # time to wait for trying reauth
  89. {{ get_config('random_reauth_delay', '60') }}
  90. # auth wait timeout
  91. {{ get_config('auth_timeout', '60') }}
  92. # auth retries
  93. {{ get_config('auth_tries', '7') }}
  94. # retry auth if ping failed
  95. {{ get_config('auth_safemode', 'False') }}
  96. # master ping interval
  97. {{ get_config('ping_interval', '0') }}
  98. # salt mine functions execution interval
  99. {{ get_config('mine_interval', '60') }}
  100. # mine functions
  101. {%- if 'mine_functions' in cfg_minion %}
  102. mine_functions:
  103. {%- for func, args in cfg_minion['mine_functions'].items() %}
  104. {{ func }}: {{ args }}
  105. {%- endfor %}
  106. {%- endif %}
  107. # reconnection parameters
  108. {{ get_config('recon_default', '100') }}
  109. {{ get_config('recon_max', '5000') }}
  110. {{ get_config('recon_randomize', 'False') }}
  111. # minion scheduler interval
  112. {{ get_config('loop_interval', '60') }}
  113. # grain refresh interval
  114. {{ get_config('grains_refresh_every', '1') }}
  115. # cache grains in minion
  116. {{ get_config('grains_cache', 'False') }}
  117. # grains cache expiration interval
  118. {{ get_config('grains_cache_expiration', '300') }}
  119. # ipc method
  120. {{ get_config('ipc_mode', 'ipc') }}
  121. # ipc tcp ports
  122. {{ get_config('tcp_pub_port', '4510') }}
  123. {{ get_config('tcp_pull_port', '4511') }}
  124. # max event size in minion bus
  125. {{ get_config('max_event_size', '1048576') }}
  126. # master check alive interval
  127. {{ get_config('master_alive_interval', '30') }}
  128. # verify_master_pubkey_sign
  129. {{ get_config('verify_master_pubkey_sign', 'False') }}
  130. {{ get_config('master_type', 'str') }}
  131. # include extra config
  132. {% if 'include' in cfg_minion -%}
  133. {% if isinstance(cfg_minion['include'], list) -%}
  134. include:
  135. {% for include in cfg_minion['include'] -%}
  136. - {{ include }}
  137. {% endfor -%}
  138. {% else -%}
  139. include: cfg_minion['include']
  140. {% endif -%}
  141. {% elif 'include' in cfg_salt -%}
  142. {% if isinstance(cfg_salt['include'], list) -%}
  143. include:
  144. {% for include in cfg_salt['include'] -%}
  145. - {{ include }}
  146. {% endfor -%}
  147. {% else -%}
  148. include: cfg_salt['include']
  149. {% endif -%}
  150. {% endif -%}
  151. ##### Minion module management #####
  152. ##########################################
  153. # disable modules
  154. {{ get_config('disable_modules', '[cmd,test]') }}
  155. {{ get_config('disable_returners', '[]') }}
  156. #
  157. # minion modules search paths
  158. {{ get_config('module_dirs', '[]') }}
  159. {{ get_config('returner_dirs', '[]') }}
  160. {{ get_config('states_dirs', '[]') }}
  161. {{ get_config('render_dirs', '[]') }}
  162. {{ get_config('utils_dirs', '[]') }}
  163. # module overrides
  164. {{ get_config('providers', '{}') }}
  165. # enable cython modules
  166. {{ get_config('cython_enable', 'False') }}
  167. # max module size
  168. {{ get_config('modules_max_memory', '-1') }}
  169. ##### State Management Settings #####
  170. ###########################################
  171. # renderer selection
  172. {{ get_config('renderer', 'yaml_jinja') }}
  173. # fail on first failure
  174. {{ get_config('failhard', 'False') }}
  175. # auto reload dynamic modules
  176. {{ get_config('autoload_dynamic_modules', 'True') }}
  177. # sync dynamic modules with deletion
  178. {{ get_config('clean_dynamic_modules', 'True') }}
  179. # minion accepted environment
  180. {{ get_config('environment', 'None') }}
  181. # top state file
  182. {{ get_config('state_top', 'top.sls') }}
  183. # states to run in minion daemon
  184. {{ get_config('startup_states', "''") }}
  185. # sls states to run
  186. {{ get_config('sls_list', '[]') }}
  187. # top file to run
  188. {{ get_config('top_file', "''") }}
  189. ##### File Directory Settings #####
  190. ##########################################
  191. # file client location
  192. {%- if standalone %}
  193. file_client: local
  194. {%- else %}
  195. {{ get_config('file_client', 'remote') }}
  196. {%- endif %}
  197. # environment file roots
  198. {% if 'file_roots' in cfg_minion -%}
  199. {{ file_roots(cfg_minion['file_roots']) }}
  200. {%- elif 'file_roots' in cfg_salt -%}
  201. {{ file_roots(cfg_salt['file_roots']) }}
  202. {%- elif formulas|length -%}
  203. {{ file_roots({'base': ['/srv/salt']}) }}
  204. {%- endif %}
  205. # limit fileserver traversal
  206. {{ get_config('fileserver_limit_traversal', 'False') }}
  207. # gitfs provider
  208. {{ get_config('gitfs_provider', 'pygit2') }}
  209. # gitfs remotes
  210. {% if 'gitfs_remotes' in cfg_minion -%}
  211. gitfs_remotes:
  212. {%- for remote in cfg_minion['gitfs_remotes'] %}
  213. {%- if remote is iterable and remote is not string %}
  214. {%- for repo, children in remote.items() %}
  215. - {{ repo }}:
  216. {%- for child in children %}
  217. {%- for key, value in child.items() %}
  218. - {{ key }}: {{ value }}
  219. {%- endfor -%}
  220. {%- endfor -%}
  221. {%- endfor -%}
  222. {%- else %}
  223. - {{ remote }}
  224. {%- endif -%}
  225. {%- endfor -%}
  226. {%- endif %}
  227. # verify git ssl errors
  228. {{ get_config('gitfs_ssl_verify', 'True') }}
  229. # gitfs root dir
  230. {{ get_config('gitfs_root', 'somefolder/otherfolder') }}
  231. # file hash method
  232. {{ get_config('hash_type', 'md5') }}
  233. # pillar roots
  234. {% if 'pillar_roots' in cfg_minion -%}
  235. pillar_roots:
  236. {%- for name, roots in cfg_minion['pillar_roots']|dictsort %}
  237. {{ name }}:
  238. {%- for dir in roots %}
  239. - {{ dir }}
  240. {%- endfor -%}
  241. {%- endfor -%}
  242. {% elif 'pillar_roots' in cfg_salt -%}
  243. pillar_roots:
  244. {%- for name, roots in cfg_salt['pillar_roots']|dictsort %}
  245. {{ name }}:
  246. {%- for dir in roots %}
  247. - {{ dir }}
  248. {%- endfor -%}
  249. {%- endfor -%}
  250. {%- endif %}
  251. ###### Security settings #####
  252. ###########################################
  253. # disable authentication
  254. {{ get_config('open_mode', 'False') }}
  255. # allow access to pki dir
  256. {{ get_config('permissive_pki_access', 'False') }}
  257. # print verbose changes
  258. {{ get_config('state_verbose', 'True') }}
  259. # multi line output
  260. {{ get_config('state_output', 'full') }}
  261. # output diff
  262. {{ get_config('state_output_diff', 'False') }}
  263. # master fingerprint
  264. {{ get_config('master_finger', "''") }}
  265. ###### Thread settings #####
  266. ###########################################
  267. # enable multiprocessing
  268. {{ get_config('multiprocessing', 'True') }}
  269. ##### Logging settings #####
  270. ##########################################
  271. # log file and log lock file location
  272. {{ get_config('log_file', '/var/log/salt/minion') }}
  273. {{ get_config('key_logfile', ' /var/log/salt/key') }}
  274. # console log level
  275. {{ get_config('log_level', 'warning') }}
  276. # logfile log level
  277. {{ get_config('log_level_logfile', '') }}
  278. # datetime format for console and logfile
  279. {{ get_config('log_datefmt', "'%H:%M:%S'") }}
  280. {{ get_config('log_datefmt_logfile', "'%Y-%m-%d %H:%M:%S'") }}
  281. # log format for console and logfiles
  282. {{ get_config('log_fmt_console', "'[%(levelname)-8s] %(message)s'") }}
  283. {{ get_config('log_fmt_logfile', "'%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'") }}
  284. # log particular modules
  285. {{ get_config('log_granular_levels', '{}') }}
  286. ###### Module configuration #####
  287. ###########################################
  288. # module parameters
  289. {%- if 'module_config' in cfg_minion %}
  290. {%- for modkey, modval in cfg_minion.module_config.items() %}
  291. {{ modkey }}: {{ modval }}
  292. {%- endfor %}
  293. {%- endif %}
  294. ###### Update settings ######
  295. ###########################################
  296. # update url
  297. {{ get_config('update_url', 'False') }}
  298. # services to restart after update
  299. {{ get_config('update_restart_services', '[]') }}
  300. ###### Keepalive settings ######
  301. ############################################
  302. # use tcp keepalive
  303. {{ get_config('tcp_keepalive', 'True') }}
  304. # first keepalive from idle
  305. {{ get_config('tcp_keepalive_idle', '300') }}
  306. # keepalive number for connection lost
  307. {{ get_config('tcp_keepalive_cnt', '-1') }}
  308. # keepalive interval
  309. {{ get_config('tcp_keepalive_intvl', '-1') }}
  310. ###### Windows Software settings ######
  311. ############################################
  312. # windows repo cache
  313. {{ get_config('win_repo_cachefile', 'salt://win/repo/winrepo.p') }}