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 66KB

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