Saltstack Official Salt Formula
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

368 lines
10.0KB

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