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

f_defaults.conf 67KB

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