Saltstack Official Salt Formula
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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