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.

f_defaults.conf 36KB

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