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.

827 lines
30KB

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