Saltstack Official Salt Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

f_defaults.conf 52KB

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