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.

1508 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', 'lxc.network_profile', 'lxc.container_profile'] -%}
  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. {%- if 'external_auth' in cfg_master %}
  352. {%- do default_keys.append('external_auth') %}
  353. external_auth:
  354. {%- for auth, users in cfg_master['external_auth']|dictsort %}
  355. {{ auth }}:
  356. {%- for user, commands in users.iteritems() %}
  357. {{ user }}:
  358. {%- for command in commands %}
  359. - {% raw %}'{% endraw %}{{ command }}{% raw %}'{% endraw %}
  360. {%- endfor -%}
  361. {%- endfor -%}
  362. {%- endfor -%}
  363. {%- endif %}
  364. # Time (in seconds) for a newly generated token to live. Default: 12 hours
  365. {{ get_config('token_expire', '43200') }}
  366. # Allow minions to push files to the master. This is disabled by default, for
  367. # security purposes.
  368. {{ get_config('file_recv', 'False') }}
  369. # Set a hard-limit on the size of the files that can be pushed to the master.
  370. # It will be interpreted as megabytes. Default: 100
  371. {{ get_config('file_recv_max_size', '100') }}
  372. # Signature verification on messages published from the master.
  373. # This causes the master to cryptographically sign all messages published to its event
  374. # bus, and minions then verify that signature before acting on the message.
  375. #
  376. # This is False by default.
  377. #
  378. # Note that to facilitate interoperability with masters and minions that are different
  379. # versions, if sign_pub_messages is True but a message is received by a minion with
  380. # no signature, it will still be accepted, and a warning message will be logged.
  381. # Conversely, if sign_pub_messages is False, but a minion receives a signed
  382. # message it will be accepted, the signature will not be checked, and a warning message
  383. # will be logged. This behavior went away in Salt 2014.1.0 and these two situations
  384. # will cause minion to throw an exception and drop the message.
  385. {{ get_config('sign_pub_message', 'False') }}
  386. # Sign the master auth-replies with a cryptographic signature of the masters public key.
  387. # Please see the tutorial how to use these settings in the Multimaster-PKI with Failover Tutorial
  388. {{ get_config('master_sign_pubkey', 'False') }}
  389. # The customizable name of the signing-key-pair without suffix.
  390. # master_sign_key_name: <filename_without_suffix>
  391. {{ get_config('master_sign', '{}') }}
  392. # The name of the file in the masters pki-directory that holds the pre-calculated
  393. # signature of the masters public-key.
  394. # master_pubkey_signature: <filename>
  395. {{ get_config('master_pubkey_signature', '{}') }}
  396. # Instead of computing the signature for each auth-reply, use a pre-calculated signature.
  397. # The master_pubkey_signature must also be set for this.
  398. {{ get_config('master_use_pubkey_signature', 'False') }}
  399. # Rotate the salt-masters AES-key when a minion-public is deleted with salt-key.
  400. # This is a very important security-setting. Disabling it will enable deleted minions to still
  401. # listen in on the messages published by the salt-master.
  402. # Do not disable this unless it is absolutely clear what this does.
  403. {{ get_config('rotate_aes_key', 'True') }}
  404. # Unique ID attribute name for the user. For Active Directory should be set
  405. # to 'sAMAccountName'. Default value is 'memberUid'.
  406. {{ get_config('auth.ldap.accountattributename', 'memberUid') }}
  407. # Set this to True if LDAP is Active Directory. Default is False
  408. {{ get_config('auth.ldap.activedirectory', False) }}
  409. # Bind to LDAP anonymously to determine group membership
  410. # Active Directory does not allow anonymous binds without special configuration
  411. {{ get_config('auth.ldap.anonymous', False) }}
  412. # The base DN under which users can be found in LDAP
  413. {{ get_config('auth.ldap.basedn', '') }}
  414. # The user Salt authenticates to search for a users' Distinguished Name and
  415. # group membership.
  416. {{ get_config('auth.ldap.binddn', '') }}
  417. # The bind password to go along with the bind dn (binddn).
  418. {{ get_config('auth.ldap.bindpw', '') }}
  419. # The filter used to find the DN associated with a user. For most LDAPs use
  420. # the value {% raw %}'uid={{ username }}'{% endraw %}. For Active Directory use the value
  421. # {% raw %}'sAMAccountName={{username}}'{% endraw %}.
  422. {{ get_config('auth.ldap.filter', '') }}
  423. # The attribute used for user group membership. Defaults to 'memberOf'
  424. {{ get_config('auth.ldap.groupattribute', 'memberOf') }}
  425. # LDAP group class. Use 'group' for Active Directory. Defaults to 'posixGroup'
  426. {{ get_config('auth.ldap.groupclass', 'posixGroup') }}
  427. # To specify an OU that contains group data. Not used for Active Directory
  428. # Default value: 'Groups'
  429. {{ get_config('auth.ldap.groupou', 'Groups') }}
  430. # Allows the administrator to strip off a certain set of domain names
  431. # so the hostnames looked up in the directory service can match the minion IDs.
  432. {{ get_config('auth.ldap.minion_stripdomains', []) }}
  433. # Verify server's TLS certificate. Default value: False
  434. {{ get_config('auth.ldap.no_verify', False) }}
  435. # Only for Active Directory. Default value: 'person'
  436. {{ get_config('auth.ldap.persontype', 'person') }}
  437. # Port to connect via. Default value: '389'
  438. {{ get_config('auth.ldap.port', '389') }}
  439. # LDAP scope level, almost always 2. Default value: 2
  440. {{ get_config('auth.ldap.scope', 2) }}
  441. # Server to auth against. Default value: 'localhost'
  442. {{ get_config('auth.ldap.server', 'localhost') }}
  443. # Use TLS when connecting. Default value: False
  444. {{ get_config('auth.ldap.tls', False) }}
  445. # Server specified in URI format. Overrides .ldap.server, .ldap.port,
  446. # .ldap.tls. Default value: ''
  447. {{ get_config('auth.ldap.uri', '') }}
  448. ##### Salt-SSH Configuration #####
  449. ##########################################
  450. # Pass in an alternative location for the salt-ssh roster file
  451. {{ get_config('roster_file', '/etc/salt/roster') }}
  452. # Pass in minion option overrides that will be inserted into the SHIM for
  453. # salt-ssh calls. The local minion config is not used for salt-ssh. Can be
  454. # overridden on a per-minion basis in the roster (`minion_opts`)
  455. #ssh_minion_opts:
  456. # gpg_keydir: /root/gpg
  457. {{ get_config('ssh_minion_opts', '{}') }}
  458. ##### Master Module Management #####
  459. ##########################################
  460. # Manage how master side modules are loaded.
  461. # Add any additional locations to look for master runners:
  462. {{ get_config('runner_dirs', '[]') }}
  463. # Enable Cython for master side modules:
  464. {{ get_config('cython_enable', 'False') }}
  465. ##### State System settings #####
  466. ##########################################
  467. # The state system uses a "top" file to tell the minions what environment to
  468. # use and what modules to use. The state_top file is defined relative to the
  469. # root of the base environment as defined in "File Server settings" below.
  470. {{ get_config('state_top', 'top.sls') }}
  471. # The master_tops option replaces the external_nodes option by creating
  472. # a plugable system for the generation of external top data. The external_nodes
  473. # option is deprecated by the master_tops option.
  474. #
  475. # To gain the capabilities of the classic external_nodes system, use the
  476. # following configuration:
  477. # master_tops:
  478. # ext_nodes: <Shell command which returns yaml>
  479. #
  480. #master_tops: {}
  481. {% if 'master_tops' in cfg_master %}
  482. {%- do default_keys.append('master_tops') %}
  483. master_tops:
  484. {%- for master in cfg_master['master_tops'] -%}
  485. {%- if cfg_master['master_tops'][master] is string %}
  486. {{ master }}: {{ cfg_master['master_tops'][master] }}
  487. {%- else %}
  488. {{ master}}:
  489. {%- for parameter in cfg_master['master_tops'][master] %}
  490. {{ parameter }}: {{ cfg_master['master_tops'][master][parameter] }}
  491. {%- endfor -%}
  492. {%- endif -%}
  493. {%- endfor %}
  494. {% endif %}
  495. # The external_nodes option allows Salt to gather data that would normally be
  496. # placed in a top file. The external_nodes option is the executable that will
  497. # return the ENC data. Remember that Salt will look for external nodes AND top
  498. # files and combine the results if both are enabled!
  499. {{ get_config('external_nodes', 'None') }}
  500. # The renderer to use on the minions to render the state data
  501. {{ get_config('renderer', 'yaml_jinja') }}
  502. # The Jinja renderer can strip extra carriage returns and whitespace
  503. # See http://jinja.pocoo.org/docs/api/#high-level-api
  504. #
  505. # If this is set to True the first newline after a Jinja block is removed
  506. # (block, not variable tag!). Defaults to False, corresponds to the Jinja
  507. # environment init variable "trim_blocks".
  508. {{ get_config('jinja_trim_blocks', 'False') }}
  509. # If this is set to True leading spaces and tabs are stripped from the start
  510. # of a line to a block. Defaults to False, corresponds to the Jinja
  511. # environment init variable "lstrip_blocks".
  512. {{ get_config('jinja_lstrip_blocks', 'False') }}
  513. # The failhard option tells the minions to stop immediately after the first
  514. # failure detected in the state execution, defaults to False
  515. {{ get_config('failhard', 'False') }}
  516. # The state_verbose and state_output settings can be used to change the way
  517. # state system data is printed to the display. By default all data is printed.
  518. # The state_verbose setting can be set to True or False, when set to False
  519. # all data that has a result of True and no changes will be suppressed.
  520. {{ get_config('state_verbose', 'True') }}
  521. # The state_output setting changes if the output is the full multi line
  522. # output for each changed state if set to 'full', but if set to 'terse'
  523. # the output will be shortened to a single line. If set to 'mixed', the output
  524. # will be terse unless a state failed, in which case that output will be full.
  525. # If set to 'changes', the output will be full unless the state didn't change.
  526. {{ get_config('state_output', 'full') }}
  527. # Automatically aggregate all states that have support for mod_aggregate by
  528. # setting to 'True'. Or pass a list of state module names to automatically
  529. # aggregate just those types.
  530. #
  531. # state_aggregate:
  532. # - pkg
  533. #
  534. #state_aggregate: False
  535. {{ get_config('state_aggregate', '{}') }}
  536. # Send progress events as each function in a state run completes execution
  537. # by setting to 'True'. Progress events are in the format
  538. # 'salt/job/<JID>/prog/<MID>/<RUN NUM>'.
  539. {{ get_config('state_events', 'False') }}
  540. # Enable extra routines for YAML renderer used states containing UTF characters.
  541. {{ get_config('yaml_utf8', 'False') }}
  542. ##### File Server settings #####
  543. ##########################################
  544. # Salt runs a lightweight file server written in zeromq to deliver files to
  545. # minions. This file server is built into the master daemon and does not
  546. # require a dedicated port.
  547. # The file server works on environments passed to the master, each environment
  548. # can have multiple root directories, the subdirectories in the multiple file
  549. # roots cannot match, otherwise the downloaded files will not be able to be
  550. # reliably ensured. A base environment is required to house the top file.
  551. # Example:
  552. # file_roots:
  553. # base:
  554. # - /srv/salt/
  555. # dev:
  556. # - /srv/salt/dev/services
  557. # - /srv/salt/dev/states
  558. # prod:
  559. # - /srv/salt/prod/services
  560. # - /srv/salt/prod/states
  561. #
  562. {% if 'file_roots' in cfg_master -%}
  563. {%- do default_keys.append('file_roots') %}
  564. {{ file_roots(cfg_master['file_roots']) }}
  565. {%- elif 'file_roots' in cfg_salt -%}
  566. {{ file_roots(cfg_salt['file_roots']) }}
  567. {%- elif formulas|length -%}
  568. {{ file_roots({'base': ['/srv/salt']}) }}
  569. {%- else -%}
  570. #file_roots:
  571. # base:
  572. # - /srv/salt
  573. {%- endif %}
  574. # When using multiple environments, each with their own top file, the
  575. # default behaviour is an unordered merge. To prevent top files from
  576. # being merged together and instead to only use the top file from the
  577. # requested environment, set this value to 'same'.
  578. {{ get_config('top_file_merging_strategy', 'merge') }}
  579. # To specify the order in which environments are merged, set the ordering
  580. # in the env_order option. Given a conflict, the last matching value will
  581. # win.
  582. {{ get_config('env_order', '["base", "dev", "prod"]') }}
  583. # If top_file_merging_strategy is set to 'same' and an environment does not
  584. # contain a top file, the top file in the environment specified by default_top
  585. # will be used instead.
  586. {{ get_config('default_top', 'base') }}
  587. # The hash_type is the hash to use when discovering the hash of a file on
  588. # the master server. The default is md5, but sha1, sha224, sha256, sha384
  589. # and sha512 are also supported.
  590. #
  591. # Prior to changing this value, the master should be stopped and all Salt
  592. # caches should be cleared.
  593. {{ get_config('hash_type', 'md5') }}
  594. # The buffer size in the file server can be adjusted here:
  595. {{ get_config('file_buffer_size', '1048576') }}
  596. # A regular expression (or a list of expressions) that will be matched
  597. # against the file path before syncing the modules and states to the minions.
  598. # This includes files affected by the file.recurse state.
  599. # For example, if you manage your custom modules and states in subversion
  600. # and don't want all the '.svn' folders and content synced to your minions,
  601. # you could set this to '/\.svn($|/)'. By default nothing is ignored.
  602. {% if 'file_ignore_regex' in cfg_master %}
  603. {%- do default_keys.append('file_ignore_regex') %}
  604. file_ignore_regex:
  605. {% for regex in cfg_master['file_ignore_regex'] %}
  606. - {{ regex }}
  607. {% endfor %}
  608. {% elif 'file_ignore_regex' in cfg_salt %}
  609. file_ignore_regex:
  610. {% for regex in cfg_salt['file_ignore_regex'] %}
  611. - {{ regex }}
  612. {% endfor %}
  613. {% else %}
  614. #file_ignore_regex:
  615. # - '/\.svn($|/)'
  616. # - '/\.git($|/)'
  617. {% endif %}
  618. # A file glob (or list of file globs) that will be matched against the file
  619. # path before syncing the modules and states to the minions. This is similar
  620. # to file_ignore_regex above, but works on globs instead of regex. By default
  621. # nothing is ignored.
  622. {% if 'file_ignore_glob' in cfg_master %}
  623. {%- do default_keys.append('file_ignore_glob') %}
  624. file_ignore_glob:
  625. {% for glob in cfg_master['file_ignore_glob'] %}
  626. - {{ glob }}
  627. {% endfor %}
  628. {% elif 'file_ignore_glob' in cfg_salt %}
  629. file_ignore_glob:
  630. {% for glob in cfg_salt['file_ignore_glob'] %}
  631. - {{ glob }}
  632. {% endfor %}
  633. {% else %}
  634. # file_ignore_glob:
  635. # - '*.pyc'
  636. # - '*/somefolder/*.bak'
  637. # - '*.swp'
  638. {% endif %}
  639. # File Server Backend
  640. #
  641. # Salt supports a modular fileserver backend system, this system allows
  642. # the salt master to link directly to third party systems to gather and
  643. # manage the files available to minions. Multiple backends can be
  644. # configured and will be searched for the requested file in the order in which
  645. # they are defined here. The default setting only enables the standard backend
  646. # "roots" which uses the "file_roots" option.
  647. #fileserver_backend:
  648. # - roots
  649. #
  650. # To use multiple backends list them in the order they are searched:
  651. #fileserver_backend:
  652. # - git
  653. # - roots
  654. {% if 'fileserver_backend' in cfg_master -%}
  655. {%- do default_keys.append('fileserver_backend') %}
  656. fileserver_backend:
  657. {%- for backend in cfg_master['fileserver_backend'] %}
  658. - {{ backend }}
  659. {%- endfor -%}
  660. {%- endif %}
  661. # Uncomment the line below if you do not want the file_server to follow
  662. # symlinks when walking the filesystem tree. This is set to True
  663. # by default. Currently this only applies to the default roots
  664. # fileserver_backend.
  665. {{ get_config('fileserver_followsymlinks', 'False') }}
  666. # Uncomment the line below if you do not want symlinks to be
  667. # treated as the files they are pointing to. By default this is set to
  668. # False. By uncommenting the line below, any detected symlink while listing
  669. # files on the Master will not be returned to the Minion.
  670. {{ get_config('fileserver_ignoresymlinks', 'True') }}
  671. # By default, the Salt fileserver recurses fully into all defined environments
  672. # to attempt to find files. To limit this behavior so that the fileserver only
  673. # traverses directories with SLS files and special Salt directories like _modules,
  674. # enable the option below. This might be useful for installations where a file root
  675. # has a very large number of files and performance is impacted. Default is False.
  676. {{ get_config('fileserver_limit_traversal', 'False') }}
  677. # The fileserver can fire events off every time the fileserver is updated,
  678. # these are disabled by default, but can be easily turned on by setting this
  679. # flag to True
  680. {{ get_config('fileserver_events', 'False') }}
  681. # Git File Server Backend Configuration
  682. #
  683. # Optional parameter used to specify the provider to be used for gitfs. Must
  684. # be one of the following: pygit2, gitpython, or dulwich. If unset, then each
  685. # will be tried in that same order, and the first one with a compatible
  686. # version installed will be the provider that is used.
  687. {{ get_config('gitfs_provider', 'pygit2') }}
  688. # Along with gitfs_password, is used to authenticate to HTTPS remotes.
  689. {{ get_config('gitfs_user', 'git') }}
  690. # Along with gitfs_user, is used to authenticate to HTTPS remotes.
  691. # This parameter is not required if the repository does not use authentication.
  692. {{ get_config('gitfs_password', '') }}
  693. # By default, Salt will not authenticate to an HTTP (non-HTTPS) remote.
  694. # This parameter enables authentication over HTTP. Enable this at your own risk.
  695. {{ get_config('gitfs_insecure_auth', 'False') }}
  696. # Along with gitfs_privkey (and optionally gitfs_passphrase), is used to
  697. # authenticate to SSH remotes. This parameter (or its per-remote counterpart)
  698. # is required for SSH remotes.
  699. {{ get_config('gitfs_pubkey', '') }}
  700. # Along with gitfs_pubkey (and optionally gitfs_passphrase), is used to
  701. # authenticate to SSH remotes. This parameter (or its per-remote counterpart)
  702. # is required for SSH remotes.
  703. {{ get_config('gitfs_privkey', '') }}
  704. # This parameter is optional, required only when the SSH key being used to
  705. # authenticate is protected by a passphrase.
  706. {{ get_config('gitfs_passphrase', '') }}
  707. # When using the git fileserver backend at least one git remote needs to be
  708. # defined. The user running the salt master will need read access to the repo.
  709. #
  710. # The repos will be searched in order to find the file requested by a client
  711. # and the first repo to have the file will return it.
  712. # When using the git backend branches and tags are translated into salt
  713. # environments.
  714. # Note: file:// repos will be treated as a remote, so refs you want used must
  715. # exist in that repo as *local* refs.
  716. {% if 'gitfs_remotes' in cfg_master -%}
  717. {%- do default_keys.append('gitfs_remotes') %}
  718. gitfs_remotes:
  719. {%- for remote in cfg_master['gitfs_remotes'] %}
  720. {%- if remote is iterable and remote is not string %}
  721. {%- for repo, children in remote.items() %}
  722. - {{ repo }}:
  723. {%- for child in children %}
  724. {%- for key, value in child.items() %}
  725. - {{ key }}: {{ value }}
  726. {%- endfor -%}
  727. {%- endfor -%}
  728. {%- endfor -%}
  729. {%- else %}
  730. - {{ remote }}
  731. {%- endif -%}
  732. {%- endfor -%}
  733. {%- endif %}
  734. #gitfs_remotes:
  735. # - git://github.com/saltstack/salt-states.git
  736. # - file:///var/git/saltmaster
  737. #
  738. # The gitfs_ssl_verify option specifies whether to ignore ssl certificate
  739. # errors when contacting the gitfs backend. You might want to set this to
  740. # false if you're using a git backend that uses a self-signed certificate but
  741. # keep in mind that setting this flag to anything other than the default of True
  742. # is a security concern, you may want to try using the ssh transport.
  743. {{ get_config('gitfs_ssl_verify', 'True') }}
  744. # The gitfs_root option gives the ability to serve files from a subdirectory
  745. # within the repository. The path is defined relative to the root of the
  746. # repository and defaults to the repository root.
  747. {{ get_config('gitfs_root', 'somefolder/otherfolder') }}
  748. # The gitfs_env_whitelist and gitfs_env_blacklist parameters allow for greater
  749. # control over which branches/tags are exposed as fileserver environments.
  750. {% if 'gitfs_env_whitelist' in cfg_master -%}
  751. {%- do default_keys.append('gitfs_env_whitelist') %}
  752. gitfs_env_whitelist:
  753. {%- for git_env in cfg_master['gitfs_env_whitelist'] %}
  754. - {{ git_env }}
  755. {%- endfor -%}
  756. {% else -%}
  757. # gitfs_env_whitelist:
  758. # - base
  759. # - v1.*
  760. {% endif %}
  761. {% if 'gitfs_env_blacklist' in cfg_master -%}
  762. {%- do default_keys.append('gitfs_env_blacklist') %}
  763. gitfs_env_blacklist:
  764. {%- for git_env in cfg_master['gitfs_env_blacklist'] %}
  765. - {{ git_env }}
  766. {%- endfor -%}
  767. {% else -%}
  768. # gitfs_env_blacklist:
  769. # - bug/*
  770. # - feature/*
  771. {% endif %}
  772. # S3 File Server Backend Configuration
  773. #
  774. # S3 credentials must be set in the master config file.
  775. # Alternatively, if on EC2 these credentials can be automatically
  776. # loaded from instance metadata.
  777. {% if 's3.keyid' in cfg_master -%}
  778. {{ get_config('s3.keyid', '<no default>') }}
  779. {{ get_config('s3.key', '<no default>') }}
  780. {% else -%}
  781. # s3.keyid: GKTADJGHEIQSXMKKRBJ08H
  782. # s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
  783. {% endif %}
  784. # This fileserver supports two modes of operation for the buckets:
  785. # - A single bucket per environment
  786. # - Multiple environments per bucket
  787. #
  788. # Note that bucket names must be all lowercase both in the AWS console
  789. # and in Salt, otherwise you may encounter SignatureDoesNotMatch
  790. # errors.
  791. #
  792. # A multiple-environment bucket must adhere to the following root
  793. # directory structure:
  794. #
  795. # s3://<bucket name>/<environment>/<files>
  796. #
  797. # This fileserver back-end requires the use of the MD5 hashing
  798. # algorithm. MD5 may not be compliant with all security policies.
  799. {% if 's3.buckets' in cfg_master -%}
  800. {{ get_config('s3.buckets', '<no default>') }}
  801. {% else -%}
  802. # s3.buckets: #single bucket per environment
  803. # production:
  804. # - bucket1
  805. # - bucket2
  806. # staging:
  807. # - bucket3
  808. # - bucket4
  809. #
  810. # s3.buckets: #multiple environments per bucket
  811. # - bucket1
  812. # - bucket2
  813. # - bucket3
  814. # - bucket4
  815. {% endif %}
  816. ##### Pillar settings #####
  817. ##########################################
  818. # Salt Pillars allow for the building of global data that can be made selectively
  819. # available to different minions based on minion grain filtering. The Salt
  820. # Pillar is laid out in the same fashion as the file server, with environments,
  821. # a top file and sls files. However, pillar data does not need to be in the
  822. # highstate format, and is generally just key/value pairs.
  823. {% if 'pillar_roots' in cfg_master -%}
  824. {%- do default_keys.append('pillar_roots') %}
  825. pillar_roots:
  826. {%- for name, roots in cfg_master['pillar_roots']|dictsort %}
  827. {{ name }}:
  828. {%- for dir in roots %}
  829. - {{ dir }}
  830. {%- endfor -%}
  831. {%- endfor -%}
  832. {% elif 'pillar_roots' in cfg_salt -%}
  833. pillar_roots:
  834. {%- for name, roots in cfg_salt['pillar_roots']|dictsort %}
  835. {{ name }}:
  836. {%- for dir in roots %}
  837. - {{ dir }}
  838. {%- endfor -%}
  839. {%- endfor -%}
  840. {%- else -%}
  841. #pillar_roots:
  842. # base:
  843. # - /srv/pillar
  844. {%- endif %}
  845. {% if 'ext_pillar' in cfg_master %}
  846. {%- do default_keys.append('ext_pillar') %}
  847. ext_pillar:
  848. {%- for pillar in cfg_master['ext_pillar'] -%}
  849. {%- for key in pillar -%}
  850. {%- if pillar[key] is string %}
  851. - {{ key }}: {{ pillar[key] }}
  852. {#- Workaround for missing `is mapping` on CentOS 6, see #193: #}
  853. {%- elif pillar[key] is iterable and 'dict' not in pillar[key].__class__.__name__ %}
  854. - {{ key }}:
  855. {%- for parameter in pillar[key] %}
  856. - {{ parameter }}
  857. {%- endfor -%}
  858. {#- Workaround for missing `is mapping` on CentOS 6, see #193: #}
  859. {%- elif 'dict' in pillar[key].__class__.__name__ and pillar[key] is not string %}
  860. - {{ key }}:
  861. {%- for parameter in pillar[key] %}
  862. {{ parameter }}: {{pillar[key][parameter]}}
  863. {%- endfor %}
  864. {%- else %}
  865. # Error in rendering {{ key }}, please read https://docs.saltstack.com/en/latest/topics/development/external_pillars.html#configuration
  866. {% endif %}
  867. {%- endfor -%}
  868. {%- endfor %}
  869. {% elif 'ext_pillar' in cfg_salt %}
  870. ext_pillar:
  871. {% for pillar in cfg_salt['ext_pillar'] %}
  872. - {{ pillar.items()[0][0] }}: {{ pillar.items()[0][1] }}
  873. {% endfor %}
  874. {% else %}
  875. #ext_pillar:
  876. # - hiera: /etc/hiera.yaml
  877. # - cmd_yaml: cat /etc/salt/yaml
  878. {% endif %}
  879. # The ext_pillar_first option allows for external pillar sources to populate
  880. # before file system pillar. This allows for targeting file system pillar from
  881. # ext_pillar.
  882. {{ get_config('ext_pillar_first', 'False') }}
  883. # The pillar_gitfs_ssl_verify option specifies whether to ignore ssl certificate
  884. # errors when contacting the pillar gitfs backend. You might want to set this to
  885. # false if you're using a git backend that uses a self-signed certificate but
  886. # keep in mind that setting this flag to anything other than the default of True
  887. # is a security concern, you may want to try using the ssh transport.
  888. {{ get_config('pillar_gitfs_ssl_verify', 'True') }}
  889. # The pillar_opts option adds the master configuration file data to a dict in
  890. # the pillar called "master". This is used to set simple configurations in the
  891. # master config file that can then be used on minions.
  892. {{ get_config('pillar_opts', 'False') }}
  893. # The pillar_safe_render_error option prevents the master from passing pillar
  894. # render errors to the minion. This is set on by default because the error could
  895. # contain templating data which would give that minion information it shouldn't
  896. # have, like a password! When set true the error message will only show:
  897. # Rendering SLS 'my.sls' failed. Please see master log for details.
  898. {{ get_config('pillar_safe_render_error', 'True') }}
  899. # The pillar_source_merging_strategy option allows you to configure merging strategy
  900. # between different sources. It accepts four values: recurse, aggregate, overwrite,
  901. # or smart. Recurse will merge recursively mapping of data. Aggregate instructs
  902. # aggregation of elements between sources that use the #!yamlex renderer. Overwrite
  903. # will verwrite elements according the order in which they are processed. This is
  904. # behavior of the 2014.1 branch and earlier. Smart guesses the best strategy based
  905. # on the "renderer" setting and is the default value.
  906. {{ get_config('pillar_source_merging_strategy', 'smart') }}
  907. # Recursively merge lists by aggregating them instead of replacing them.
  908. {{ get_config('pillar_merge_lists', False) }}
  909. # Git External Pillar (git_pillar) Configuration Options
  910. #
  911. # Specify the provider to be used for git_pillar. Must be either pygit2 or
  912. # gitpython. If unset, then both will be tried in that same order, and the
  913. # first one with a compatible version installed will be the provider that
  914. # is used.
  915. {{ get_config('git_pillar_provider', 'pygit2') }}
  916. # If the desired branch matches this value, and the environment is omitted
  917. # from the git_pillar configuration, then the environment for that git_pillar
  918. # remote will be base.
  919. {{ get_config('git_pillar_base', 'master') }}
  920. # If the branch is omitted from a git_pillar remote, then this branch will
  921. # be used instead.
  922. {{ get_config('git_pillar_branch', 'master') }}
  923. # Environment to use for git_pillar remotes. This is normally derived from
  924. # the branch/tag (or from a per-remote env parameter), but if set this will
  925. # override the process of deriving the env from the branch/tag name.
  926. {{ get_config('git_pillar_env', '') }}
  927. # Path relative to the root of the repository where the git_pillar top file
  928. # and SLS files are located.
  929. {{ get_config('git_pillar_root', 'pillar') }}
  930. # Specifies whether or not to ignore SSL certificate errors when contacting
  931. # the remote repository.
  932. {{ get_config('git_pillar_ssl_verify', True) }}
  933. # When set to False, if there is an update/checkout lock for a git_pillar
  934. # remote and the pid written to it is not running on the master, the lock
  935. # file will be automatically cleared and a new lock will be obtained.
  936. {{ get_config('git_pillar_global_lock', False) }}
  937. # Git External Pillar Authentication Options
  938. #
  939. # Along with git_pillar_password, is used to authenticate to HTTPS remotes.
  940. {{ get_config('git_pillar_user', '') }}
  941. # Along with git_pillar_user, is used to authenticate to HTTPS remotes.
  942. # This parameter is not required if the repository does not use authentication.
  943. {{ get_config('git_pillar_password', '') }}
  944. # By default, Salt will not authenticate to an HTTP (non-HTTPS) remote.
  945. # This parameter enables authentication over HTTP.
  946. {{ get_config('git_pillar_insecure_auth', False) }}
  947. # Along with git_pillar_privkey (and optionally git_pillar_passphrase),
  948. # is used to authenticate to SSH remotes.
  949. {{ get_config('git_pillar_pubkey', '') }}
  950. # Along with git_pillar_pubkey (and optionally git_pillar_passphrase),
  951. # is used to authenticate to SSH remotes.
  952. {{ get_config('git_pillar_privkey', '') }}
  953. # This parameter is optional, required only when the SSH key being used
  954. # to authenticate is protected by a passphrase.
  955. {{ get_config('git_pillar_passphrase', '') }}
  956. ##### Syndic settings #####
  957. ##########################################
  958. # The Salt syndic is used to pass commands through a master from a higher
  959. # master. Using the syndic is simple. If this is a master that will have
  960. # syndic servers(s) below it, then set the "order_masters" setting to True.
  961. #
  962. # If this is a master that will be running a syndic daemon for passthrough, then
  963. # the "syndic_master" setting needs to be set to the location of the master server
  964. # to receive commands from.
  965. # Set the order_masters setting to True if this master will command lower
  966. # masters' syndic interfaces.
  967. {{ get_config('order_masters', 'False') }}
  968. # If this master will be running a salt syndic daemon, syndic_master tells
  969. # this master where to receive commands from.
  970. {{ get_config('syndic_master', 'masterofmaster') }}
  971. # This is the 'ret_port' of the MasterOfMaster:
  972. {{ get_config('syndic_master_port', '4506') }}
  973. # PID file of the syndic daemon:
  974. {{ get_config('syndic_pidfile', '/var/run/salt-syndic.pid') }}
  975. # LOG file of the syndic daemon:
  976. {{ get_config('syndic_log_file', 'syndic.log') }}
  977. ##### Peer Publish settings #####
  978. ##########################################
  979. # Salt minions can send commands to other minions, but only if the minion is
  980. # allowed to. By default "Peer Publication" is disabled, and when enabled it
  981. # is enabled for specific minions and specific commands. This allows secure
  982. # compartmentalization of commands based on individual minions.
  983. # The configuration uses regular expressions to match minions and then a list
  984. # of regular expressions to match functions. The following will allow the
  985. # minion authenticated as foo.example.com to execute functions from the test
  986. # and pkg modules.
  987. #peer:
  988. # foo.example.com:
  989. # - test.*
  990. # - pkg.*
  991. #
  992. # This will allow all minions to execute all commands:
  993. #peer:
  994. # .*:
  995. # - .*
  996. #
  997. # This is not recommended, since it would allow anyone who gets root on any
  998. # single minion to instantly have root on all of the minions!
  999. {% if 'peer' in cfg_master %}
  1000. {%- do default_keys.append('peer') %}
  1001. peer:
  1002. {% for name, roots in cfg_master['peer'].items() %}
  1003. {{ name }}:
  1004. {% for mod in roots %}
  1005. - {{ mod }}
  1006. {% endfor %}
  1007. {% endfor %}
  1008. {% elif 'peer' in cfg_salt %}
  1009. peer:
  1010. {% for name, roots in cfg_salt['peer'].items() %}
  1011. {{ name }}:
  1012. {% for mod in roots %}
  1013. - {{ mod }}
  1014. {% endfor %}
  1015. {% endfor %}
  1016. {% endif %}
  1017. # Minions can also be allowed to execute runners from the salt master.
  1018. # Since executing a runner from the minion could be considered a security risk,
  1019. # it needs to be enabled. This setting functions just like the peer setting
  1020. # except that it opens up runners instead of module functions.
  1021. #
  1022. # All peer runner support is turned off by default and must be enabled before
  1023. # using. This will enable all peer runners for all minions:
  1024. #peer_run:
  1025. # .*:
  1026. # - .*
  1027. #
  1028. # To enable just the manage.up runner for the minion foo.example.com:
  1029. #peer_run:
  1030. # foo.example.com:
  1031. # - manage.up
  1032. {% if 'peer_run' in cfg_master %}
  1033. {%- do default_keys.append('peer_run') %}
  1034. peer_run:
  1035. {% for name, roots in cfg_master['peer_run'].items() %}
  1036. {{ name }}:
  1037. {% for mod in roots %}
  1038. - {{ mod }}
  1039. {% endfor %}
  1040. {% endfor %}
  1041. {% elif 'peer_run' in cfg_salt %}
  1042. peer_run:
  1043. {% for name, roots in cfg_salt['peer_run'].items() %}
  1044. {{ name }}:
  1045. {% for mod in roots %}
  1046. - {{ mod }}
  1047. {% endfor %}
  1048. {% endfor %}
  1049. {% endif %}
  1050. ##### Mine settings #####
  1051. #####################################
  1052. # Restrict mine.get access from minions. By default any minion has a full access
  1053. # to get all mine data from master cache. In acl definion below, only pcre matches
  1054. # are allowed.
  1055. # mine_get:
  1056. # .*:
  1057. # - .*
  1058. #
  1059. # The example below enables minion foo.example.com to get 'network.interfaces' mine
  1060. # data only, minions web* to get all network.* and disk.* mine data and all other
  1061. # minions won't get any mine data.
  1062. {% if 'mine_get' in cfg_master -%}
  1063. {%- do default_keys.append('mine_get') %}
  1064. mine_get:
  1065. {%- for minion, data in cfg_master['mine_get']|dictsort %}
  1066. {{ minion }}:
  1067. {%- for command in data %}
  1068. - {% raw %}'{% endraw %}{{ command }}{% raw %}'{% endraw %}
  1069. {%- endfor -%}
  1070. {%- endfor -%}
  1071. {% elif 'mine_get' in cfg_salt -%}
  1072. mine_get:
  1073. {%- for minion, data in cfg_salt['mine_get']|dictsort %}
  1074. {{ minion }}:
  1075. {%- for command in data %}
  1076. - {% raw %}'{% endraw %}{{ command }}{% raw %}'{% endraw %}
  1077. {%- endfor -%}
  1078. {%- endfor -%}
  1079. {% else -%}
  1080. # mine_get:
  1081. # foo.example.com:
  1082. # - network.interfaces
  1083. # web.*:
  1084. # - network.*
  1085. # - disk.*
  1086. {%- endif %}
  1087. ##### Logging settings #####
  1088. ##########################################
  1089. # The location of the master log file
  1090. # The master log can be sent to a regular file, local path name, or network
  1091. # location. Remote logging works best when configured to use rsyslogd(8) (e.g.:
  1092. # ``file:///dev/log``), with rsyslogd(8) configured for network logging. The URI
  1093. # format is: <file|udp|tcp>://<host|socketpath>:<port-if-required>/<log-facility>
  1094. #log_file: /var/log/salt/master
  1095. #log_file: file:///dev/log
  1096. #log_file: udp://loghost:10514
  1097. {{ get_config('log_file', '/var/log/salt/master') }}
  1098. {{ get_config('key_logfile', '/var/log/salt/key') }}
  1099. # The level of messages to send to the console.
  1100. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  1101. #
  1102. # The following log levels are considered INSECURE and may log sensitive data:
  1103. # ['garbage', 'trace', 'debug']
  1104. #
  1105. {{ get_config('log_level', 'warning') }}
  1106. # The level of messages to send to the log file.
  1107. # One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'.
  1108. # If using 'log_granular_levels' this must be set to the highest desired level.
  1109. {{ get_config('log_level_logfile', 'warning') }}
  1110. # The date and time format used in log messages. Allowed date/time formating
  1111. # can be seen here: http://docs.python.org/library/time.html#time.strftime
  1112. {{ get_config('log_datefmt', "'%H:%M:%S'") }}
  1113. {{ get_config('log_datefmt_logfile', "'%Y-%m-%d %H:%M:%S'") }}
  1114. # The format of the console logging messages. Allowed formatting options can
  1115. # be seen here: http://docs.python.org/library/logging.html#logrecord-attributes
  1116. #
  1117. # Console log colors are specified by these additional formatters:
  1118. #
  1119. # %(colorlevel)s
  1120. # %(colorname)s
  1121. # %(colorprocess)s
  1122. # %(colormsg)s
  1123. #
  1124. # Since it is desirable to include the surrounding brackets, '[' and ']', in
  1125. # the coloring of the messages, these color formatters also include padding as
  1126. # well. Color LogRecord attributes are only available for console logging.
  1127. #
  1128. {{ get_config('log_fmt_console', "'%(colorlevel)s %(colormsg)s'") }}
  1129. {{ get_config('log_fmt_console', "'[%(levelname)-8s] %(message)s'") }}
  1130. {{ get_config('log_fmt_logfile', "'%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'") }}
  1131. # This can be used to control logging levels more specificically. This
  1132. # example sets the main salt library at the 'warning' level, but sets
  1133. # 'salt.modules' to log at the 'debug' level:
  1134. # log_granular_levels:
  1135. # 'salt': 'warning'
  1136. # 'salt.modules': 'debug'
  1137. #
  1138. {% if 'log_granular_levels' in cfg_master %}
  1139. {%- do default_keys.append('log_granular_levels') %}
  1140. log_granular_levels:
  1141. {% for name, lvl in cfg_master['log_granular_levels'].items() %}
  1142. {{ name }}: {{ lvl }}
  1143. {% endfor %}
  1144. {% elif 'log_granular_levels' in cfg_salt %}
  1145. log_granular_levels:
  1146. {% for name, lvl in cfg_salt['log_granular_levels'].items() %}
  1147. {{ name }}: {{ lvl }}
  1148. {% endfor %}
  1149. {% else %}
  1150. #log_granular_levels: {}
  1151. {% endif %}
  1152. ##### Node Groups ######
  1153. ##########################################
  1154. # Node groups allow for logical groupings of minion nodes. A group consists of a group
  1155. # name and a compound target.
  1156. #nodegroups:
  1157. # group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com and bl*.domain.com'
  1158. # group2: 'G@os:Debian and foo.domain.com'
  1159. {%- if 'nodegroups' in cfg_master %}
  1160. {%- do default_keys.append('nodegroups') %}
  1161. nodegroups:
  1162. {%- for name, lvl in cfg_master['nodegroups'].items() %}
  1163. {{ name }}: {{ lvl }}
  1164. {%- endfor %}
  1165. {%- elif 'nodegroups' in cfg_salt %}
  1166. nodegroups:
  1167. {%- for name, lvl in cfg_salt['nodegroups'].items() %}
  1168. {{ name }}: {{ lvl }}
  1169. {%- endfor %}
  1170. {%- endif %}
  1171. ##### Range Cluster settings #####
  1172. ##########################################
  1173. # The range server (and optional port) that serves your cluster information
  1174. # https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec
  1175. #
  1176. {{ get_config('range_server', 'range:80') }}
  1177. ##### Windows Software Repo settings #####
  1178. ###########################################
  1179. # Specify the provider to be used for git_pillar. Must be either pygit2 or
  1180. # gitpython. If unset, then both will be tried in that same order, and the
  1181. # first one with a compatible version installed will be the provider that
  1182. # is used.
  1183. {{ get_config('winrepo_provider', 'pygit2') }}
  1184. # Repo settings for 2015.8+ master used with 2015.8+ Windows minions
  1185. #
  1186. # Location of the repo on the master:
  1187. {{ get_config('winrepo_dir_ng', '/srv/salt/win/repo-ng') }}
  1188. # List of git repositories to include with the local repo:
  1189. {% if 'winrepo_remotes_ng' in cfg_master %}
  1190. {%- do default_keys.append('winrepo_remotes_ng') %}
  1191. winrepo_remotes_ng:
  1192. {% for repo in cfg_master['winrepo_remotes_ng'] %}
  1193. - {{ repo }}
  1194. {% endfor %}
  1195. {% elif 'winrepo_remotes_ng' in cfg_salt %}
  1196. winrepo_remotes_ng:
  1197. {% for repo in cfg_salt['winrepo_remotes_ng'] %}
  1198. - {{ repo }}
  1199. {% endfor %}
  1200. {% else %}
  1201. #winrepo_remotes_ng:
  1202. # - 'https://github.com/saltstack/salt-winrepo-ng.git'
  1203. {% endif %}
  1204. # Repo settings for 2015.8+ master used with pre-2015.8 Windows minions
  1205. #
  1206. # Location of the repo on the master:
  1207. {{ get_config('winrepo_dir', '/srv/salt/win/repo') }}
  1208. # Location of the master's repo cache file:
  1209. {{ get_config('winrepo_cachefile', 'winrepo.p') }}
  1210. # List of git repositories to include with the local repo:
  1211. {% if 'winrepo_remotes' in cfg_master %}
  1212. {%- do default_keys.append('winrepo_remotes') %}
  1213. winrepo_remotes:
  1214. {% for repo in cfg_master['winrepo_remotes'] %}
  1215. - {{ repo }}
  1216. {% endfor %}
  1217. {% elif 'winrepo_remotes' in cfg_salt %}
  1218. winrepo_remotes:
  1219. {% for repo in cfg_salt['winrepo_remotes'] %}
  1220. - {{ repo }}
  1221. {% endfor %}
  1222. {% else %}
  1223. #winrepo_remotes:
  1224. # - 'https://github.com/saltstack/salt-winrepo.git'
  1225. {% endif %}
  1226. ##### Windows Software Repo settings - Pre 2015.8 #####
  1227. ########################################################
  1228. # Legacy repo settings for pre-2015.8 Windows minions.
  1229. #
  1230. # Location of the repo on the master:
  1231. {{ get_config('win_repo', '/srv/salt/win/repo') }}
  1232. # Location of the master's repo cache file:
  1233. {{ get_config('win_repo_mastercachefile', '/srv/salt/win/repo/winrepo.p') }}
  1234. # List of git repositories to include with the local repo:
  1235. {% if 'win_gitrepos' in cfg_master %}
  1236. {%- do default_keys.append('win_gitrepos') %}
  1237. win_gitrepos:
  1238. {% for repo in cfg_master['win_gitrepos'] %}
  1239. - {{ repo }}
  1240. {% endfor %}
  1241. {% elif 'win_gitrepos' in cfg_salt %}
  1242. win_gitrepos:
  1243. {% for repo in cfg_salt['win_gitrepos'] %}
  1244. - {{ repo }}
  1245. {% endfor %}
  1246. {% else %}
  1247. #winrepo_remotes:
  1248. # - 'https://github.com/saltstack/salt-winrepo.git'
  1249. {% endif %}
  1250. ##### Returner settings ######
  1251. ############################################
  1252. # Which returner(s) will be used for minion's result:
  1253. #return: mysql
  1254. {{ get_config('return', '')}}
  1255. ###### Miscellaneous settings ######
  1256. ############################################
  1257. # Default match type for filtering events tags: startswith, endswith, find, regex, fnmatch
  1258. {{ get_config('event_match_type', 'startswith') }}
  1259. {%- if 'halite' in cfg_master %}
  1260. {%- do default_keys.append('halite') %}
  1261. ##### Halite #####
  1262. ##########################################
  1263. halite:
  1264. {%- for name, value in cfg_master['halite'].items() %}
  1265. {{ name }}: {{ value }}
  1266. {%- endfor %}
  1267. {%- endif %}
  1268. {%- if 'rest_cherrypy' in cfg_master %}
  1269. {%- do default_keys.append('rest_cherrypy') %}
  1270. ##### rest_cherrypy #####
  1271. ##########################################
  1272. rest_cherrypy:
  1273. {%- for name, value in cfg_master['rest_cherrypy'].items() %}
  1274. {{ name }}: {{ value }}
  1275. {%- endfor %}
  1276. {%- endif %}
  1277. {%- if 'rest_tornado' in cfg_master %}
  1278. {%- do default_keys.append('rest_tornado') %}
  1279. ##### rest_tornado #####
  1280. ###########################################
  1281. rest_tornado:
  1282. {%- for name, value in cfg_master['rest_tornado'].items() %}
  1283. {{ name }}: {{ value }}
  1284. {%- endfor %}
  1285. {%- endif %}
  1286. {%- if 'presence_events' in cfg_master %}
  1287. ##### presence events #####
  1288. ##########################################
  1289. {{ get_config('presence_events', 'False') }}
  1290. {%- endif %}
  1291. {%- if 'consul_config' in cfg_master %}
  1292. {%- do default_keys.append('consul_config') %}
  1293. ##### consul_config #####
  1294. ##########################################
  1295. consul_config:
  1296. {%- for name, value in cfg_master['consul_config'].items() %}
  1297. {{ name }}: {{ value }}
  1298. {%- endfor %}
  1299. {%- endif %}
  1300. {% if 'mongo' in cfg_master -%}
  1301. {%- do default_keys.append('mongo') %}
  1302. ##### mongodb connection settings #####
  1303. ##########################################
  1304. {%- for name, value in cfg_master['mongo'].items() %}
  1305. mongo.{{ name }}: {{ value }}
  1306. {%- endfor %}
  1307. {% if 'alternative.mongo' in cfg_master -%}
  1308. {%- do default_keys.append('alternative.mongo') %}
  1309. {%- for name, value in cfg_master['alternative.mongo'].items() %}
  1310. alternative.mongo.{{ name }}: {{ value }}
  1311. {%- endfor %}
  1312. {% endif %}
  1313. {%- endif %}
  1314. {%- for configname in cfg_master %}
  1315. {%- if configname not in reserved_keys and configname not in default_keys %}
  1316. {{ configname }}: {{ cfg_master[configname]|json }}
  1317. {%- endif %}
  1318. {%- endfor %}