Saltstack Official Salt Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

829 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. {{ get_config('yaml_utf8', 'False') }}
  276. ##### File Server settings #####
  277. ##########################################
  278. # Salt runs a lightweight file server written in zeromq to deliver files to
  279. # minions. This file server is built into the master daemon and does not
  280. # require a dedicated port.
  281. # The file server works on environments passed to the master, each environment
  282. # can have multiple root directories, the subdirectories in the multiple file
  283. # roots cannot match, otherwise the downloaded files will not be able to be
  284. # reliably ensured. A base environment is required to house the top file.
  285. # Example:
  286. # file_roots:
  287. # base:
  288. # - /srv/salt/
  289. # dev:
  290. # - /srv/salt/dev/services
  291. # - /srv/salt/dev/states
  292. # prod:
  293. # - /srv/salt/prod/services
  294. # - /srv/salt/prod/states
  295. {% if 'file_roots' in master -%}
  296. file_roots:
  297. {%- for name, roots in master['file_roots']|dictsort %}
  298. {{ name }}:
  299. {%- for dir in roots %}
  300. - {{ dir }}
  301. {%- endfor -%}
  302. {%- endfor -%}
  303. {% elif 'file_roots' in salt -%}
  304. file_roots:
  305. {%- for name, roots in salt['file_roots']|dictsort %}
  306. {{ name }}:
  307. {%- for dir in roots %}
  308. - {{ dir }}
  309. {%- endfor -%}
  310. {%- endfor -%}
  311. {% else -%}
  312. #file_roots:
  313. # base:
  314. # - /srv/salt
  315. {%- endif %}
  316. # The hash_type is the hash to use when discovering the hash of a file on
  317. # the master server. The default is md5, but sha1, sha224, sha256, sha384
  318. # and sha512 are also supported.
  319. {{ get_config('hash_type', 'md5') }}
  320. # The buffer size in the file server can be adjusted here:
  321. {{ get_config('file_buffer_size', '1048576') }}
  322. # A regular expression (or a list of expressions) that will be matched
  323. # against the file path before syncing the modules and states to the minions.
  324. # This includes files affected by the file.recurse state.
  325. # For example, if you manage your custom modules and states in subversion
  326. # and don't want all the '.svn' folders and content synced to your minions,
  327. # you could set this to '/\.svn($|/)'. By default nothing is ignored.
  328. {% if 'file_ignore_regex' in master -%}
  329. file_ignore_regex:
  330. {% for regex in master['file_ignore_regex'] -%}
  331. - {{ regex }}
  332. {% endfor -%}
  333. {% elif 'file_ignore_regex' in salt -%}
  334. file_ignore_regex:
  335. {% for regex in salt['file_ignore_regex'] -%}
  336. - {{ regex }}
  337. {% endfor -%}
  338. {% else -%}
  339. #file_ignore_regex:
  340. # - '/\.svn($|/)'
  341. # - '/\.git($|/)'
  342. {%- endif %}
  343. # A file glob (or list of file globs) that will be matched against the file
  344. # path before syncing the modules and states to the minions. This is similar
  345. # to file_ignore_regex above, but works on globs instead of regex. By default
  346. # nothing is ignored.
  347. {% if 'file_ignore_glob' in master -%}
  348. file_ignore_glob:
  349. {% for glob in master['file_ignore_glob'] -%}
  350. - {{ glob }}
  351. {% endfor -%}
  352. {% elif 'file_ignore_glob' in salt -%}
  353. file_ignore_glob:
  354. {% for glob in salt['file_ignore_glob'] -%}
  355. - {{ glob }}
  356. {% endfor -%}
  357. {% else -%}
  358. # file_ignore_glob:
  359. # - '*.pyc'
  360. # - '*/somefolder/*.bak'
  361. # - '*.swp'
  362. {%- endif %}
  363. # File Server Backend
  364. # Salt supports a modular fileserver backend system, this system allows
  365. # the salt master to link directly to third party systems to gather and
  366. # manage the files available to minions. Multiple backends can be
  367. # configured and will be searched for the requested file in the order in which
  368. # they are defined here. The default setting only enables the standard backend
  369. # "roots" which uses the "file_roots" option.
  370. #
  371. #fileserver_backend:
  372. # - roots
  373. #
  374. # To use multiple backends list them in the order they are searched:
  375. #
  376. #fileserver_backend:
  377. # - git
  378. # - roots
  379. {% if 'fileserver_backend' in master -%}
  380. fileserver_backend:
  381. {%- for backend in master['fileserver_backend'] %}
  382. - {{ backend }}
  383. {% endfor -%}
  384. {% endif %}
  385. #
  386. # Uncomment the line below if you do not want the file_server to follow
  387. # symlinks when walking the filesystem tree. This is set to True
  388. # by default. Currently this only applies to the default roots
  389. # fileserver_backend.
  390. #
  391. {{ get_config('fileserver_followsymlinks', 'False') }}
  392. #
  393. # Uncomment the line below if you do not want symlinks to be
  394. # treated as the files they are pointing to. By default this is set to
  395. # False. By uncommenting the line below, any detected symlink while listing
  396. # files on the Master will not be returned to the Minion.
  397. #
  398. {{ get_config('fileserver_ignoresymlinks', 'True') }}
  399. #
  400. # By default, the Salt fileserver recurses fully into all defined environments
  401. # to attempt to find files. To limit this behavior so that the fileserver only
  402. # traverses directories with SLS files and special Salt directories like _modules,
  403. # enable the option below. This might be useful for installations where a file root
  404. # has a very large number of files and performance is impacted. Default is False.
  405. #
  406. {{ get_config('fileserver_limit_traversal', 'False') }}
  407. #
  408. # The fileserver can fire events off every time the fileserver is updated,
  409. # these are disabled by default, but can be easily turned on by setting this
  410. # flag to True
  411. {{ get_config('fileserver_events', 'False') }}
  412. #
  413. # Git fileserver backend configuration
  414. #
  415. # Gitfs can be provided by one of two python modules: GitPython or pygit2. If
  416. # using pygit2, both libgit2 and git must also be installed.
  417. {{ get_config('gitfs_provider', 'gitpython') }}
  418. #
  419. # When using the git fileserver backend at least one git remote needs to be
  420. # defined. The user running the salt master will need read access to the repo.
  421. #
  422. # The repos will be searched in order to find the file requested by a client
  423. # and the first repo to have the file will return it.
  424. # When using the git backend branches and tags are translated into salt
  425. # environments.
  426. # Note: file:// repos will be treated as a remote, so refs you want used must
  427. # exist in that repo as *local* refs.
  428. {% if 'gitfs_remotes' in master -%}
  429. gitfs_remotes:
  430. {%- for remote in master['gitfs_remotes'] %}
  431. {% if remote is iterable and remote is not string %}
  432. {%- for repo, children in remote.iteritems() -%}
  433. - {{ repo }}:
  434. {%- for child in children %}
  435. {% for key, value in child.iteritems() -%}
  436. - {{ key }}: {{ value }}
  437. {%- endfor %}
  438. {%- endfor %}
  439. {%- endfor %}
  440. {%- else -%}
  441. - {{ remote }}
  442. {%- endif %}
  443. {%- endfor %}
  444. {%- endif %}
  445. #
  446. #gitfs_remotes:
  447. # - git://github.com/saltstack/salt-states.git
  448. # - file:///var/git/saltmaster
  449. #
  450. # The gitfs_ssl_verify option specifies whether to ignore ssl certificate
  451. # errors when contacting the gitfs backend. You might want to set this to
  452. # false if you're using a git backend that uses a self-signed certificate but
  453. # keep in mind that setting this flag to anything other than the default of True
  454. # is a security concern, you may want to try using the ssh transport.
  455. {{ get_config('gitfs_ssl_verify', 'True') }}
  456. #
  457. #
  458. # The gitfs_root option gives the ability to serve files from a subdirectory
  459. # within the repository. The path is defined relative to the root of the
  460. # repository and defaults to the repository root.
  461. {{ get_config('gitfs_root', 'somefolder/otherfolder') }}
  462. ##### Pillar settings #####
  463. ##########################################
  464. # Salt Pillars allow for the building of global data that can be made selectively
  465. # available to different minions based on minion grain filtering. The Salt
  466. # Pillar is laid out in the same fashion as the file server, with environments,
  467. # a top file and sls files. However, pillar data does not need to be in the
  468. # highstate format, and is generally just key/value pairs.
  469. {% if 'pillar_roots' in master -%}
  470. pillar_roots:
  471. {%- for name, roots in master['pillar_roots']|dictsort %}
  472. {{ name }}:
  473. {%- for dir in roots %}
  474. - {{ dir }}
  475. {%- endfor -%}
  476. {%- endfor -%}
  477. {% elif 'pillar_roots' in salt -%}
  478. pillar_roots:
  479. {%- for name, roots in salt['pillar_roots']|dictsort %}
  480. {{ name }}:
  481. {%- for dir in roots %}
  482. - {{ dir }}
  483. {%- endfor -%}
  484. {%- endfor -%}
  485. {% else %}
  486. #pillar_roots:
  487. # base:
  488. # - /srv/pillar
  489. {%- endif %}
  490. {% if 'ext_pillar' in master -%}
  491. ext_pillar:
  492. {% for pillar in master['ext_pillar'] %}
  493. - {{ pillar.items()[0][0] }}: {{ pillar.items()[0][1] }}
  494. {% endfor -%}
  495. {% elif 'ext_pillar' in salt -%}
  496. ext_pillar:
  497. {% for pillar in salt['ext_pillar'] %}
  498. - {{ pillar.items()[0][0] }}: {{ pillar.items()[0][1] }}
  499. {% endfor -%}
  500. {% else %}
  501. #ext_pillar:
  502. # - hiera: /etc/hiera.yaml
  503. # - cmd_yaml: cat /etc/salt/yaml
  504. {%- endif %}
  505. # The pillar_gitfs_ssl_verify option specifies whether to ignore ssl certificate
  506. # errors when contacting the pillar gitfs backend. You might want to set this to
  507. # false if you're using a git backend that uses a self-signed certificate but
  508. # keep in mind that setting this flag to anything other than the default of True
  509. # is a security concern, you may want to try using the ssh transport.
  510. {{ get_config('pillar_gitfs_ssl_verify', 'True') }}
  511. # The pillar_opts option adds the master configuration file data to a dict in
  512. # the pillar called "master". This is used to set simple configurations in the
  513. # master config file that can then be used on minions.
  514. {{ get_config('pillar_opts', 'True') }}
  515. ##### Syndic settings #####
  516. ##########################################
  517. # The Salt syndic is used to pass commands through a master from a higher
  518. # master. Using the syndic is simple, if this is a master that will have
  519. # syndic servers(s) below it set the "order_masters" setting to True, if this
  520. # is a master that will be running a syndic daemon for passthrough the
  521. # "syndic_master" setting needs to be set to the location of the master server
  522. # to receive commands from.
  523. # Set the order_masters setting to True if this master will command lower
  524. # masters' syndic interfaces.
  525. {{ get_config('order_masters', 'False') }}
  526. # If this master will be running a salt syndic daemon, syndic_master tells
  527. # this master where to receive commands from.
  528. {{ get_config('syndic_master', 'masterofmaster') }}
  529. # This is the 'ret_port' of the MasterOfMaster
  530. {{ get_config('syndic_master_port', '4506') }}
  531. # PID file of the syndic daemon
  532. {{ get_config('syndic_pidfile', '/var/run/salt-syndic.pid') }}
  533. # LOG file of the syndic daemon
  534. {{ get_config('syndic_log_file', 'syndic.log') }}
  535. ##### Peer Publish settings #####
  536. ##########################################
  537. # Salt minions can send commands to other minions, but only if the minion is
  538. # allowed to. By default "Peer Publication" is disabled, and when enabled it
  539. # is enabled for specific minions and specific commands. This allows secure
  540. # compartmentalization of commands based on individual minions.
  541. # The configuration uses regular expressions to match minions and then a list
  542. # of regular expressions to match functions. The following will allow the
  543. # minion authenticated as foo.example.com to execute functions from the test
  544. # and pkg modules.
  545. #
  546. #peer:
  547. # foo.example.com:
  548. # - test.*
  549. # - pkg.*
  550. #
  551. # This will allow all minions to execute all commands:
  552. #
  553. #peer:
  554. # .*:
  555. # - .*
  556. #
  557. # This is not recommended, since it would allow anyone who gets root on any
  558. # single minion to instantly have root on all of the minions!
  559. {% if 'peer' in master -%}
  560. peer:
  561. {% for name, roots in master['peer'].items() -%}
  562. {{ name }}:
  563. {% for mod in roots -%}
  564. - {{ mod }}
  565. {% endfor -%}
  566. {% endfor -%}
  567. {% elif 'peer' in salt -%}
  568. peer:
  569. {% for name, roots in salt['peer'].items() -%}
  570. {{ name }}:
  571. {% for mod in roots -%}
  572. - {{ mod }}
  573. {% endfor -%}
  574. {% endfor -%}
  575. {% endif -%}
  576. # Minions can also be allowed to execute runners from the salt master.
  577. # Since executing a runner from the minion could be considered a security risk,
  578. # it needs to be enabled. This setting functions just like the peer setting
  579. # except that it opens up runners instead of module functions.
  580. #
  581. # All peer runner support is turned off by default and must be enabled before
  582. # using. This will enable all peer runners for all minions:
  583. #
  584. #peer_run:
  585. # .*:
  586. # - .*
  587. #
  588. # To enable just the manage.up runner for the minion foo.example.com:
  589. #
  590. #peer_run:
  591. # foo.example.com:
  592. # - manage.up
  593. {% if 'peer_run' in master -%}
  594. peer_run:
  595. {% for name, roots in master['peer_run'].items() -%}
  596. {{ name }}:
  597. {% for mod in roots -%}
  598. - {{ mod }}
  599. {% endfor -%}
  600. {% endfor -%}
  601. {% elif 'peer_run' in salt -%}
  602. peer_run:
  603. {% for name, roots in salt['peer_run'].items() -%}
  604. {{ name }}:
  605. {% for mod in roots -%}
  606. - {{ mod }}
  607. {% endfor -%}
  608. {% endfor -%}
  609. {% endif -%}
  610. ##### Mine settings #####
  611. ##########################################
  612. # Restrict mine.get access from minions. By default any minion has a full access
  613. # to get all mine data from master cache. In acl definion below, only pcre matches
  614. # are allowed.
  615. #
  616. # mine_get:
  617. # .*:
  618. # - .*
  619. #
  620. # Example below enables minion foo.example.com to get 'network.interfaces' mine data only
  621. # , minions web* to get all network.* and disk.* mine data and all other minions won't get
  622. # any mine data.
  623. #
  624. # mine_get:
  625. # foo.example.com:
  626. # - network.inetrfaces
  627. # web.*:
  628. # - network.*
  629. # - disk.*
  630. ##### Logging settings #####
  631. ##########################################
  632. # The location of the master log file
  633. # The master log can be sent to a regular file, local path name, or network
  634. # location. Remote logging works best when configured to use rsyslogd(8) (e.g.:
  635. # ``file:///dev/log``), with rsyslogd(8) configured for network logging. The URI
  636. # format is: <file|udp|tcp>://<host|socketpath>:<port-if-required>/<log-facility>
  637. #log_file: /var/log/salt/master
  638. #log_file: file:///dev/log
  639. #log_file: udp://loghost:10514
  640. {{ get_config('log_file', '/var/log/salt/master') }}
  641. {{ get_config('key_logfile', '/var/log/salt/key') }}
  642. # The level of messages to send to the console.
  643. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  644. {{ get_config('log_level', 'warning') }}
  645. # The level of messages to send to the log file.
  646. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  647. {{ get_config('log_level_logfile', 'warning') }}
  648. # The date and time format used in log messages. Allowed date/time formating
  649. # can be seen here: http://docs.python.org/library/time.html#time.strftime
  650. {{ get_config('log_datefmt', "'%H:%M:%S'") }}
  651. {{ get_config('log_datefmt_logfile', "'%Y-%m-%d %H:%M:%S'") }}
  652. # The format of the console logging messages. Allowed formatting options can
  653. # be seen here: http://docs.python.org/library/logging.html#logrecord-attributes
  654. {{ get_config('log_fmt_console', "'[%(levelname)-8s] %(message)s'") }}
  655. {{ get_config('log_fmt_logfile', "'%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'") }}
  656. # This can be used to control logging levels more specificically. This
  657. # example sets the main salt library at the 'warning' level, but sets
  658. # 'salt.modules' to log at the 'debug' level:
  659. # log_granular_levels:
  660. # 'salt': 'warning',
  661. # 'salt.modules': 'debug'
  662. #
  663. {% if 'log_granular_levels' in master %}
  664. log_granular_levels:
  665. {% for name, lvl in master['log_granular_levels'] %}
  666. {{ name }}: {{ lvl }}
  667. {% endfor -%}
  668. {% elif 'log_granular_levels' in salt %}
  669. log_granular_levels:
  670. {% for name, lvl in salt['log_granular_levels'] %}
  671. {{ name }}: {{ lvl }}
  672. {% endfor -%}
  673. {% else %}
  674. #log_granular_levels: {}
  675. {% endif %}
  676. ##### Node Groups #####
  677. ##########################################
  678. # Node groups allow for logical groupings of minion nodes.
  679. # A group consists of a group name and a compound target.
  680. #
  681. #nodegroups:
  682. # group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com and bl*.domain.com'
  683. # group2: 'G@os:Debian and foo.domain.com'
  684. {% if 'nodegroups' in master %}
  685. nodegroups:
  686. {% for name, lvl in master['nodegroups'] %}
  687. {{ name }}: {{ lvl }}
  688. {% endfor -%}
  689. {% elif 'nodegroups' in salt %}
  690. nodegroups:
  691. {% for name, lvl in salt['nodegroups'] %}
  692. {{ name }}: {{ lvl }}
  693. {% endfor -%}
  694. {% endif %}
  695. ##### Range Cluster settings #####
  696. ##########################################
  697. # The range server (and optional port) that serves your cluster information
  698. # https://github.com/grierj/range/wiki/Introduction-to-Range-with-YAML-files
  699. #
  700. {{ get_config('range_server', 'range:80') }}
  701. ##### Windows Software Repo settings #####
  702. ##############################################
  703. # Location of the repo on the master
  704. {{ get_config('win_repo', '/srv/salt/win/repo') }}
  705. # Location of the master's repo cache file
  706. {{ get_config('win_repo_mastercachefile', '/srv/salt/win/repo/winrepo.p') }}
  707. # List of git repositories to include with the local repo
  708. {% if 'win_gitrepos' in master %}
  709. win_gitrepos:
  710. {% for repo in master['win_gitrepos'] %}
  711. - {{ repo }}
  712. {% endfor -%}
  713. {% elif 'win_gitrepos' in salt %}
  714. win_gitrepos:
  715. {% for repo in salt['win_gitrepos'] %}
  716. - {{ repo }}
  717. {% endfor -%}
  718. {% else %}
  719. #win_gitrepos:
  720. # - 'https://github.com/saltstack/salt-winrepo.git'
  721. {% endif %}
  722. {% if 'halite' in master -%}
  723. ##### Halite #####
  724. ##########################################
  725. halite:
  726. {%- for name, value in master['halite'].iteritems() %}
  727. {{ name }}: {{ value }}
  728. {%- endfor %}
  729. {%- endif %}
  730. {% if 'rest_cherrypy' in master -%}
  731. ##### rest_cherrypy #####
  732. ##########################################
  733. rest_cherrypy:
  734. {%- for name, value in master['rest_cherrypy'].iteritems() %}
  735. {{ name }}: {{ value }}
  736. {%- endfor %}
  737. {%- endif %}