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.

1494 lines
56KB

  1. # This file managed by Salt, do not edit by hand!!
  2. # Based on salt version 2015.8.7 default config
  3. {% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs', 'engines'] -%}
  4. {% set cfg_salt = pillar.get('salt', {}) -%}
  5. {% set cfg_master = cfg_salt.get('master', {}) -%}
  6. {% set default_keys = [] -%}
  7. {%- macro get_config(configname, default_value) -%}
  8. {%- do default_keys.append(configname) %}
  9. {%- if configname in cfg_master -%}
  10. {{ configname }}: {{ cfg_master[configname]|json }}
  11. {%- elif configname in cfg_salt and configname not in reserved_keys -%}
  12. {{ configname }}: {{ cfg_salt[configname]|json }}
  13. {%- else -%}
  14. #{{ configname }}: {{ default_value|json }}
  15. {%- endif -%}
  16. {%- endmacro -%}
  17. {%- from 'salt/formulas.jinja' import file_roots, formulas with context -%}
  18. ##### Primary configuration settings #####
  19. ##########################################
  20. # This configuration file is used to manage the behavior of the Salt Master.
  21. # Values that are commented out but have an empty line after the comment are
  22. # defaults that do not need to be set in the config. If there is no blank line
  23. # after the comment then the value is presented as an example and is not the
  24. # default.
  25. # The id to be passed in the publish job to minions.
  26. # This is used for MultiSyndics to return the job to the requesting master.
  27. # This must be the same string as the syndic is configured with.
  28. # master_id: None
  29. {{ get_config('master_id', 'None') }}
  30. # Per default, the master will automatically include all config files
  31. # from master.d/*.conf (master.d is a directory in the same directory
  32. # as the main master config file).
  33. {{ get_config('default_include', 'master.d/*.conf') }}
  34. # The address of the interface to bind to:
  35. {{ get_config('interface', '0.0.0.0') }}
  36. # Whether the master should listen for IPv6 connections. If this is set to True,
  37. # the interface option must be adjusted, too. (For example: "interface: '::'")
  38. {{ get_config('ipv6', 'False') }}
  39. # The tcp port used by the publisher:
  40. {{ get_config('publish_port', '4505') }}
  41. # The user under which the salt master will run. Salt will update all
  42. # permissions to allow the specified user to run the master. The exception is
  43. # the job cache, which must be deleted if this user is changed. If the
  44. # modified files cause conflicts, set verify_env to False.
  45. {{ get_config('user', 'root') }}
  46. # The port used by the communication interface. The ret (return) port is the
  47. # interface used for the file server, authentication, job returns, etc.
  48. {{ get_config('ret_port', '4506') }}
  49. # Specify the location of the daemon process ID file:
  50. {{ get_config('pidfile', '/var/run/salt-master.pid') }}
  51. # The root directory prepended to these options: pki_dir, cachedir,
  52. # sock_dir, log_file, autosign_file, autoreject_file, extension_modules,
  53. # key_logfile, pidfile:
  54. {{ get_config('root_dir', '/') }}
  55. # Directory used to store public key data:
  56. {{ get_config('pki_dir', '/etc/salt/pki/master') }}
  57. # Directory to store job and cache data:
  58. # This directory may contain sensitive data and should be protected accordingly.
  59. #
  60. {{ get_config('cachedir', '/var/cache/salt/master') }}
  61. # Directory for custom modules. This directory can contain subdirectories for
  62. # each of Salt's module types such as "runners", "output", "wheel", "modules",
  63. # "states", "returners", etc.
  64. {{ get_config('extension_modules', '<no default>') }}
  65. # Directory for custom modules. This directory can contain subdirectories for
  66. # each of Salt's module types such as "runners", "output", "wheel", "modules",
  67. # "states", "returners", etc.
  68. # Like 'extension_modules' but can take an array of paths
  69. {% if 'module_dirs' in cfg_master -%}
  70. {%- do default_keys.append('module_dirs') %}
  71. module_dirs:
  72. {%- for dir in cfg_master['module_dirs'] %}
  73. - {{ dir}}
  74. {%- endfor -%}
  75. {% elif 'module_dirs' in cfg_salt -%}
  76. module_dirs:
  77. {%- for dir in cfg_salt['module_dirs'] %}
  78. - {{ dir}}
  79. {%- endfor -%}
  80. {% else -%}
  81. #module_dirs: <no default>
  82. # - /var/cache/salt/minion/extmods
  83. {% endif %}
  84. # Verify and set permissions on configuration directories at startup:
  85. {{ get_config('verify_env', 'True') }}
  86. # Set the number of hours to keep old job information in the job cache:
  87. {{ get_config('keep_jobs', '24') }}
  88. # Set the default timeout for the salt command and api. The default is 5
  89. # seconds.
  90. {{ get_config('timeout', '5') }}
  91. # The loop_interval option controls the seconds for the master's maintenance
  92. # process check cycle. This process updates file server backends, cleans the
  93. # job cache and executes the scheduler.
  94. {{ get_config('loop_interval', '60') }}
  95. # Set the default outputter used by the salt command. The default is "nested".
  96. {{ get_config('output', 'nested') }}
  97. # Return minions that timeout when running commands like test.ping
  98. {{ get_config('show_timeout', 'True') }}
  99. # By default, output is colored. To disable colored output, set the color value
  100. # to False.
  101. {{ get_config('color', 'True') }}
  102. # Do not strip off the colored output from nested results and state outputs
  103. # (true by default).
  104. {{ get_config('strip_colors', 'False') }}
  105. # Set the directory used to hold unix sockets:
  106. {{ get_config('sock_dir', '/var/run/salt/master') }}
  107. # The master can take a while to start up when lspci and/or dmidecode is used
  108. # to populate the grains for the master. Enable if you want to see GPU hardware
  109. # data for your master.
  110. {{ get_config('enable_gpu_grains', 'False') }}
  111. # The master maintains a job cache. While this is a great addition, it can be
  112. # a burden on the master for larger deployments (over 5000 minions).
  113. # Disabling the job cache will make previously executed jobs unavailable to
  114. # the jobs system and is not generally recommended.
  115. {{ get_config('job_cache', 'True') }}
  116. # Cache minion grains and pillar data in the cachedir.
  117. {{ get_config('minion_data_cache', 'True') }}
  118. # Store all returns in the given returner.
  119. # Setting this option requires that any returner-specific configuration also
  120. # be set. See various returners in salt/returners for details on required
  121. # configuration values. (See also, event_return_queue below.)
  122. {{ get_config('event_return', 'mysql') }}
  123. # On busy systems, enabling event_returns can cause a considerable load on
  124. # the storage system for returners. Events can be queued on the master and
  125. # stored in a batched fashion using a single transaction for multiple events.
  126. # By default, events are not queued.
  127. {{ get_config('event_return_queue', '0') }}
  128. # Only events returns matching tags in a whitelist
  129. {% if 'event_return_whitelist' in cfg_master -%}
  130. {%- do default_keys.append('event_return_whitelist') %}
  131. event_return_whitelist:
  132. {%- for event_return in cfg_master['event_return_whitelist'] %}
  133. - {{ event_return }}
  134. {%- endfor -%}
  135. {% elif 'event_return_whitelist' in cfg_salt -%}
  136. event_return_whitelist:
  137. {%- for event_return in cfg_salt['event_return_whitelist'] %}
  138. - {{ event_return }}
  139. {%- endfor -%}
  140. {% else -%}
  141. # event_return_whitelist:
  142. # - salt/master/a_tag
  143. # - salt/master/another_tag
  144. {% endif %}
  145. # Store all event returns _except_ the tags in a blacklist
  146. {% if 'event_return_blacklist' in cfg_master -%}
  147. {%- do default_keys.append('event_return_blacklist') %}
  148. event_return_blacklist:
  149. {%- for event_return in cfg_master['event_return_blacklist'] %}
  150. - {{ event_return }}
  151. {%- endfor -%}
  152. {% elif 'event_return_blacklist' in cfg_salt -%}
  153. event_return_blacklist:
  154. {%- for event_return in cfg_salt['event_return_blacklist'] %}
  155. - {{ event_return }}
  156. {%- endfor -%}
  157. {% else -%}
  158. # event_return_blacklist:
  159. # - salt/master/not_this_tag
  160. # - salt/master/or_this_one
  161. {% endif %}
  162. # Passing very large events can cause the minion to consume large amounts of
  163. # memory. This value tunes the maximum size of a message allowed onto the
  164. # master event bus. The value is expressed in bytes.
  165. {{ get_config('max_event_size', '1048576') }}
  166. # By default, the master AES key rotates every 24 hours. The next command
  167. # following a key rotation will trigger a key refresh from the minion which may
  168. # result in minions which do not respond to the first command after a key refresh.
  169. #
  170. # To tell the master to ping all minions immediately after an AES key refresh, set
  171. # ping_on_rotate to True. This should mitigate the issue where a minion does not
  172. # appear to initially respond after a key is rotated.
  173. #
  174. # Note that ping_on_rotate may cause high load on the master immediately after
  175. # the key rotation event as minions reconnect. Consider this carefully if this
  176. # salt master is managing a large number of minions.
  177. #
  178. # If disabled, it is recommended to handle this event by listening for the
  179. # 'aes_key_rotate' event with the 'key' tag and acting appropriately.
  180. {{ get_config('ping_on_rotate', 'False') }}
  181. # By default, the master deletes its cache of minion data when the key for that
  182. # minion is removed. To preserve the cache after key deletion, set
  183. # 'preserve_minion_cache' to True.
  184. #
  185. # WARNING: This may have security implications if compromised minions auth with
  186. # a previous deleted minion ID.
  187. {{ get_config('preserve_minion_cache', 'False') }}
  188. # If max_minions is used in large installations, the master might experience
  189. # high-load situations because of having to check the number of connected
  190. # minions for every authentication. This cache provides the minion-ids of
  191. # all connected minions to all MWorker-processes and greatly improves the
  192. # performance of max_minions.
  193. {{ get_config('con_cache', 'False') }}
  194. # The master can include configuration from other files. To enable this,
  195. # pass a list of paths to this option. The paths can be either relative or
  196. # absolute; if relative, they are considered to be relative to the directory
  197. # the main master configuration file lives in (this file). Paths can make use
  198. # of shell-style globbing. If no files are matched by a path passed to this
  199. # option, then the master will log a warning message.
  200. #
  201. # Include a config file from some other path:
  202. # include: /etc/salt/extra_config
  203. #
  204. # Include config from several files and directories:
  205. # include:
  206. # - /etc/salt/extra_config
  207. {{ get_config('include', '[]') }}
  208. ##### Large-scale tuning settings #####
  209. ##########################################
  210. # Max open files
  211. #
  212. # Each minion connecting to the master uses AT LEAST one file descriptor, the
  213. # master subscription connection. If enough minions connect you might start
  214. # seeing on the console (and then salt-master crashes):
  215. # Too many open files (tcp_listener.cpp:335)
  216. # Aborted (core dumped)
  217. #
  218. # By default this value will be the one of `ulimit -Hn`, ie, the hard limit for
  219. # max open files.
  220. #
  221. # If you wish to set a different value than the default one, uncomment and
  222. # configure this setting. Remember that this value CANNOT be higher than the
  223. # hard limit. Raising the hard limit depends on your OS and/or distribution,
  224. # a good way to find the limit is to search the internet. For example:
  225. # raise max open files hard limit debian
  226. #
  227. {{ get_config('max_open_files', '100000') }}
  228. # The number of worker threads to start. These threads are used to manage
  229. # return calls made from minions to the master. If the master seems to be
  230. # running slowly, increase the number of threads. This setting can not be
  231. # set lower than 3.
  232. {{ get_config('worker_threads', '5') }}
  233. # Set the ZeroMQ high water marks
  234. # http://api.zeromq.org/3-2:zmq-setsockopt
  235. # The publisher interface ZeroMQPubServerChannel
  236. {{ get_config('pub_hwm', '1000') }}
  237. # These two ZMQ HWM settings, salt_event_pub_hwm and event_publisher_pub_hwm
  238. # are significant for masters with thousands of minions. When these are
  239. # insufficiently high it will manifest in random responses missing in the CLI
  240. # and even missing from the job cache. Masters that have fast CPUs and many
  241. # cores with appropriate worker_threads will not need these set as high.
  242. # On deployment with 8,000 minions, 2.4GHz CPUs, 24 cores, 32GiB memory has
  243. # these settings:
  244. #
  245. # salt_event_pub_hwm: 128000
  246. # event_publisher_pub_hwm: 64000
  247. # ZMQ high-water-mark for SaltEvent pub socket
  248. {{ get_config('salt_event_pub_hwm', '20000') }}
  249. # ZMQ high-water-mark for EventPublisher pub socket
  250. {{ get_config('event_publisher_pub_hwm', '10000') }}
  251. ##### Security settings #####
  252. ##########################################
  253. # Enable "open mode", this mode still maintains encryption, but turns off
  254. # authentication, this is only intended for highly secure environments or for
  255. # the situation where your keys end up in a bad state. If you run in open mode
  256. # you do so at your own risk!
  257. {{ get_config('open_mode', 'False') }}
  258. # Enable auto_accept, this setting will automatically accept all incoming
  259. # public keys from the minions. Note that this is insecure.
  260. {{ get_config('auto_accept', 'False') }}
  261. # Time in minutes that a incoming public key with a matching name found in
  262. # pki_dir/minion_autosign/keyid is automatically accepted. Expired autosign keys
  263. # are removed when the master checks the minion_autosign directory.
  264. # 0 equals no timeout
  265. {{ get_config('autosign_timeout', '120') }}
  266. # If the autosign_file is specified, incoming keys specified in the
  267. # autosign_file will be automatically accepted. This is insecure. Regular
  268. # expressions as well as globing lines are supported.
  269. {{ get_config('autosign_file', '/etc/salt/autosign.conf') }}
  270. # Works like autosign_file, but instead allows you to specify minion IDs for
  271. # which keys will automatically be rejected. Will override both membership in
  272. # the autosign_file and the auto_accept setting.
  273. {{ get_config('autoreject_file', '/etc/salt/autoreject.conf') }}
  274. # Enable permissive access to the salt keys. This allows you to run the
  275. # master or minion as root, but have a non-root group be given access to
  276. # your pki_dir. To make the access explicit, root must belong to the group
  277. # you've given access to. This is potentially quite insecure. If an autosign_file
  278. # is specified, enabling permissive_pki_access will allow group access to that
  279. # specific file.
  280. {{ get_config('permissive_pki_access', 'False') }}
  281. # Allow users on the master access to execute specific commands on minions.
  282. # This setting should be treated with care since it opens up execution
  283. # capabilities to non root users. By default this capability is completely
  284. # disabled.
  285. {% if 'client_acl' in cfg_master -%}
  286. {%- do default_keys.append('client_acl') %}
  287. client_acl:
  288. {%- for name, user in cfg_master['client_acl']|dictsort %}
  289. {{ name}}:
  290. {%- for command in user %}
  291. - {% raw %}'{% endraw %}{{ command }}{% raw %}'{% endraw %}
  292. {%- endfor -%}
  293. {%- endfor -%}
  294. {% elif 'client_acl' in cfg_salt -%}
  295. client_acl:
  296. {%- for name, user in cfg_salt['client_acl']|dictsort %}
  297. {{ name }}:
  298. {%- for command in user %}
  299. - {% raw %}'{% endraw %}{{ command }}{% raw %}'{% endraw %}
  300. {%- endfor -%}
  301. {%- endfor -%}
  302. {% else -%}
  303. #client_acl:
  304. # larry:
  305. # - test.ping
  306. # - network.*
  307. {%- endif %}
  308. # Blacklist any of the following users or modules
  309. #
  310. # This example would blacklist all non sudo users, including root from
  311. # running any commands. It would also blacklist any use of the "cmd"
  312. # module. This is completely disabled by default.
  313. {% if 'client_acl_blacklist' in cfg_master %}
  314. {%- do default_keys.append('client_acl_blacklist') %}
  315. client_acl_blacklist:
  316. users:
  317. {% for user in cfg_master['client_acl_blacklist'].get('users', []) %}
  318. - {{ user }}
  319. {% endfor %}
  320. modules:
  321. {% for mod in cfg_master['client_acl_blacklist'].get('modules', []) %}
  322. - {{ mod }}
  323. {% endfor %}
  324. {% elif 'client_acl_blacklist' in cfg_salt %}
  325. client_acl_blacklist:
  326. users:
  327. {% for user in cfg_salt['client_acl_blacklist'].get('users', []) %}
  328. - {{ user }}
  329. {% endfor %}
  330. modules:
  331. {% for mod in cfg_salt['client_acl_blacklist'].get('modules', []) %}
  332. - {{ mod }}
  333. {% endfor %}
  334. {% else %}
  335. #client_acl_blacklist:
  336. # users:
  337. # - root
  338. # - '^(?!sudo_).*$' # all non sudo users
  339. # modules:
  340. # - cmd
  341. {% endif %}
  342. # Enforce client_acl & client_acl_blacklist when users have sudo
  343. # access to the salt command.
  344. {{ get_config('sudo_acl', 'False') }}
  345. # The external auth system uses the Salt auth modules to authenticate and
  346. # validate users to access areas of the Salt system.
  347. #external_auth:
  348. # pam:
  349. # fred:
  350. # - test.*
  351. {{ get_config('external_auth', '{}') }}
  352. # Time (in seconds) for a newly generated token to live. Default: 12 hours
  353. {{ get_config('token_expire', '43200') }}
  354. # Allow minions to push files to the master. This is disabled by default, for
  355. # security purposes.
  356. {{ get_config('file_recv', 'False') }}
  357. # Set a hard-limit on the size of the files that can be pushed to the master.
  358. # It will be interpreted as megabytes. Default: 100
  359. {{ get_config('file_recv_max_size', '100') }}
  360. # Signature verification on messages published from the master.
  361. # This causes the master to cryptographically sign all messages published to its event
  362. # bus, and minions then verify that signature before acting on the message.
  363. #
  364. # This is False by default.
  365. #
  366. # Note that to facilitate interoperability with masters and minions that are different
  367. # versions, if sign_pub_messages is True but a message is received by a minion with
  368. # no signature, it will still be accepted, and a warning message will be logged.
  369. # Conversely, if sign_pub_messages is False, but a minion receives a signed
  370. # message it will be accepted, the signature will not be checked, and a warning message
  371. # will be logged. This behavior went away in Salt 2014.1.0 and these two situations
  372. # will cause minion to throw an exception and drop the message.
  373. {{ get_config('sign_pub_message', 'False') }}
  374. # Sign the master auth-replies with a cryptographic signature of the masters public key.
  375. # Please see the tutorial how to use these settings in the Multimaster-PKI with Failover Tutorial
  376. {{ get_config('master_sign_pubkey', 'False') }}
  377. # The customizable name of the signing-key-pair without suffix.
  378. # master_sign_key_name: <filename_without_suffix>
  379. {{ get_config('master_sign', '{}') }}
  380. # The name of the file in the masters pki-directory that holds the pre-calculated
  381. # signature of the masters public-key.
  382. # master_pubkey_signature: <filename>
  383. {{ get_config('master_pubkey_signature', '{}') }}
  384. # Instead of computing the signature for each auth-reply, use a pre-calculated signature.
  385. # The master_pubkey_signature must also be set for this.
  386. {{ get_config('master_use_pubkey_signature', 'False') }}
  387. # Rotate the salt-masters AES-key when a minion-public is deleted with salt-key.
  388. # This is a very important security-setting. Disabling it will enable deleted minions to still
  389. # listen in on the messages published by the salt-master.
  390. # Do not disable this unless it is absolutely clear what this does.
  391. {{ get_config('rotate_aes_key', 'True') }}
  392. # Unique ID attribute name for the user. For Active Directory should be set
  393. # to 'sAMAccountName'. Default value is 'memberUid'.
  394. {{ get_config('auth.ldap.accountattributename', 'memberUid') }}
  395. # Set this to True if LDAP is Active Directory. Default is False
  396. {{ get_config('auth.ldap.activedirectory', False) }}
  397. # Bind to LDAP anonymously to determine group membership
  398. # Active Directory does not allow anonymous binds without special configuration
  399. {{ get_config('auth.ldap.anonymous', False) }}
  400. # The base DN under which users can be found in LDAP
  401. {{ get_config('auth.ldap.basedn', '') }}
  402. # The user Salt authenticates to search for a users' Distinguished Name and
  403. # group membership.
  404. {{ get_config('auth.ldap.binddn', '') }}
  405. # The bind password to go along with the bind dn (binddn).
  406. {{ get_config('auth.ldap.bindpw', '') }}
  407. # The filter used to find the DN associated with a user. For most LDAPs use
  408. # the value {% raw %}'uid={{ username }}'{% endraw %}. For Active Directory use the value
  409. # {% raw %}'sAMAccountName={{username}}'{% endraw %}.
  410. {{ get_config('auth.ldap.filter', '') }}
  411. # The attribute used for user group membership. Defaults to 'memberOf'
  412. {{ get_config('auth.ldap.groupattribute', 'memberOf') }}
  413. # LDAP group class. Use 'group' for Active Directory. Defaults to 'posixGroup'
  414. {{ get_config('auth.ldap.groupclass', 'posixGroup') }}
  415. # To specify an OU that contains group data. Not used for Active Directory
  416. # Default value: 'Groups'
  417. {{ get_config('auth.ldap.groupou', 'Groups') }}
  418. # Allows the administrator to strip off a certain set of domain names
  419. # so the hostnames looked up in the directory service can match the minion IDs.
  420. {{ get_config('auth.ldap.minion_stripdomains', []) }}
  421. # Verify server's TLS certificate. Default value: False
  422. {{ get_config('auth.ldap.no_verify', False) }}
  423. # Only for Active Directory. Default value: 'person'
  424. {{ get_config('auth.ldap.persontype', 'person') }}
  425. # Port to connect via. Default value: '389'
  426. {{ get_config('auth.ldap.port', '389') }}
  427. # LDAP scope level, almost always 2. Default value: 2
  428. {{ get_config('auth.ldap.scope', 2) }}
  429. # Server to auth against. Default value: 'localhost'
  430. {{ get_config('auth.ldap.server', 'localhost') }}
  431. # Use TLS when connecting. Default value: False
  432. {{ get_config('auth.ldap.tls', False) }}
  433. # Server specified in URI format. Overrides .ldap.server, .ldap.port,
  434. # .ldap.tls. Default value: ''
  435. {{ get_config('auth.ldap.uri', '') }}
  436. ##### Salt-SSH Configuration #####
  437. ##########################################
  438. # Pass in an alternative location for the salt-ssh roster file
  439. {{ get_config('roster_file', '/etc/salt/roster') }}
  440. # Pass in minion option overrides that will be inserted into the SHIM for
  441. # salt-ssh calls. The local minion config is not used for salt-ssh. Can be
  442. # overridden on a per-minion basis in the roster (`minion_opts`)
  443. #ssh_minion_opts:
  444. # gpg_keydir: /root/gpg
  445. {{ get_config('ssh_minion_opts', '{}') }}
  446. ##### Master Module Management #####
  447. ##########################################
  448. # Manage how master side modules are loaded.
  449. # Add any additional locations to look for master runners:
  450. {{ get_config('runner_dirs', '[]') }}
  451. # Enable Cython for master side modules:
  452. {{ get_config('cython_enable', 'False') }}
  453. ##### State System settings #####
  454. ##########################################
  455. # The state system uses a "top" file to tell the minions what environment to
  456. # use and what modules to use. The state_top file is defined relative to the
  457. # root of the base environment as defined in "File Server settings" below.
  458. {{ get_config('state_top', 'top.sls') }}
  459. # The master_tops option replaces the external_nodes option by creating
  460. # a plugable system for the generation of external top data. The external_nodes
  461. # option is deprecated by the master_tops option.
  462. #
  463. # To gain the capabilities of the classic external_nodes system, use the
  464. # following configuration:
  465. # master_tops:
  466. # ext_nodes: <Shell command which returns yaml>
  467. #
  468. #master_tops: {}
  469. {% if 'master_tops' in cfg_master %}
  470. {%- do default_keys.append('master_tops') %}
  471. master_tops:
  472. {%- for master in cfg_master['master_tops'] -%}
  473. {%- if cfg_master['master_tops'][master] is string %}
  474. {{ master }}: {{ cfg_master['master_tops'][master] }}
  475. {%- else %}
  476. {{ master}}:
  477. {%- for parameter in cfg_master['master_tops'][master] %}
  478. {{ parameter }}: {{ cfg_master['master_tops'][master][parameter] }}
  479. {%- endfor -%}
  480. {%- endif -%}
  481. {%- endfor %}
  482. {% endif %}
  483. # The external_nodes option allows Salt to gather data that would normally be
  484. # placed in a top file. The external_nodes option is the executable that will
  485. # return the ENC data. Remember that Salt will look for external nodes AND top
  486. # files and combine the results if both are enabled!
  487. {{ get_config('external_nodes', 'None') }}
  488. # The renderer to use on the minions to render the state data
  489. {{ get_config('renderer', 'yaml_jinja') }}
  490. # The Jinja renderer can strip extra carriage returns and whitespace
  491. # See http://jinja.pocoo.org/docs/api/#high-level-api
  492. #
  493. # If this is set to True the first newline after a Jinja block is removed
  494. # (block, not variable tag!). Defaults to False, corresponds to the Jinja
  495. # environment init variable "trim_blocks".
  496. {{ get_config('jinja_trim_blocks', 'False') }}
  497. # If this is set to True leading spaces and tabs are stripped from the start
  498. # of a line to a block. Defaults to False, corresponds to the Jinja
  499. # environment init variable "lstrip_blocks".
  500. {{ get_config('jinja_lstrip_blocks', 'False') }}
  501. # The failhard option tells the minions to stop immediately after the first
  502. # failure detected in the state execution, defaults to False
  503. {{ get_config('failhard', 'False') }}
  504. # The state_verbose and state_output settings can be used to change the way
  505. # state system data is printed to the display. By default all data is printed.
  506. # The state_verbose setting can be set to True or False, when set to False
  507. # all data that has a result of True and no changes will be suppressed.
  508. {{ get_config('state_verbose', 'True') }}
  509. # The state_output setting changes if the output is the full multi line
  510. # output for each changed state if set to 'full', but if set to 'terse'
  511. # the output will be shortened to a single line. If set to 'mixed', the output
  512. # will be terse unless a state failed, in which case that output will be full.
  513. # If set to 'changes', the output will be full unless the state didn't change.
  514. {{ get_config('state_output', 'full') }}
  515. # Automatically aggregate all states that have support for mod_aggregate by
  516. # setting to 'True'. Or pass a list of state module names to automatically
  517. # aggregate just those types.
  518. #
  519. # state_aggregate:
  520. # - pkg
  521. #
  522. #state_aggregate: False
  523. {{ get_config('state_aggregate', '{}') }}
  524. # Send progress events as each function in a state run completes execution
  525. # by setting to 'True'. Progress events are in the format
  526. # 'salt/job/<JID>/prog/<MID>/<RUN NUM>'.
  527. {{ get_config('state_events', 'False') }}
  528. # Enable extra routines for YAML renderer used states containing UTF characters.
  529. {{ get_config('yaml_utf8', 'False') }}
  530. ##### File Server settings #####
  531. ##########################################
  532. # Salt runs a lightweight file server written in zeromq to deliver files to
  533. # minions. This file server is built into the master daemon and does not
  534. # require a dedicated port.
  535. # The file server works on environments passed to the master, each environment
  536. # can have multiple root directories, the subdirectories in the multiple file
  537. # roots cannot match, otherwise the downloaded files will not be able to be
  538. # reliably ensured. A base environment is required to house the top file.
  539. # Example:
  540. # file_roots:
  541. # base:
  542. # - /srv/salt/
  543. # dev:
  544. # - /srv/salt/dev/services
  545. # - /srv/salt/dev/states
  546. # prod:
  547. # - /srv/salt/prod/services
  548. # - /srv/salt/prod/states
  549. #
  550. {% if 'file_roots' in cfg_master -%}
  551. {%- do default_keys.append('file_roots') %}
  552. {{ file_roots(cfg_master['file_roots']) }}
  553. {%- elif 'file_roots' in cfg_salt -%}
  554. {{ file_roots(cfg_salt['file_roots']) }}
  555. {%- elif formulas|length -%}
  556. {{ file_roots({'base': ['/srv/salt']}) }}
  557. {%- else -%}
  558. #file_roots:
  559. # base:
  560. # - /srv/salt
  561. {%- endif %}
  562. # When using multiple environments, each with their own top file, the
  563. # default behaviour is an unordered merge. To prevent top files from
  564. # being merged together and instead to only use the top file from the
  565. # requested environment, set this value to 'same'.
  566. {{ get_config('top_file_merging_strategy', 'merge') }}
  567. # To specify the order in which environments are merged, set the ordering
  568. # in the env_order option. Given a conflict, the last matching value will
  569. # win.
  570. {{ get_config('env_order', '["base", "dev", "prod"]') }}
  571. # If top_file_merging_strategy is set to 'same' and an environment does not
  572. # contain a top file, the top file in the environment specified by default_top
  573. # will be used instead.
  574. {{ get_config('default_top', 'base') }}
  575. # The hash_type is the hash to use when discovering the hash of a file on
  576. # the master server. The default is md5, but sha1, sha224, sha256, sha384
  577. # and sha512 are also supported.
  578. #
  579. # Prior to changing this value, the master should be stopped and all Salt
  580. # caches should be cleared.
  581. {{ get_config('hash_type', 'md5') }}
  582. # The buffer size in the file server can be adjusted here:
  583. {{ get_config('file_buffer_size', '1048576') }}
  584. # A regular expression (or a list of expressions) that will be matched
  585. # against the file path before syncing the modules and states to the minions.
  586. # This includes files affected by the file.recurse state.
  587. # For example, if you manage your custom modules and states in subversion
  588. # and don't want all the '.svn' folders and content synced to your minions,
  589. # you could set this to '/\.svn($|/)'. By default nothing is ignored.
  590. {% if 'file_ignore_regex' in cfg_master %}
  591. {%- do default_keys.append('file_ignore_regex') %}
  592. file_ignore_regex:
  593. {% for regex in cfg_master['file_ignore_regex'] %}
  594. - {{ regex }}
  595. {% endfor %}
  596. {% elif 'file_ignore_regex' in cfg_salt %}
  597. file_ignore_regex:
  598. {% for regex in cfg_salt['file_ignore_regex'] %}
  599. - {{ regex }}
  600. {% endfor %}
  601. {% else %}
  602. #file_ignore_regex:
  603. # - '/\.svn($|/)'
  604. # - '/\.git($|/)'
  605. {% endif %}
  606. # A file glob (or list of file globs) that will be matched against the file
  607. # path before syncing the modules and states to the minions. This is similar
  608. # to file_ignore_regex above, but works on globs instead of regex. By default
  609. # nothing is ignored.
  610. {% if 'file_ignore_glob' in cfg_master %}
  611. {%- do default_keys.append('file_ignore_glob') %}
  612. file_ignore_glob:
  613. {% for glob in cfg_master['file_ignore_glob'] %}
  614. - {{ glob }}
  615. {% endfor %}
  616. {% elif 'file_ignore_glob' in cfg_salt %}
  617. file_ignore_glob:
  618. {% for glob in cfg_salt['file_ignore_glob'] %}
  619. - {{ glob }}
  620. {% endfor %}
  621. {% else %}
  622. # file_ignore_glob:
  623. # - '*.pyc'
  624. # - '*/somefolder/*.bak'
  625. # - '*.swp'
  626. {% endif %}
  627. # File Server Backend
  628. #
  629. # Salt supports a modular fileserver backend system, this system allows
  630. # the salt master to link directly to third party systems to gather and
  631. # manage the files available to minions. Multiple backends can be
  632. # configured and will be searched for the requested file in the order in which
  633. # they are defined here. The default setting only enables the standard backend
  634. # "roots" which uses the "file_roots" option.
  635. #fileserver_backend:
  636. # - roots
  637. #
  638. # To use multiple backends list them in the order they are searched:
  639. #fileserver_backend:
  640. # - git
  641. # - roots
  642. {% if 'fileserver_backend' in cfg_master -%}
  643. {%- do default_keys.append('fileserver_backend') %}
  644. fileserver_backend:
  645. {%- for backend in cfg_master['fileserver_backend'] %}
  646. - {{ backend }}
  647. {%- endfor -%}
  648. {%- endif %}
  649. # Uncomment the line below if you do not want the file_server to follow
  650. # symlinks when walking the filesystem tree. This is set to True
  651. # by default. Currently this only applies to the default roots
  652. # fileserver_backend.
  653. {{ get_config('fileserver_followsymlinks', 'False') }}
  654. # Uncomment the line below if you do not want symlinks to be
  655. # treated as the files they are pointing to. By default this is set to
  656. # False. By uncommenting the line below, any detected symlink while listing
  657. # files on the Master will not be returned to the Minion.
  658. {{ get_config('fileserver_ignoresymlinks', 'True') }}
  659. # By default, the Salt fileserver recurses fully into all defined environments
  660. # to attempt to find files. To limit this behavior so that the fileserver only
  661. # traverses directories with SLS files and special Salt directories like _modules,
  662. # enable the option below. This might be useful for installations where a file root
  663. # has a very large number of files and performance is impacted. Default is False.
  664. {{ get_config('fileserver_limit_traversal', 'False') }}
  665. # The fileserver can fire events off every time the fileserver is updated,
  666. # these are disabled by default, but can be easily turned on by setting this
  667. # flag to True
  668. {{ get_config('fileserver_events', 'False') }}
  669. # Git File Server Backend Configuration
  670. #
  671. # Optional parameter used to specify the provider to be used for gitfs. Must
  672. # be one of the following: pygit2, gitpython, or dulwich. If unset, then each
  673. # will be tried in that same order, and the first one with a compatible
  674. # version installed will be the provider that is used.
  675. {{ get_config('gitfs_provider', 'pygit2') }}
  676. # Along with gitfs_password, is used to authenticate to HTTPS remotes.
  677. {{ get_config('gitfs_user', 'git') }}
  678. # Along with gitfs_user, is used to authenticate to HTTPS remotes.
  679. # This parameter is not required if the repository does not use authentication.
  680. {{ get_config('gitfs_password', '') }}
  681. # By default, Salt will not authenticate to an HTTP (non-HTTPS) remote.
  682. # This parameter enables authentication over HTTP. Enable this at your own risk.
  683. {{ get_config('gitfs_insecure_auth', 'False') }}
  684. # Along with gitfs_privkey (and optionally gitfs_passphrase), is used to
  685. # authenticate to SSH remotes. This parameter (or its per-remote counterpart)
  686. # is required for SSH remotes.
  687. {{ get_config('gitfs_pubkey', '') }}
  688. # Along with gitfs_pubkey (and optionally gitfs_passphrase), is used to
  689. # authenticate to SSH remotes. This parameter (or its per-remote counterpart)
  690. # is required for SSH remotes.
  691. {{ get_config('gitfs_privkey', '') }}
  692. # This parameter is optional, required only when the SSH key being used to
  693. # authenticate is protected by a passphrase.
  694. {{ get_config('gitfs_passphrase', '') }}
  695. # When using the git fileserver backend at least one git remote needs to be
  696. # defined. The user running the salt master will need read access to the repo.
  697. #
  698. # The repos will be searched in order to find the file requested by a client
  699. # and the first repo to have the file will return it.
  700. # When using the git backend branches and tags are translated into salt
  701. # environments.
  702. # Note: file:// repos will be treated as a remote, so refs you want used must
  703. # exist in that repo as *local* refs.
  704. {% if 'gitfs_remotes' in cfg_master -%}
  705. {%- do default_keys.append('gitfs_remotes') %}
  706. gitfs_remotes:
  707. {%- for remote in cfg_master['gitfs_remotes'] %}
  708. {%- if remote is iterable and remote is not string %}
  709. {%- for repo, children in remote.items() %}
  710. - {{ repo }}:
  711. {%- for child in children %}
  712. {%- for key, value in child.items() %}
  713. - {{ key }}: {{ value }}
  714. {%- endfor -%}
  715. {%- endfor -%}
  716. {%- endfor -%}
  717. {%- else %}
  718. - {{ remote }}
  719. {%- endif -%}
  720. {%- endfor -%}
  721. {%- endif %}
  722. #gitfs_remotes:
  723. # - git://github.com/saltstack/salt-states.git
  724. # - file:///var/git/saltmaster
  725. #
  726. # The gitfs_ssl_verify option specifies whether to ignore ssl certificate
  727. # errors when contacting the gitfs backend. You might want to set this to
  728. # false if you're using a git backend that uses a self-signed certificate but
  729. # keep in mind that setting this flag to anything other than the default of True
  730. # is a security concern, you may want to try using the ssh transport.
  731. {{ get_config('gitfs_ssl_verify', 'True') }}
  732. # The gitfs_root option gives the ability to serve files from a subdirectory
  733. # within the repository. The path is defined relative to the root of the
  734. # repository and defaults to the repository root.
  735. {{ get_config('gitfs_root', 'somefolder/otherfolder') }}
  736. # The gitfs_env_whitelist and gitfs_env_blacklist parameters allow for greater
  737. # control over which branches/tags are exposed as fileserver environments.
  738. {% if 'gitfs_env_whitelist' in cfg_master -%}
  739. {%- do default_keys.append('gitfs_env_whitelist') %}
  740. gitfs_env_whitelist:
  741. {%- for git_env in cfg_master['gitfs_env_whitelist'] %}
  742. - {{ git_env }}
  743. {%- endfor -%}
  744. {% else -%}
  745. # gitfs_env_whitelist:
  746. # - base
  747. # - v1.*
  748. {% endif %}
  749. {% if 'gitfs_env_blacklist' in cfg_master -%}
  750. {%- do default_keys.append('gitfs_env_blacklist') %}
  751. gitfs_env_blacklist:
  752. {%- for git_env in cfg_master['gitfs_env_blacklist'] %}
  753. - {{ git_env }}
  754. {%- endfor -%}
  755. {% else -%}
  756. # gitfs_env_blacklist:
  757. # - bug/*
  758. # - feature/*
  759. {% endif %}
  760. # S3 File Server Backend Configuration
  761. #
  762. # S3 credentials must be set in the master config file.
  763. # Alternatively, if on EC2 these credentials can be automatically
  764. # loaded from instance metadata.
  765. {% if 's3.keyid' in cfg_master -%}
  766. {{ get_config('s3.keyid', '<no default>') }}
  767. {{ get_config('s3.key', '<no default>') }}
  768. {% else -%}
  769. # s3.keyid: GKTADJGHEIQSXMKKRBJ08H
  770. # s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
  771. {% endif %}
  772. # This fileserver supports two modes of operation for the buckets:
  773. # - A single bucket per environment
  774. # - Multiple environments per bucket
  775. #
  776. # Note that bucket names must be all lowercase both in the AWS console
  777. # and in Salt, otherwise you may encounter SignatureDoesNotMatch
  778. # errors.
  779. #
  780. # A multiple-environment bucket must adhere to the following root
  781. # directory structure:
  782. #
  783. # s3://<bucket name>/<environment>/<files>
  784. #
  785. # This fileserver back-end requires the use of the MD5 hashing
  786. # algorithm. MD5 may not be compliant with all security policies.
  787. {% if 's3.buckets' in cfg_master -%}
  788. {{ get_config('s3.buckets', '<no default>') }}
  789. {% else -%}
  790. # s3.buckets: #single bucket per environment
  791. # production:
  792. # - bucket1
  793. # - bucket2
  794. # staging:
  795. # - bucket3
  796. # - bucket4
  797. #
  798. # s3.buckets: #multiple environments per bucket
  799. # - bucket1
  800. # - bucket2
  801. # - bucket3
  802. # - bucket4
  803. {% endif %}
  804. ##### Pillar settings #####
  805. ##########################################
  806. # Salt Pillars allow for the building of global data that can be made selectively
  807. # available to different minions based on minion grain filtering. The Salt
  808. # Pillar is laid out in the same fashion as the file server, with environments,
  809. # a top file and sls files. However, pillar data does not need to be in the
  810. # highstate format, and is generally just key/value pairs.
  811. {% if 'pillar_roots' in cfg_master -%}
  812. {%- do default_keys.append('pillar_roots') %}
  813. pillar_roots:
  814. {%- for name, roots in cfg_master['pillar_roots']|dictsort %}
  815. {{ name }}:
  816. {%- for dir in roots %}
  817. - {{ dir }}
  818. {%- endfor -%}
  819. {%- endfor -%}
  820. {% elif 'pillar_roots' in cfg_salt -%}
  821. pillar_roots:
  822. {%- for name, roots in cfg_salt['pillar_roots']|dictsort %}
  823. {{ name }}:
  824. {%- for dir in roots %}
  825. - {{ dir }}
  826. {%- endfor -%}
  827. {%- endfor -%}
  828. {%- else -%}
  829. #pillar_roots:
  830. # base:
  831. # - /srv/pillar
  832. {%- endif %}
  833. {% if 'ext_pillar' in cfg_master %}
  834. {%- do default_keys.append('ext_pillar') %}
  835. ext_pillar:
  836. {%- for pillar in cfg_master['ext_pillar'] -%}
  837. {%- for key in pillar -%}
  838. {%- if pillar[key] is string %}
  839. - {{ key }}: {{ pillar[key] }}
  840. {%- elif pillar[key] is iterable and pillar[key] is not mapping %}
  841. - {{ key }}:
  842. {%- for parameter in pillar[key] %}
  843. - {{ parameter }}
  844. {%- endfor -%}
  845. {%- elif pillar[key] is mapping and pillar[key] is not string %}
  846. - {{ key }}:
  847. {%- for parameter in pillar[key] %}
  848. {{ parameter }}: {{pillar[key][parameter]}}
  849. {%- endfor %}
  850. {%- else %}
  851. # Error in rendering {{ key }}, please read https://docs.saltstack.com/en/latest/topics/development/external_pillars.html#configuration
  852. {% endif %}
  853. {%- endfor -%}
  854. {%- endfor %}
  855. {% elif 'ext_pillar' in cfg_salt %}
  856. ext_pillar:
  857. {% for pillar in cfg_salt['ext_pillar'] %}
  858. - {{ pillar.items()[0][0] }}: {{ pillar.items()[0][1] }}
  859. {% endfor %}
  860. {% else %}
  861. #ext_pillar:
  862. # - hiera: /etc/hiera.yaml
  863. # - cmd_yaml: cat /etc/salt/yaml
  864. {% endif %}
  865. # The ext_pillar_first option allows for external pillar sources to populate
  866. # before file system pillar. This allows for targeting file system pillar from
  867. # ext_pillar.
  868. {{ get_config('ext_pillar_first', 'False') }}
  869. # The pillar_gitfs_ssl_verify option specifies whether to ignore ssl certificate
  870. # errors when contacting the pillar gitfs backend. You might want to set this to
  871. # false if you're using a git backend that uses a self-signed certificate but
  872. # keep in mind that setting this flag to anything other than the default of True
  873. # is a security concern, you may want to try using the ssh transport.
  874. {{ get_config('pillar_gitfs_ssl_verify', 'True') }}
  875. # The pillar_opts option adds the master configuration file data to a dict in
  876. # the pillar called "master". This is used to set simple configurations in the
  877. # master config file that can then be used on minions.
  878. {{ get_config('pillar_opts', 'False') }}
  879. # The pillar_safe_render_error option prevents the master from passing pillar
  880. # render errors to the minion. This is set on by default because the error could
  881. # contain templating data which would give that minion information it shouldn't
  882. # have, like a password! When set true the error message will only show:
  883. # Rendering SLS 'my.sls' failed. Please see master log for details.
  884. {{ get_config('pillar_safe_render_error', 'True') }}
  885. # The pillar_source_merging_strategy option allows you to configure merging strategy
  886. # between different sources. It accepts four values: recurse, aggregate, overwrite,
  887. # or smart. Recurse will merge recursively mapping of data. Aggregate instructs
  888. # aggregation of elements between sources that use the #!yamlex renderer. Overwrite
  889. # will verwrite elements according the order in which they are processed. This is
  890. # behavior of the 2014.1 branch and earlier. Smart guesses the best strategy based
  891. # on the "renderer" setting and is the default value.
  892. {{ get_config('pillar_source_merging_strategy', 'smart') }}
  893. # Recursively merge lists by aggregating them instead of replacing them.
  894. {{ get_config('pillar_merge_lists', False) }}
  895. # Git External Pillar (git_pillar) Configuration Options
  896. #
  897. # Specify the provider to be used for git_pillar. Must be either pygit2 or
  898. # gitpython. If unset, then both will be tried in that same order, and the
  899. # first one with a compatible version installed will be the provider that
  900. # is used.
  901. {{ get_config('git_pillar_provider', 'pygit2') }}
  902. # If the desired branch matches this value, and the environment is omitted
  903. # from the git_pillar configuration, then the environment for that git_pillar
  904. # remote will be base.
  905. {{ get_config('git_pillar_base', 'master') }}
  906. # If the branch is omitted from a git_pillar remote, then this branch will
  907. # be used instead.
  908. {{ get_config('git_pillar_branch', 'master') }}
  909. # Environment to use for git_pillar remotes. This is normally derived from
  910. # the branch/tag (or from a per-remote env parameter), but if set this will
  911. # override the process of deriving the env from the branch/tag name.
  912. {{ get_config('git_pillar_env', '') }}
  913. # Path relative to the root of the repository where the git_pillar top file
  914. # and SLS files are located.
  915. {{ get_config('git_pillar_root', 'pillar') }}
  916. # Specifies whether or not to ignore SSL certificate errors when contacting
  917. # the remote repository.
  918. {{ get_config('git_pillar_ssl_verify', True) }}
  919. # When set to False, if there is an update/checkout lock for a git_pillar
  920. # remote and the pid written to it is not running on the master, the lock
  921. # file will be automatically cleared and a new lock will be obtained.
  922. {{ get_config('git_pillar_global_lock', False) }}
  923. # Git External Pillar Authentication Options
  924. #
  925. # Along with git_pillar_password, is used to authenticate to HTTPS remotes.
  926. {{ get_config('git_pillar_user', '') }}
  927. # Along with git_pillar_user, is used to authenticate to HTTPS remotes.
  928. # This parameter is not required if the repository does not use authentication.
  929. {{ get_config('git_pillar_password', '') }}
  930. # By default, Salt will not authenticate to an HTTP (non-HTTPS) remote.
  931. # This parameter enables authentication over HTTP.
  932. {{ get_config('git_pillar_insecure_auth', False) }}
  933. # Along with git_pillar_privkey (and optionally git_pillar_passphrase),
  934. # is used to authenticate to SSH remotes.
  935. {{ get_config('git_pillar_pubkey', '') }}
  936. # Along with git_pillar_pubkey (and optionally git_pillar_passphrase),
  937. # is used to authenticate to SSH remotes.
  938. {{ get_config('git_pillar_privkey', '') }}
  939. # This parameter is optional, required only when the SSH key being used
  940. # to authenticate is protected by a passphrase.
  941. {{ get_config('git_pillar_passphrase', '') }}
  942. ##### Syndic settings #####
  943. ##########################################
  944. # The Salt syndic is used to pass commands through a master from a higher
  945. # master. Using the syndic is simple. If this is a master that will have
  946. # syndic servers(s) below it, then set the "order_masters" setting to True.
  947. #
  948. # If this is a master that will be running a syndic daemon for passthrough, then
  949. # the "syndic_master" setting needs to be set to the location of the master server
  950. # to receive commands from.
  951. # Set the order_masters setting to True if this master will command lower
  952. # masters' syndic interfaces.
  953. {{ get_config('order_masters', 'False') }}
  954. # If this master will be running a salt syndic daemon, syndic_master tells
  955. # this master where to receive commands from.
  956. {{ get_config('syndic_master', 'masterofmaster') }}
  957. # This is the 'ret_port' of the MasterOfMaster:
  958. {{ get_config('syndic_master_port', '4506') }}
  959. # PID file of the syndic daemon:
  960. {{ get_config('syndic_pidfile', '/var/run/salt-syndic.pid') }}
  961. # LOG file of the syndic daemon:
  962. {{ get_config('syndic_log_file', 'syndic.log') }}
  963. ##### Peer Publish settings #####
  964. ##########################################
  965. # Salt minions can send commands to other minions, but only if the minion is
  966. # allowed to. By default "Peer Publication" is disabled, and when enabled it
  967. # is enabled for specific minions and specific commands. This allows secure
  968. # compartmentalization of commands based on individual minions.
  969. # The configuration uses regular expressions to match minions and then a list
  970. # of regular expressions to match functions. The following will allow the
  971. # minion authenticated as foo.example.com to execute functions from the test
  972. # and pkg modules.
  973. #peer:
  974. # foo.example.com:
  975. # - test.*
  976. # - pkg.*
  977. #
  978. # This will allow all minions to execute all commands:
  979. #peer:
  980. # .*:
  981. # - .*
  982. #
  983. # This is not recommended, since it would allow anyone who gets root on any
  984. # single minion to instantly have root on all of the minions!
  985. {% if 'peer' in cfg_master %}
  986. {%- do default_keys.append('peer') %}
  987. peer:
  988. {% for name, roots in cfg_master['peer'].items() %}
  989. {{ name }}:
  990. {% for mod in roots %}
  991. - {{ mod }}
  992. {% endfor %}
  993. {% endfor %}
  994. {% elif 'peer' in cfg_salt %}
  995. peer:
  996. {% for name, roots in cfg_salt['peer'].items() %}
  997. {{ name }}:
  998. {% for mod in roots %}
  999. - {{ mod }}
  1000. {% endfor %}
  1001. {% endfor %}
  1002. {% endif %}
  1003. # Minions can also be allowed to execute runners from the salt master.
  1004. # Since executing a runner from the minion could be considered a security risk,
  1005. # it needs to be enabled. This setting functions just like the peer setting
  1006. # except that it opens up runners instead of module functions.
  1007. #
  1008. # All peer runner support is turned off by default and must be enabled before
  1009. # using. This will enable all peer runners for all minions:
  1010. #peer_run:
  1011. # .*:
  1012. # - .*
  1013. #
  1014. # To enable just the manage.up runner for the minion foo.example.com:
  1015. #peer_run:
  1016. # foo.example.com:
  1017. # - manage.up
  1018. {% if 'peer_run' in cfg_master %}
  1019. {%- do default_keys.append('peer_run') %}
  1020. peer_run:
  1021. {% for name, roots in cfg_master['peer_run'].items() %}
  1022. {{ name }}:
  1023. {% for mod in roots %}
  1024. - {{ mod }}
  1025. {% endfor %}
  1026. {% endfor %}
  1027. {% elif 'peer_run' in cfg_salt %}
  1028. peer_run:
  1029. {% for name, roots in cfg_salt['peer_run'].items() %}
  1030. {{ name }}:
  1031. {% for mod in roots %}
  1032. - {{ mod }}
  1033. {% endfor %}
  1034. {% endfor %}
  1035. {% endif %}
  1036. ##### Mine settings #####
  1037. #####################################
  1038. # Restrict mine.get access from minions. By default any minion has a full access
  1039. # to get all mine data from master cache. In acl definion below, only pcre matches
  1040. # are allowed.
  1041. # mine_get:
  1042. # .*:
  1043. # - .*
  1044. #
  1045. # The example below enables minion foo.example.com to get 'network.interfaces' mine
  1046. # data only, minions web* to get all network.* and disk.* mine data and all other
  1047. # minions won't get any mine data.
  1048. {% if 'mine_get' in cfg_master -%}
  1049. {%- do default_keys.append('mine_get') %}
  1050. mine_get:
  1051. {%- for minion, data in cfg_master['mine_get']|dictsort %}
  1052. {{ minion }}:
  1053. {%- for command in data %}
  1054. - {% raw %}'{% endraw %}{{ command }}{% raw %}'{% endraw %}
  1055. {%- endfor -%}
  1056. {%- endfor -%}
  1057. {% elif 'mine_get' in cfg_salt -%}
  1058. mine_get:
  1059. {%- for minion, data in cfg_salt['mine_get']|dictsort %}
  1060. {{ minion }}:
  1061. {%- for command in data %}
  1062. - {% raw %}'{% endraw %}{{ command }}{% raw %}'{% endraw %}
  1063. {%- endfor -%}
  1064. {%- endfor -%}
  1065. {% else -%}
  1066. # mine_get:
  1067. # foo.example.com:
  1068. # - network.interfaces
  1069. # web.*:
  1070. # - network.*
  1071. # - disk.*
  1072. {%- endif %}
  1073. ##### Logging settings #####
  1074. ##########################################
  1075. # The location of the master log file
  1076. # The master log can be sent to a regular file, local path name, or network
  1077. # location. Remote logging works best when configured to use rsyslogd(8) (e.g.:
  1078. # ``file:///dev/log``), with rsyslogd(8) configured for network logging. The URI
  1079. # format is: <file|udp|tcp>://<host|socketpath>:<port-if-required>/<log-facility>
  1080. #log_file: /var/log/salt/master
  1081. #log_file: file:///dev/log
  1082. #log_file: udp://loghost:10514
  1083. {{ get_config('log_file', '/var/log/salt/master') }}
  1084. {{ get_config('key_logfile', '/var/log/salt/key') }}
  1085. # The level of messages to send to the console.
  1086. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  1087. #
  1088. # The following log levels are considered INSECURE and may log sensitive data:
  1089. # ['garbage', 'trace', 'debug']
  1090. #
  1091. {{ get_config('log_level', 'warning') }}
  1092. # The level of messages to send to the log file.
  1093. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  1094. # If using 'log_granular_levels' this must be set to the highest desired level.
  1095. {{ get_config('log_level_logfile', 'warning') }}
  1096. # The date and time format used in log messages. Allowed date/time formating
  1097. # can be seen here: http://docs.python.org/library/time.html#time.strftime
  1098. {{ get_config('log_datefmt', "'%H:%M:%S'") }}
  1099. {{ get_config('log_datefmt_logfile', "'%Y-%m-%d %H:%M:%S'") }}
  1100. # The format of the console logging messages. Allowed formatting options can
  1101. # be seen here: http://docs.python.org/library/logging.html#logrecord-attributes
  1102. #
  1103. # Console log colors are specified by these additional formatters:
  1104. #
  1105. # %(colorlevel)s
  1106. # %(colorname)s
  1107. # %(colorprocess)s
  1108. # %(colormsg)s
  1109. #
  1110. # Since it is desirable to include the surrounding brackets, '[' and ']', in
  1111. # the coloring of the messages, these color formatters also include padding as
  1112. # well. Color LogRecord attributes are only available for console logging.
  1113. #
  1114. {{ get_config('log_fmt_console', "'%(colorlevel)s %(colormsg)s'") }}
  1115. {{ get_config('log_fmt_console', "'[%(levelname)-8s] %(message)s'") }}
  1116. {{ get_config('log_fmt_logfile', "'%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'") }}
  1117. # This can be used to control logging levels more specificically. This
  1118. # example sets the main salt library at the 'warning' level, but sets
  1119. # 'salt.modules' to log at the 'debug' level:
  1120. # log_granular_levels:
  1121. # 'salt': 'warning'
  1122. # 'salt.modules': 'debug'
  1123. #
  1124. {% if 'log_granular_levels' in cfg_master %}
  1125. {%- do default_keys.append('log_granular_levels') %}
  1126. log_granular_levels:
  1127. {% for name, lvl in cfg_master['log_granular_levels'].items() %}
  1128. {{ name }}: {{ lvl }}
  1129. {% endfor %}
  1130. {% elif 'log_granular_levels' in cfg_salt %}
  1131. log_granular_levels:
  1132. {% for name, lvl in cfg_salt['log_granular_levels'].items() %}
  1133. {{ name }}: {{ lvl }}
  1134. {% endfor %}
  1135. {% else %}
  1136. #log_granular_levels: {}
  1137. {% endif %}
  1138. ##### Node Groups ######
  1139. ##########################################
  1140. # Node groups allow for logical groupings of minion nodes. A group consists of a group
  1141. # name and a compound target.
  1142. #nodegroups:
  1143. # group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com and bl*.domain.com'
  1144. # group2: 'G@os:Debian and foo.domain.com'
  1145. {%- if 'nodegroups' in cfg_master %}
  1146. {%- do default_keys.append('nodegroups') %}
  1147. nodegroups:
  1148. {%- for name, lvl in cfg_master['nodegroups'].items() %}
  1149. {{ name }}: {{ lvl }}
  1150. {%- endfor %}
  1151. {%- elif 'nodegroups' in cfg_salt %}
  1152. nodegroups:
  1153. {%- for name, lvl in cfg_salt['nodegroups'].items() %}
  1154. {{ name }}: {{ lvl }}
  1155. {%- endfor %}
  1156. {%- endif %}
  1157. ##### Range Cluster settings #####
  1158. ##########################################
  1159. # The range server (and optional port) that serves your cluster information
  1160. # https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec
  1161. #
  1162. {{ get_config('range_server', 'range:80') }}
  1163. ##### Windows Software Repo settings #####
  1164. ###########################################
  1165. # Specify the provider to be used for git_pillar. Must be either pygit2 or
  1166. # gitpython. If unset, then both will be tried in that same order, and the
  1167. # first one with a compatible version installed will be the provider that
  1168. # is used.
  1169. {{ get_config('winrepo_provider', 'pygit2') }}
  1170. # Repo settings for 2015.8+ master used with 2015.8+ Windows minions
  1171. #
  1172. # Location of the repo on the master:
  1173. {{ get_config('winrepo_dir_ng', '/srv/salt/win/repo-ng') }}
  1174. # List of git repositories to include with the local repo:
  1175. {% if 'winrepo_remotes_ng' in cfg_master %}
  1176. {%- do default_keys.append('winrepo_remotes_ng') %}
  1177. winrepo_remotes_ng:
  1178. {% for repo in cfg_master['winrepo_remotes_ng'] %}
  1179. - {{ repo }}
  1180. {% endfor %}
  1181. {% elif 'winrepo_remotes_ng' in cfg_salt %}
  1182. winrepo_remotes_ng:
  1183. {% for repo in cfg_salt['winrepo_remotes_ng'] %}
  1184. - {{ repo }}
  1185. {% endfor %}
  1186. {% else %}
  1187. #winrepo_remotes_ng:
  1188. # - 'https://github.com/saltstack/salt-winrepo-ng.git'
  1189. {% endif %}
  1190. # Repo settings for 2015.8+ master used with pre-2015.8 Windows minions
  1191. #
  1192. # Location of the repo on the master:
  1193. {{ get_config('winrepo_dir', '/srv/salt/win/repo') }}
  1194. # Location of the master's repo cache file:
  1195. {{ get_config('winrepo_cachefile', 'winrepo.p') }}
  1196. # List of git repositories to include with the local repo:
  1197. {% if 'winrepo_remotes' in cfg_master %}
  1198. {%- do default_keys.append('winrepo_remotes') %}
  1199. winrepo_remotes:
  1200. {% for repo in cfg_master['winrepo_remotes'] %}
  1201. - {{ repo }}
  1202. {% endfor %}
  1203. {% elif 'winrepo_remotes' in cfg_salt %}
  1204. winrepo_remotes:
  1205. {% for repo in cfg_salt['winrepo_remotes'] %}
  1206. - {{ repo }}
  1207. {% endfor %}
  1208. {% else %}
  1209. #winrepo_remotes:
  1210. # - 'https://github.com/saltstack/salt-winrepo.git'
  1211. {% endif %}
  1212. ##### Windows Software Repo settings - Pre 2015.8 #####
  1213. ########################################################
  1214. # Legacy repo settings for pre-2015.8 Windows minions.
  1215. #
  1216. # Location of the repo on the master:
  1217. {{ get_config('win_repo', '/srv/salt/win/repo') }}
  1218. # Location of the master's repo cache file:
  1219. {{ get_config('win_repo_mastercachefile', '/srv/salt/win/repo/winrepo.p') }}
  1220. # List of git repositories to include with the local repo:
  1221. {% if 'win_gitrepos' in cfg_master %}
  1222. {%- do default_keys.append('win_gitrepos') %}
  1223. win_gitrepos:
  1224. {% for repo in cfg_master['win_gitrepos'] %}
  1225. - {{ repo }}
  1226. {% endfor %}
  1227. {% elif 'win_gitrepos' in cfg_salt %}
  1228. win_gitrepos:
  1229. {% for repo in cfg_salt['win_gitrepos'] %}
  1230. - {{ repo }}
  1231. {% endfor %}
  1232. {% else %}
  1233. #winrepo_remotes:
  1234. # - 'https://github.com/saltstack/salt-winrepo.git'
  1235. {% endif %}
  1236. ##### Returner settings ######
  1237. ############################################
  1238. # Which returner(s) will be used for minion's result:
  1239. #return: mysql
  1240. {{ get_config('return', '')}}
  1241. ###### Miscellaneous settings ######
  1242. ############################################
  1243. # Default match type for filtering events tags: startswith, endswith, find, regex, fnmatch
  1244. {{ get_config('event_match_type', 'startswith') }}
  1245. {%- if 'halite' in cfg_master %}
  1246. {%- do default_keys.append('halite') %}
  1247. ##### Halite #####
  1248. ##########################################
  1249. halite:
  1250. {%- for name, value in cfg_master['halite'].items() %}
  1251. {{ name }}: {{ value }}
  1252. {%- endfor %}
  1253. {%- endif %}
  1254. {%- if 'rest_cherrypy' in cfg_master %}
  1255. {%- do default_keys.append('rest_cherrypy') %}
  1256. ##### rest_cherrypy #####
  1257. ##########################################
  1258. rest_cherrypy:
  1259. {%- for name, value in cfg_master['rest_cherrypy'].items() %}
  1260. {{ name }}: {{ value }}
  1261. {%- endfor %}
  1262. {%- endif %}
  1263. {%- if 'rest_tornado' in cfg_master %}
  1264. {%- do default_keys.append('rest_tornado') %}
  1265. ##### rest_tornado #####
  1266. ###########################################
  1267. rest_tornado:
  1268. {%- for name, value in cfg_master['rest_tornado'].items() %}
  1269. {{ name }}: {{ value }}
  1270. {%- endfor %}
  1271. {%- endif %}
  1272. {%- if 'presence_events' in cfg_master %}
  1273. ##### presence events #####
  1274. ##########################################
  1275. {{ get_config('presence_events', 'False') }}
  1276. {%- endif %}
  1277. {%- if 'consul_config' in cfg_master %}
  1278. {%- do default_keys.append('consul_config') %}
  1279. ##### consul_config #####
  1280. ##########################################
  1281. consul_config:
  1282. {%- for name, value in cfg_master['consul_config'].items() %}
  1283. {{ name }}: {{ value }}
  1284. {%- endfor %}
  1285. {%- endif %}
  1286. {% if 'mongo' in cfg_master -%}
  1287. {%- do default_keys.append('mongo') %}
  1288. ##### mongodb connection settings #####
  1289. ##########################################
  1290. {%- for name, value in cfg_master['mongo'].items() %}
  1291. mongo.{{ name }}: {{ value }}
  1292. {%- endfor %}
  1293. {% if 'alternative.mongo' in cfg_master -%}
  1294. {%- do default_keys.append('alternative.mongo') %}
  1295. {%- for name, value in cfg_master['alternative.mongo'].items() %}
  1296. alternative.mongo.{{ name }}: {{ value }}
  1297. {%- endfor %}
  1298. {% endif %}
  1299. {%- endif %}
  1300. {%- for configname in cfg_master %}
  1301. {%- if configname not in reserved_keys and configname not in default_keys %}
  1302. {{ configname }}: {{ cfg_master[configname]|json }}
  1303. {%- endif %}
  1304. {%- endfor %}