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.

1268 lines
51KB

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