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.

958 lines
35KB

  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 salt = pillar.get('salt', {}) -%}
  5. {% set master = salt.get('master', {}) -%}
  6. {%- macro get_config(configname, default_value) -%}
  7. {%- if configname in master -%}
  8. {{ configname }}: {{ master[configname] }}
  9. {%- elif configname in salt and configname not in reserved_keys -%}
  10. {{ configname }}: {{ salt[configname] }}
  11. {%- else -%}
  12. #{{ configname }}: {{ default_value }}
  13. {%- endif -%}
  14. {%- endmacro -%}
  15. ##### Primary configuration settings #####
  16. ##########################################
  17. # This configuration file is used to manage the behavior of the Salt Master
  18. # Values that are commented out but have no space after the comment are
  19. # defaults that need not be set in the config. If there is a space after the
  20. # comment that the value is presented as an example and is not the default.
  21. # Per default, the master will automatically include all config files
  22. # from master.d/*.conf (master.d is a directory in the same directory
  23. # as the main master config file).
  24. {{ get_config('default_include', 'master.d/*.conf') }}
  25. # The address of the interface to bind to:
  26. {{ get_config('interface', '0.0.0.0') }}
  27. # Whether the master should listen for IPv6 connections. If this is set to True,
  28. # the interface option must be adjusted, too. (For example: "interface: '::'")
  29. {{ get_config('ipv6', 'False') }}
  30. # The tcp port used by the publisher:
  31. {{ get_config('publish_port', '4505') }}
  32. # The user under which the salt master will run. Salt will update all
  33. # permissions to allow the specified user to run the master. The exception is
  34. # the job cache, which must be deleted if this user is changed. If the
  35. # modified files cause conflicts, set verify_env to False.
  36. {{ get_config('user', 'root') }}
  37. # Max open files
  38. #
  39. # Each minion connecting to the master uses AT LEAST one file descriptor, the
  40. # master subscription connection. If enough minions connect you might start
  41. # seeing on the console (and then salt-master crashes):
  42. # Too many open files (tcp_listener.cpp:335)
  43. # Aborted (core dumped)
  44. #
  45. # By default this value will be the one of `ulimit -Hn`, ie, the hard limit for
  46. # max open files.
  47. #
  48. # If you wish to set a different value than the default one, uncomment and
  49. # configure this setting. Remember that this value CANNOT be higher than the
  50. # hard limit. Raising the hard limit depends on your OS and/or distribution,
  51. # a good way to find the limit is to search the internet. For example:
  52. # raise max open files hard limit debian
  53. #
  54. {{ get_config('max_open_files', '100000') }}
  55. # The number of worker threads to start. These threads are used to manage
  56. # return calls made from minions to the master. If the master seems to be
  57. # running slowly, increase the number of threads.
  58. {{ get_config('worker_threads', '5') }}
  59. # The port used by the communication interface. The ret (return) port is the
  60. # interface used for the file server, authentication, job returns, etc.
  61. {{ get_config('ret_port', '4506') }}
  62. # Specify the location of the daemon process ID file:
  63. {{ get_config('pidfile', '/var/run/salt-master.pid') }}
  64. # The root directory prepended to these options: pki_dir, cachedir,
  65. # sock_dir, log_file, autosign_file, autoreject_file, extension_modules,
  66. # key_logfile, pidfile:
  67. {{ get_config('root_dir', '/') }}
  68. # Directory used to store public key data:
  69. {{ get_config('pki_dir', '/etc/salt/pki/master') }}
  70. # Directory to store job and cache data:
  71. {{ get_config('cachedir', '/var/cache/salt/master') }}
  72. # Directory for custom modules. This directory can contain subdirectories for
  73. # each of Salt's module types such as "runners", "output", "wheel", "modules",
  74. # "states", "returners", etc.
  75. {{ get_config('extension_modules', '<no default>') }}
  76. # Verify and set permissions on configuration directories at startup:
  77. {{ get_config('verify_env', 'True') }}
  78. # Set the number of hours to keep old job information in the job cache:
  79. {{ get_config('keep_jobs', '24') }}
  80. # Set the default timeout for the salt command and api. The default is 5
  81. # seconds.
  82. {{ get_config('timeout', '5') }}
  83. # The loop_interval option controls the seconds for the master's maintenance
  84. # process check cycle. This process updates file server backends, cleans the
  85. # job cache and executes the scheduler.
  86. {{ get_config('loop_interval', '60') }}
  87. # Set the default outputter used by the salt command. The default is "nested".
  88. {{ get_config('output', 'nested') }}
  89. # Return minions that timeout when running commands like test.ping
  90. {{ get_config('show_timeout', 'True') }}
  91. # By default, output is colored. To disable colored output, set the color value
  92. # to False.
  93. {{ get_config('color', 'True') }}
  94. # Do not strip off the colored output from nested results and state outputs
  95. # (true by default).
  96. {{ get_config('strip_colors', 'False') }}
  97. # Set the directory used to hold unix sockets:
  98. {{ get_config('sock_dir', '/var/run/salt/master') }}
  99. # The master can take a while to start up when lspci and/or dmidecode is used
  100. # to populate the grains for the master. Enable if you want to see GPU hardware
  101. # data for your master.
  102. {{ get_config('enable_gpu_grains', 'False') }}
  103. # The master maintains a job cache. While this is a great addition, it can be
  104. # a burden on the master for larger deployments (over 5000 minions).
  105. # Disabling the job cache will make previously executed jobs unavailable to
  106. # the jobs system and is not generally recommended.
  107. {{ get_config('job_cache', 'True') }}
  108. # Cache minion grains and pillar data in the cachedir.
  109. {{ get_config('minion_data_cache', 'True') }}
  110. # Store all returns in the given returner.
  111. # Setting this option requires that any returner-specific configuration also
  112. # be set. See various returners in salt/returners for details on required
  113. # configuration values. (See also, event_return_queue below.)
  114. #
  115. {{ get_config('event_return', 'mysql') }}
  116. # On busy systems, enabling event_returns can cause a considerable load on
  117. # the storage system for returners. Events can be queued on the master and
  118. # stored in a batched fashion using a single transaction for multiple events.
  119. # By default, events are not queued.
  120. {{ get_config('event_return_queue', '0') }}
  121. # Only events returns matching tags in a whitelist
  122. {% if 'event_return_whitelist' in master -%}
  123. event_return_whitelist:
  124. {%- for event_return in event_return_whitelist %}
  125. - {{ event_return }}
  126. {%- endfor -%}
  127. {% elif 'event_return_whitelist' in salt -%}
  128. event_return_whitelist:
  129. {%- for event_return in event_return_whitelist %}
  130. - {{ event_return }}
  131. {%- endfor -%}
  132. {% else -%}
  133. # event_return_whitelist:
  134. # - salt/master/a_tag
  135. # - salt/master/another_tag
  136. {% endif %}
  137. # Store all event returns _except_ the tags in a blacklist
  138. {% if 'event_return_blacklist' in master -%}
  139. event_return_blacklist:
  140. {%- for event_return in event_return_blacklist %}
  141. - {{ event_return }}
  142. {%- endfor -%}
  143. {% elif 'event_return_blacklist' in salt -%}
  144. event_return_blacklist:
  145. {%- for event_return in event_return_blacklist %}
  146. - {{ event_return }}
  147. {%- endfor -%}
  148. {% else -%}
  149. # event_return_blacklist:
  150. # - salt/master/not_this_tag
  151. # - salt/master/or_this_one
  152. {% endif %}
  153. # Passing very large events can cause the minion to consume large amounts of
  154. # memory. This value tunes the maximum size of a message allowed onto the
  155. # master event bus. The value is expressed in bytes.
  156. {{ get_config('max_event_size', '1048576') }}
  157. # By default, the master AES key rotates every 24 hours. The next command
  158. # following a key rotation will trigger a key refresh from the minion which may
  159. # result in minions which do not respond to the first command after a key refresh.
  160. #
  161. # To tell the master to ping all minions immediately after an AES key refresh, set
  162. # ping_on_rotate to True. This should mitigate the issue where a minion does not
  163. # appear to initially respond after a key is rotated.
  164. #
  165. # Note that ping_on_rotate may cause high load on the master immediately after
  166. # the key rotation event as minions reconnect. Consider this carefully if this
  167. # salt master is managing a large number of minions.
  168. #
  169. # If disabled, it is recommended to handle this event by listening for the
  170. # 'aes_key_rotate' event with the 'key' tag and acting appropriately.
  171. {{ get_config('ping_on_rotate', 'False') }}
  172. # By default, the master deletes its cache of minion data when the key for that
  173. # minion is removed. To preserve the cache after key deletion, set
  174. # 'preserve_minion_cache' to True.
  175. #
  176. # WARNING: This may have security implications if compromised minions auth with
  177. # a previous deleted minion ID.
  178. {{ get_config('preserve_minion_cache', 'False') }}
  179. # If max_minions is used in large installations, the master might experience
  180. # high-load situations because of having to check the number of connected
  181. # minions for every authentication. This cache provides the minion-ids of
  182. # all connected minions to all MWorker-processes and greatly improves the
  183. # performance of max_minions.
  184. {{ get_config('con_cache', 'False') }}
  185. # The master can include configuration from other files. To enable this,
  186. # pass a list of paths to this option. The paths can be either relative or
  187. # absolute; if relative, they are considered to be relative to the directory
  188. # the main master configuration file lives in (this file). Paths can make use
  189. # of shell-style globbing. If no files are matched by a path passed to this
  190. # option, then the master will log a warning message.
  191. #
  192. # Include a config file from some other path:
  193. # include: /etc/salt/extra_config
  194. #
  195. # Include config from several files and directories:
  196. # include:
  197. # - /etc/salt/extra_config
  198. {{ get_config('include', '[]') }}
  199. ##### Security settings #####
  200. ##########################################
  201. # Enable "open mode", this mode still maintains encryption, but turns off
  202. # authentication, this is only intended for highly secure environments or for
  203. # the situation where your keys end up in a bad state. If you run in open mode
  204. # you do so at your own risk!
  205. {{ get_config('open_mode', 'False') }}
  206. # Enable auto_accept, this setting will automatically accept all incoming
  207. # public keys from the minions. Note that this is insecure.
  208. {{ get_config('auto_accept', 'False') }}
  209. # Time in minutes that a incoming public key with a matching name found in
  210. # pki_dir/minion_autosign/keyid is automatically accepted. Expired autosign keys
  211. # are removed when the master checks the minion_autosign directory.
  212. # 0 equals no timeout
  213. {{ get_config('autosign_timeout', '120') }}
  214. # If the autosign_file is specified, incoming keys specified in the
  215. # autosign_file will be automatically accepted. This is insecure. Regular
  216. # expressions as well as globing lines are supported.
  217. {{ get_config('autosign_file', '/etc/salt/autosign.conf') }}
  218. # Works like autosign_file, but instead allows you to specify minion IDs for
  219. # which keys will automatically be rejected. Will override both membership in
  220. # the autosign_file and the auto_accept setting.
  221. {{ get_config('autoreject_file', '/etc/salt/autoreject.conf') }}
  222. # Enable permissive access to the salt keys. This allows you to run the
  223. # master or minion as root, but have a non-root group be given access to
  224. # your pki_dir. To make the access explicit, root must belong to the group
  225. # you've given access to. This is potentially quite insecure. If an autosign_file
  226. # is specified, enabling permissive_pki_access will allow group access to that
  227. # specific file.
  228. {{ get_config('permissive_pki_access', 'False') }}
  229. # Allow users on the master access to execute specific commands on minions.
  230. # This setting should be treated with care since it opens up execution
  231. # capabilities to non root users. By default this capability is completely
  232. # disabled.
  233. #client_acl:
  234. # larry:
  235. # - test.ping
  236. # - network.*
  237. {% if 'client_acl' in master -%}
  238. client_acl:
  239. {%- for name, user in master['client_acl']|dictsort %}
  240. {{ name}}:
  241. {%- for command in user %}
  242. - {% raw %}'{% endraw %}{{ command }}{% raw %}'{% endraw %}
  243. {%- endfor -%}
  244. {%- endfor -%}
  245. {% elif 'client_acl' in salt -%}
  246. client_acl:
  247. {%- for name, user in salt['client_acl']|dictsort %}
  248. {{ name }}:
  249. {%- for command in user %}
  250. - {% raw %}'{% endraw %}{{ command }}{% raw %}'{% endraw %}
  251. {%- endfor -%}
  252. {%- endfor -%}
  253. {% else -%}
  254. #client_acl:
  255. # larry:
  256. # - test.ping
  257. # - network.*
  258. {%- endif %}
  259. # Blacklist any of the following users or modules
  260. #
  261. # This example would blacklist all non sudo users, including root from
  262. # running any commands. It would also blacklist any use of the "cmd"
  263. # module. This is completely disabled by default.
  264. #
  265. {% if 'client_acl_blacklist' in master %}
  266. client_acl_blacklist:
  267. users:
  268. {% for user in master['client_acl_blacklist'].get('users', []) %}
  269. - {{ user }}
  270. {% endfor %}
  271. modules:
  272. {% for mod in master['client_acl_blacklist'].get('modules', []) %}
  273. - {{ mod }}
  274. {% endfor %}
  275. {% elif 'client_acl_blacklist' in salt %}
  276. client_acl_blacklist:
  277. users:
  278. {% for user in salt['client_acl_blacklist'].get('users', []) %}
  279. - {{ user }}
  280. {% endfor %}
  281. modules:
  282. {% for mod in salt['client_acl_blacklist'].get('modules', []) %}
  283. - {{ mod }}
  284. {% endfor %}
  285. {% else %}
  286. #client_acl_blacklist:
  287. # users:
  288. # - root
  289. # - '^(?!sudo_).*$' # all non sudo users
  290. # modules:
  291. # - cmd
  292. {% endif %}
  293. # Enforce client_acl & client_acl_blacklist when users have sudo
  294. # access to the salt command.
  295. #
  296. {{ get_config('sudo_acl', 'False') }}
  297. # The external auth system uses the Salt auth modules to authenticate and
  298. # validate users to access areas of the Salt system.
  299. #external_auth:
  300. # pam:
  301. # fred:
  302. # - test.*
  303. {{ get_config('external_auth', '{}') }}
  304. # Time (in seconds) for a newly generated token to live. Default: 12 hours
  305. {{ get_config('token_expire', '43200') }}
  306. # Allow minions to push files to the master. This is disabled by default, for
  307. # security purposes.
  308. {{ get_config('file_recv', 'False') }}
  309. # Set a hard-limit on the size of the files that can be pushed to the master.
  310. # It will be interpreted as megabytes. Default: 100
  311. {{ get_config('file_recv_max_size', '100') }}
  312. # Signature verification on messages published from the master.
  313. # This causes the master to cryptographically sign all messages published to its event
  314. # bus, and minions then verify that signature before acting on the message.
  315. #
  316. # This is False by default.
  317. #
  318. # Note that to facilitate interoperability with masters and minions that are different
  319. # versions, if sign_pub_messages is True but a message is received by a minion with
  320. # no signature, it will still be accepted, and a warning message will be logged.
  321. # Conversely, if sign_pub_messages is False, but a minion receives a signed
  322. # message it will be accepted, the signature will not be checked, and a warning message
  323. # will be logged. This behavior went away in Salt 2014.1.0 and these two situations
  324. # will cause minion to throw an exception and drop the message.
  325. {{ get_config('sign_pub_message', 'False') }}
  326. ##### Master Module Management #####
  327. ##########################################
  328. # Manage how master side modules are loaded.
  329. # Add any additional locations to look for master runners:
  330. {{ get_config('runner_dirs', '[]') }}
  331. # Enable Cython for master side modules:
  332. {{ get_config('cython_enable', 'False') }}
  333. ##### State System settings #####
  334. ##########################################
  335. # The state system uses a "top" file to tell the minions what environment to
  336. # use and what modules to use. The state_top file is defined relative to the
  337. # root of the base environment as defined in "File Server settings" below.
  338. {{ get_config('state_top', 'top.sls') }}
  339. # The master_tops option replaces the external_nodes option by creating
  340. # a plugable system for the generation of external top data. The external_nodes
  341. # option is deprecated by the master_tops option.
  342. #
  343. # To gain the capabilities of the classic external_nodes system, use the
  344. # following configuration:
  345. # master_tops:
  346. # ext_nodes: <Shell command which returns yaml>
  347. #
  348. {{ get_config('master_tops', '{}') }}
  349. # The external_nodes option allows Salt to gather data that would normally be
  350. # placed in a top file. The external_nodes option is the executable that will
  351. # return the ENC data. Remember that Salt will look for external nodes AND top
  352. # files and combine the results if both are enabled!
  353. {{ get_config('external_nodes', 'None') }}
  354. # The renderer to use on the minions to render the state data
  355. {{ get_config('renderer', 'yaml_jinja') }}
  356. # The Jinja renderer can strip extra carriage returns and whitespace
  357. # See http://jinja.pocoo.org/docs/api/#high-level-api
  358. #
  359. # If this is set to True the first newline after a Jinja block is removed
  360. # (block, not variable tag!). Defaults to False, corresponds to the Jinja
  361. # environment init variable "trim_blocks".
  362. {{ get_config('jinja_trim_blocks', 'False') }}
  363. #
  364. # If this is set to True leading spaces and tabs are stripped from the start
  365. # of a line to a block. Defaults to False, corresponds to the Jinja
  366. # environment init variable "lstrip_blocks".
  367. {{ get_config('jinja_lstrip_blocks', 'False') }}
  368. # The failhard option tells the minions to stop immediately after the first
  369. # failure detected in the state execution, defaults to False
  370. {{ get_config('failhard', 'False') }}
  371. # The state_verbose and state_output settings can be used to change the way
  372. # state system data is printed to the display. By default all data is printed.
  373. # The state_verbose setting can be set to True or False, when set to False
  374. # all data that has a result of True and no changes will be suppressed.
  375. {{ get_config('state_verbose', 'True') }}
  376. # The state_output setting changes if the output is the full multi line
  377. # output for each changed state if set to 'full', but if set to 'terse'
  378. # the output will be shortened to a single line. If set to 'mixed', the output
  379. # will be terse unless a state failed, in which case that output will be full.
  380. # If set to 'changes', the output will be full unless the state didn't change.
  381. {{ get_config('state_output', 'full') }}
  382. # Automatically aggregate all states that have support for mod_aggregate by
  383. # setting to True. Or pass a list of state module names to automatically
  384. # aggregate just those types.
  385. #
  386. # state_aggregate:
  387. # - pkg
  388. #
  389. #state_aggregate: False
  390. ##### File Server settings #####
  391. ##########################################
  392. # Salt runs a lightweight file server written in zeromq to deliver files to
  393. # minions. This file server is built into the master daemon and does not
  394. # require a dedicated port.
  395. # The file server works on environments passed to the master, each environment
  396. # can have multiple root directories, the subdirectories in the multiple file
  397. # roots cannot match, otherwise the downloaded files will not be able to be
  398. # reliably ensured. A base environment is required to house the top file.
  399. # Example:
  400. # file_roots:
  401. # base:
  402. # - /srv/salt/
  403. # dev:
  404. # - /srv/salt/dev/services
  405. # - /srv/salt/dev/states
  406. # prod:
  407. # - /srv/salt/prod/services
  408. # - /srv/salt/prod/states
  409. {% if 'file_roots' in master -%}
  410. file_roots:
  411. {%- for name, roots in master['file_roots']|dictsort %}
  412. {{ name }}:
  413. {%- for dir in roots %}
  414. - {{ dir }}
  415. {%- endfor -%}
  416. {%- endfor -%}
  417. {% elif 'file_roots' in salt -%}
  418. file_roots:
  419. {%- for name, roots in salt['file_roots']|dictsort %}
  420. {{ name }}:
  421. {%- for dir in roots %}
  422. - {{ dir }}
  423. {%- endfor -%}
  424. {%- endfor -%}
  425. {% else -%}
  426. #file_roots:
  427. # base:
  428. # - /srv/salt
  429. {%- endif %}
  430. # The hash_type is the hash to use when discovering the hash of a file on
  431. # the master server. The default is md5, but sha1, sha224, sha256, sha384
  432. # and sha512 are also supported.
  433. #
  434. # Prior to changing this value, the master should be stopped and all Salt
  435. # caches should be cleared.
  436. {{ get_config('hash_type', 'md5') }}
  437. # The buffer size in the file server can be adjusted here:
  438. {{ get_config('file_buffer_size', '1048576') }}
  439. # A regular expression (or a list of expressions) that will be matched
  440. # against the file path before syncing the modules and states to the minions.
  441. # This includes files affected by the file.recurse state.
  442. # For example, if you manage your custom modules and states in subversion
  443. # and don't want all the '.svn' folders and content synced to your minions,
  444. # you could set this to '/\.svn($|/)'. By default nothing is ignored.
  445. {% if 'file_ignore_regex' in master %}
  446. file_ignore_regex:
  447. {% for regex in master['file_ignore_regex'] %}
  448. - {{ regex }}
  449. {% endfor %}
  450. {% elif 'file_ignore_regex' in salt %}
  451. file_ignore_regex:
  452. {% for regex in salt['file_ignore_regex'] %}
  453. - {{ regex }}
  454. {% endfor %}
  455. {% else %}
  456. #file_ignore_regex:
  457. # - '/\.svn($|/)'
  458. # - '/\.git($|/)'
  459. {% endif %}
  460. # A file glob (or list of file globs) that will be matched against the file
  461. # path before syncing the modules and states to the minions. This is similar
  462. # to file_ignore_regex above, but works on globs instead of regex. By default
  463. # nothing is ignored.
  464. {% if 'file_ignore_glob' in master %}
  465. file_ignore_glob:
  466. {% for glob in master['file_ignore_glob'] %}
  467. - {{ glob }}
  468. {% endfor %}
  469. {% elif 'file_ignore_glob' in salt %}
  470. file_ignore_glob:
  471. {% for glob in salt['file_ignore_glob'] %}
  472. - {{ glob }}
  473. {% endfor %}
  474. {% else %}
  475. # file_ignore_glob:
  476. # - '*.pyc'
  477. # - '*/somefolder/*.bak'
  478. # - '*.swp'
  479. {% endif %}
  480. # File Server Backend
  481. #
  482. # Salt supports a modular fileserver backend system, this system allows
  483. # the salt master to link directly to third party systems to gather and
  484. # manage the files available to minions. Multiple backends can be
  485. # configured and will be searched for the requested file in the order in which
  486. # they are defined here. The default setting only enables the standard backend
  487. # "roots" which uses the "file_roots" option.
  488. #fileserver_backend:
  489. # - roots
  490. #
  491. # To use multiple backends list them in the order they are searched:
  492. #fileserver_backend:
  493. # - git
  494. # - roots
  495. {% if 'fileserver_backend' in master -%}
  496. fileserver_backend:
  497. {%- for backend in master['fileserver_backend'] %}
  498. - {{ backend }}
  499. {%- endfor -%}
  500. {%- endif %}
  501. #
  502. # Uncomment the line below if you do not want the file_server to follow
  503. # symlinks when walking the filesystem tree. This is set to True
  504. # by default. Currently this only applies to the default roots
  505. # fileserver_backend.
  506. {{ get_config('fileserver_followsymlinks', 'False') }}
  507. #
  508. # Uncomment the line below if you do not want symlinks to be
  509. # treated as the files they are pointing to. By default this is set to
  510. # False. By uncommenting the line below, any detected symlink while listing
  511. # files on the Master will not be returned to the Minion.
  512. {{ get_config('fileserver_ignoresymlinks', 'True') }}
  513. #
  514. # By default, the Salt fileserver recurses fully into all defined environments
  515. # to attempt to find files. To limit this behavior so that the fileserver only
  516. # traverses directories with SLS files and special Salt directories like _modules,
  517. # enable the option below. This might be useful for installations where a file root
  518. # has a very large number of files and performance is impacted. Default is False.
  519. {{ get_config('fileserver_limit_traversal', 'False') }}
  520. #
  521. # The fileserver can fire events off every time the fileserver is updated,
  522. # these are disabled by default, but can be easily turned on by setting this
  523. # flag to True
  524. {{ get_config('fileserver_events', 'False') }}
  525. # Git File Server Backend Configuration
  526. #
  527. # Gitfs can be provided by one of two python modules: GitPython or pygit2. If
  528. # using pygit2, both libgit2 and git must also be installed.
  529. {{ get_config('gitfs_provider', 'gitpython') }}
  530. #
  531. # When using the git fileserver backend at least one git remote needs to be
  532. # defined. The user running the salt master will need read access to the repo.
  533. #
  534. # The repos will be searched in order to find the file requested by a client
  535. # and the first repo to have the file will return it.
  536. # When using the git backend branches and tags are translated into salt
  537. # environments.
  538. # Note: file:// repos will be treated as a remote, so refs you want used must
  539. # exist in that repo as *local* refs.
  540. {% if 'gitfs_remotes' in master -%}
  541. gitfs_remotes:
  542. {%- for remote in master['gitfs_remotes'] %}
  543. {%- if remote is iterable and remote is not string %}
  544. {%- for repo, children in remote.items() %}
  545. - {{ repo }}:
  546. {%- for child in children %}
  547. {%- for key, value in child.items() %}
  548. - {{ key }}: {{ value }}
  549. {%- endfor -%}
  550. {%- endfor -%}
  551. {%- endfor -%}
  552. {%- else %}
  553. - {{ remote }}
  554. {%- endif -%}
  555. {%- endfor -%}
  556. {%- endif %}
  557. #gitfs_remotes:
  558. # - git://github.com/saltstack/salt-states.git
  559. # - file:///var/git/saltmaster
  560. #
  561. # The gitfs_ssl_verify option specifies whether to ignore ssl certificate
  562. # errors when contacting the gitfs backend. You might want to set this to
  563. # false if you're using a git backend that uses a self-signed certificate but
  564. # keep in mind that setting this flag to anything other than the default of True
  565. # is a security concern, you may want to try using the ssh transport.
  566. {{ get_config('gitfs_ssl_verify', 'True') }}
  567. #
  568. # The gitfs_root option gives the ability to serve files from a subdirectory
  569. # within the repository. The path is defined relative to the root of the
  570. # repository and defaults to the repository root.
  571. {{ get_config('gitfs_root', 'somefolder/otherfolder') }}
  572. ##### Pillar settings #####
  573. ##########################################
  574. # Salt Pillars allow for the building of global data that can be made selectively
  575. # available to different minions based on minion grain filtering. The Salt
  576. # Pillar is laid out in the same fashion as the file server, with environments,
  577. # a top file and sls files. However, pillar data does not need to be in the
  578. # highstate format, and is generally just key/value pairs.
  579. {% if 'pillar_roots' in master %}
  580. pillar_roots:
  581. {% for name, roots in master['pillar_roots']|dictsort %}
  582. {{ name }}:
  583. {% for dir in roots %}
  584. - {{ dir }}
  585. {% endfor %}
  586. {% endfor %}
  587. {% elif 'pillar_roots' in salt %}
  588. pillar_roots:
  589. {% for name, roots in salt['pillar_roots']|dictsort %}
  590. {{ name }}:
  591. {% for dir in roots %}
  592. - {{ dir }}
  593. {% endfor %}
  594. {% endfor %}
  595. {% else %}
  596. #pillar_roots:
  597. # base:
  598. # - /srv/pillar
  599. {% endif %}
  600. #
  601. {% if 'ext_pillar' in master %}
  602. ext_pillar:
  603. {% for pillar in master['ext_pillar'] %}
  604. - {{ pillar.items()[0][0] }}: {{ pillar.items()[0][1] }}
  605. {% endfor %}
  606. {% elif 'ext_pillar' in salt %}
  607. ext_pillar:
  608. {% for pillar in salt['ext_pillar'] %}
  609. - {{ pillar.items()[0][0] }}: {{ pillar.items()[0][1] }}
  610. {% endfor %}
  611. {% else %}
  612. #ext_pillar:
  613. # - hiera: /etc/hiera.yaml
  614. # - cmd_yaml: cat /etc/salt/yaml
  615. {% endif %}
  616. # The ext_pillar_first option allows for external pillar sources to populate
  617. # before file system pillar. This allows for targeting file system pillar from
  618. # ext_pillar.
  619. {{ get_config('ext_pillar_first', 'False') }}
  620. # The pillar_gitfs_ssl_verify option specifies whether to ignore ssl certificate
  621. # errors when contacting the pillar gitfs backend. You might want to set this to
  622. # false if you're using a git backend that uses a self-signed certificate but
  623. # keep in mind that setting this flag to anything other than the default of True
  624. # is a security concern, you may want to try using the ssh transport.
  625. {{ get_config('pillar_gitfs_ssl_verify', 'True') }}
  626. # The pillar_opts option adds the master configuration file data to a dict in
  627. # the pillar called "master". This is used to set simple configurations in the
  628. # master config file that can then be used on minions.
  629. {{ get_config('pillar_opts', 'True') }}
  630. ##### Syndic settings #####
  631. ##########################################
  632. # The Salt syndic is used to pass commands through a master from a higher
  633. # master. Using the syndic is simple, if this is a master that will have
  634. # syndic servers(s) below it set the "order_masters" setting to True, if this
  635. # is a master that will be running a syndic daemon for passthrough the
  636. # "syndic_master" setting needs to be set to the location of the master server
  637. # to receive commands from.
  638. # Set the order_masters setting to True if this master will command lower
  639. # masters' syndic interfaces.
  640. {{ get_config('order_masters', 'False') }}
  641. # If this master will be running a salt syndic daemon, syndic_master tells
  642. # this master where to receive commands from.
  643. {{ get_config('syndic_master', 'masterofmaster') }}
  644. # This is the 'ret_port' of the MasterOfMaster:
  645. {{ get_config('syndic_master_port', '4506') }}
  646. # PID file of the syndic daemon:
  647. {{ get_config('syndic_pidfile', '/var/run/salt-syndic.pid') }}
  648. # LOG file of the syndic daemon:
  649. {{ get_config('syndic_log_file', 'syndic.log') }}
  650. ##### Peer Publish settings #####
  651. ##########################################
  652. # Salt minions can send commands to other minions, but only if the minion is
  653. # allowed to. By default "Peer Publication" is disabled, and when enabled it
  654. # is enabled for specific minions and specific commands. This allows secure
  655. # compartmentalization of commands based on individual minions.
  656. # The configuration uses regular expressions to match minions and then a list
  657. # of regular expressions to match functions. The following will allow the
  658. # minion authenticated as foo.example.com to execute functions from the test
  659. # and pkg modules.
  660. #peer:
  661. # foo.example.com:
  662. # - test.*
  663. # - pkg.*
  664. #
  665. # This will allow all minions to execute all commands:
  666. #peer:
  667. # .*:
  668. # - .*
  669. #
  670. # This is not recommended, since it would allow anyone who gets root on any
  671. # single minion to instantly have root on all of the minions!
  672. {% if 'peer' in master %}
  673. peer:
  674. {% for name, roots in master['peer'].items() %}
  675. {{ name }}:
  676. {% for mod in roots %}
  677. - {{ mod }}
  678. {% endfor %}
  679. {% endfor %}
  680. {% elif 'peer' in salt %}
  681. peer:
  682. {% for name, roots in salt['peer'].items() %}
  683. {{ name }}:
  684. {% for mod in roots %}
  685. - {{ mod }}
  686. {% endfor %}
  687. {% endfor %}
  688. {% endif %}
  689. # Minions can also be allowed to execute runners from the salt master.
  690. # Since executing a runner from the minion could be considered a security risk,
  691. # it needs to be enabled. This setting functions just like the peer setting
  692. # except that it opens up runners instead of module functions.
  693. #
  694. # All peer runner support is turned off by default and must be enabled before
  695. # using. This will enable all peer runners for all minions:
  696. #peer_run:
  697. # .*:
  698. # - .*
  699. #
  700. # To enable just the manage.up runner for the minion foo.example.com:
  701. #peer_run:
  702. # foo.example.com:
  703. # - manage.up
  704. {% if 'peer_run' in master %}
  705. peer_run:
  706. {% for name, roots in master['peer_run'].items() %}
  707. {{ name }}:
  708. {% for mod in roots %}
  709. - {{ mod }}
  710. {% endfor %}
  711. {% endfor %}
  712. {% elif 'peer_run' in salt %}
  713. peer_run:
  714. {% for name, roots in salt['peer_run'].items() %}
  715. {{ name }}:
  716. {% for mod in roots %}
  717. - {{ mod }}
  718. {% endfor %}
  719. {% endfor %}
  720. {% endif %}
  721. ##### Mine settings #####
  722. ##########################################
  723. # Restrict mine.get access from minions. By default any minion has a full access
  724. # to get all mine data from master cache. In acl definion below, only pcre matches
  725. # are allowed.
  726. # mine_get:
  727. # .*:
  728. # - .*
  729. #
  730. # The example below enables minion foo.example.com to get 'network.interfaces' mine
  731. # data only, minions web* to get all network.* and disk.* mine data and all other
  732. # minions won't get any mine data.
  733. # mine_get:
  734. # foo.example.com:
  735. # - network.interfaces
  736. # web.*:
  737. # - network.*
  738. # - disk.*
  739. ##### Logging settings #####
  740. ##########################################
  741. # The location of the master log file
  742. # The master log can be sent to a regular file, local path name, or network
  743. # location. Remote logging works best when configured to use rsyslogd(8) (e.g.:
  744. # ``file:///dev/log``), with rsyslogd(8) configured for network logging. The URI
  745. # format is: <file|udp|tcp>://<host|socketpath>:<port-if-required>/<log-facility>
  746. #log_file: /var/log/salt/master
  747. #log_file: file:///dev/log
  748. #log_file: udp://loghost:10514
  749. {{ get_config('log_file', '/var/log/salt/master') }}
  750. {{ get_config('key_logfile', '/var/log/salt/key') }}
  751. # The level of messages to send to the console.
  752. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  753. {{ get_config('log_level', 'warning') }}
  754. # The level of messages to send to the log file.
  755. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  756. {{ get_config('log_level_logfile', 'warning') }}
  757. # The date and time format used in log messages. Allowed date/time formating
  758. # can be seen here: http://docs.python.org/library/time.html#time.strftime
  759. {{ get_config('log_datefmt', "'%H:%M:%S'") }}
  760. {{ get_config('log_datefmt_logfile', "'%Y-%m-%d %H:%M:%S'") }}
  761. # The format of the console logging messages. Allowed formatting options can
  762. # be seen here: http://docs.python.org/library/logging.html#logrecord-attributes
  763. {{ get_config('log_fmt_console', "'[%(levelname)-8s] %(message)s'") }}
  764. {{ get_config('log_fmt_logfile', "'%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'") }}
  765. # This can be used to control logging levels more specificically. This
  766. # example sets the main salt library at the 'warning' level, but sets
  767. # 'salt.modules' to log at the 'debug' level:
  768. # log_granular_levels:
  769. # 'salt': 'warning'
  770. # 'salt.modules': 'debug'
  771. #
  772. {% if 'log_granular_levels' in master %}
  773. log_granular_levels:
  774. {% for name, lvl in master['log_granular_levels'].items() %}
  775. {{ name }}: {{ lvl }}
  776. {% endfor %}
  777. {% elif 'log_granular_levels' in salt %}
  778. log_granular_levels:
  779. {% for name, lvl in salt['log_granular_levels'].items() %}
  780. {{ name }}: {{ lvl }}
  781. {% endfor %}
  782. {% else %}
  783. #log_granular_levels: {}
  784. {% endif %}
  785. ##### Node Groups #####
  786. ##########################################
  787. # Node groups allow for logical groupings of minion nodes. A group consists of a group
  788. # name and a compound target.
  789. #nodegroups:
  790. # group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com and bl*.domain.com'
  791. # group2: 'G@os:Debian and foo.domain.com'
  792. {% if 'nodegroups' in master %}
  793. nodegroups:
  794. {% for name, lvl in master['nodegroups'].items() %}
  795. {{ name }}: {{ lvl }}
  796. {% endfor %}
  797. {% elif 'nodegroups' in salt %}
  798. nodegroups:
  799. {% for name, lvl in salt['nodegroups'].items() %}
  800. {{ name }}: {{ lvl }}
  801. {% endfor %}
  802. {% endif %}
  803. ##### Range Cluster settings #####
  804. ##########################################
  805. # The range server (and optional port) that serves your cluster information
  806. # https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec
  807. #
  808. {{ get_config('range_server', 'range:80') }}
  809. ##### Windows Software Repo settings #####
  810. ##############################################
  811. # Location of the repo on the master:
  812. {{ get_config('win_repo', '/srv/salt/win/repo') }}
  813. # Location of the master's repo cache file:
  814. {{ get_config('win_repo_mastercachefile', '/srv/salt/win/repo/winrepo.p') }}
  815. # List of git repositories to include with the local repo:
  816. {% if 'win_gitrepos' in master %}
  817. win_gitrepos:
  818. {% for repo in master['win_gitrepos'] %}
  819. - {{ repo }}
  820. {% endfor %}
  821. {% elif 'win_gitrepos' in salt %}
  822. win_gitrepos:
  823. {% for repo in salt['win_gitrepos'] %}
  824. - {{ repo }}
  825. {% endfor %}
  826. {% else %}
  827. #win_gitrepos:
  828. # - 'https://github.com/saltstack/salt-winrepo.git'
  829. {% endif %}
  830. ##### Returner settings ######
  831. ############################################
  832. # Which returner(s) will be used for minion's result:
  833. #return: mysql
  834. {% if 'halite' in master %}
  835. ##### Halite #####
  836. ##########################################
  837. halite:
  838. {% for name, value in master['halite'].items() %}
  839. {{ name }}: {{ value }}
  840. {% endfor %}
  841. {% endif %}
  842. {% if 'rest_cherrypy' in master %}
  843. ##### rest_cherrypy #####
  844. ##########################################
  845. rest_cherrypy:
  846. {% for name, value in master['rest_cherrypy'].items() %}
  847. {{ name }}: {{ value }}
  848. {% endfor %}
  849. {% endif %}