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.

master 25KB

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