0.9.8.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. ========================
  2. Salt 0.9.8 Release Notes
  3. ========================
  4. :release: 2012-03-21
  5. Salt 0.9.8 is a big step forward, with many additions and enhancements, as
  6. well as a number of precursors to advanced future developments.
  7. This version of Salt adds much more power to the command line, making the
  8. old hard timeout issues a thing of the past and adds keyword argument
  9. support. These additions are also available in the salt client API, making
  10. the available API tools much more powerful.
  11. The new pillar system allows for data to be stored on the master and
  12. assigned to minions in a granular way similar to the state system. It also
  13. allows flexibility for users who want to keep data out of their state tree
  14. similar to 'external lookup' functionality in other tools.
  15. A new way to extend requisites was added, the "requisite in" statement.
  16. This makes adding requires or watch statements to external state decs
  17. much easier.
  18. Additions to requisites making them much more powerful have been added as well
  19. as improved error checking for sls files in the state system. A new provider
  20. system has been added to allow for redirecting what modules run in the
  21. background for individual states.
  22. Support for openSUSE has been added and support for Solaris has begun
  23. serious development. Windows support has been significantly enhanced as well.
  24. The matcher and target systems have received a great deal of attention. The
  25. default behavior of grain matching has changed slightly to reflect the rest
  26. of salt and the compound matcher system has been refined.
  27. A number of impressive features with keyword arguments have been added to both
  28. the CLI and to the state system. This makes states much more powerful and
  29. flexible while maintaining the simple configuration everyone loves.
  30. The new batch size capability allows for executions to be rolled through a
  31. group of targeted minions a percentage or specific number at a time. This
  32. was added to prevent the "thundering herd" problem when targeting large
  33. numbers of minions for things like service restarts or file downloads.
  34. Upgrade Considerations
  35. ======================
  36. Upgrade Issues
  37. --------------
  38. There was a previously missed oversight which could cause a newer minion to
  39. crash an older master. That oversight has been resolved so the version
  40. incompatibility issue will no longer occur. When upgrading to 0.9.8 make
  41. sure to upgrade the master first, followed by the minions.
  42. Debian/Ubuntu Packages
  43. ----------------------
  44. The original Debian/Ubuntu packages were called salt and included all salt
  45. applications. New packages in the ppa are split by function. If an old salt
  46. package is installed then it should be manually removed and the new split
  47. packages need to be freshly installed.
  48. On the master:
  49. .. code-block:: sh
  50. # apt-get purge salt
  51. # apt-get install salt-{master,minion}
  52. On the minions:
  53. .. code-block:: sh
  54. # apt-get purge salt
  55. # apt-get install salt-minion
  56. And on any Syndics:
  57. .. code-block:: sh
  58. # apt-get install salt-syndic
  59. The official Salt PPA for Ubuntu is located at:
  60. https://launchpad.net/~saltstack/+archive/ubuntu/salt
  61. Major Features
  62. ==============
  63. Pillar
  64. ------
  65. :ref:`Pillar <pillar>` offers an interface to declare variable data on the master that is then
  66. assigned to the minions. The pillar data is made available to all modules,
  67. states, sls files etc. It is compiled on the master and is declared using the
  68. existing renderer system. This means that learning pillar should be fairly
  69. trivial to those already familiar with salt states.
  70. CLI Additions
  71. -------------
  72. The ``salt`` command has received a serious overhaul and is more powerful
  73. than ever. Data is returned to the terminal as it is received, and the salt
  74. command will now wait for all running minions to return data before stopping.
  75. This makes adding very large *--timeout* arguments completely unnecessary and
  76. gets rid of long running operations returning empty ``{}`` when the timeout is
  77. exceeded.
  78. When calling salt via sudo, the user originally running salt is saved to the
  79. log for auditing purposes. This makes it easy to see who ran what by just
  80. looking through the minion logs.
  81. The *salt-key* command gained the *-D* and *--delete-all* arguments for
  82. removing all keys. Be careful with this one!
  83. Running States Without a Master
  84. -------------------------------
  85. The addition of running states without a salt-master has been added
  86. to 0.9.8. This feature allows for the unmodified salt state tree to be
  87. read locally from a minion. The result is that the UNMODIFIED state tree
  88. has just become portable, allowing minions to have a local copy of states
  89. or to manage states without a master entirely.
  90. This is accomplished via the new file client interface in Salt that allows
  91. for the ``salt://`` URI to be redirected to custom interfaces. This means that
  92. there are now two interfaces for the salt file server, calling the master
  93. or looking in a local, minion defined ``file_roots``.
  94. This new feature can be used by modifying the minion config to point to a
  95. local ``file_roots`` and setting the ``file_client`` option to ``local``.
  96. Keyword Arguments and States
  97. ----------------------------
  98. State modules now accept the ``**kwargs`` argument. This results in all data
  99. in a sls file assigned to a state being made available to the state function.
  100. This passes data in a transparent way back to the modules executing the logic.
  101. In particular, this allows adding arguments to the ``pkg.install`` module that
  102. enable more advanced and granular controls with respect to what the state is
  103. capable of.
  104. An example of this along with the new debconf module for installing ldap
  105. client packages on Debian:
  106. .. code-block:: yaml
  107. ldap-client-packages:
  108. pkg:
  109. - debconf: salt://debconf/ldap-client.ans
  110. - installed
  111. - names:
  112. - nslcd
  113. - libpam-ldapd
  114. - libnss-ldapd
  115. Keyword Arguments and the CLI
  116. -----------------------------
  117. In the past it was required that all arguments be passed in the proper order to
  118. the *salt* and *salt-call* commands. As of 0.9.8, keyword arguments can be
  119. passed in the form of ``kwarg=argument``.
  120. .. code-block:: sh
  121. # salt -G 'type:dev' git.clone \
  122. repository=https://github.com/saltstack/salt.git cwd=/tmp/salt user=jeff
  123. Matcher Refinements and Changes
  124. -------------------------------
  125. A number of fixes and changes have been applied to the Matcher system. The
  126. most noteworthy is the change in the grain matcher. The grain matcher used to
  127. use a regular expression to match the passed data to a grain, but now defaults
  128. to a shell glob like the majority of match interfaces in Salt. A new option
  129. is available that still uses the old style regex matching to grain data called
  130. ``grain-pcre``. To use regex matching in compound matches use the letter *P*.
  131. For example, this would match any ArchLinux or Fedora minions:
  132. .. code-block:: sh
  133. # salt --grain-pcre 'os:(Arch:Fed).*' test.ping
  134. And the associated compound matcher suitable for ``top.sls`` is *P*:
  135. .. code-block:: sh
  136. P@os:(Arch|Fed).*
  137. **NOTE**: Changing the grains matcher from pcre to glob is backwards
  138. incompatible.
  139. Support has been added for matching minions with Yahoo's range library. This
  140. is handled by passing range syntax with *-R* or *--range* arguments to salt.
  141. More information at:
  142. https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec
  143. Requisite "in"
  144. --------------
  145. A new means to updating requisite statements has been added to make adding
  146. watchers and requires to external states easier. Before 0.9.8 the only way
  147. to extend the states that were watched by a state outside of the sls was to
  148. use an extend statement:
  149. .. code-block:: yaml
  150. include:
  151. - http
  152. extend:
  153. apache:
  154. service:
  155. - watch:
  156. - pkg: tomcat
  157. tomcat:
  158. pkg:
  159. - installed
  160. But the new ``Requisite in`` statement allows for easier extends for
  161. requisites:
  162. .. code-block:: yaml
  163. include:
  164. - http
  165. tomcat:
  166. pkg:
  167. - installed
  168. - watch_in:
  169. - service: apache
  170. Requisite in is part of the extend system, so still remember to always include
  171. the sls that is being extended!
  172. Providers
  173. ---------
  174. Salt predetermines what modules should be mapped to what uses based on the
  175. properties of a system. These determinations are generally made for modules
  176. that provide things like package and service management. The apt module
  177. maps to pkg on Debian and the yum module maps to pkg on Fedora for instance.
  178. Sometimes in states, it may be necessary for a non-default module to be used
  179. for the desired functionality. For instance, an Arch Linux system may have
  180. been set up with systemd support. Instead of using the default service module
  181. detected for Arch Linux, the systemd module can be used:
  182. .. code-block:: yaml
  183. http:
  184. service:
  185. - running
  186. - enable: True
  187. - provider: systemd
  188. Default providers can also be defined in the minion config file:
  189. .. code-block:: yaml
  190. providers:
  191. service: systemd
  192. When default providers are passed in the minion config, then those providers
  193. will be applied to all functionality in Salt, this means that the functions
  194. called by the minion will use these modules, as well as states.
  195. Requisite Glob Matching
  196. -----------------------
  197. Requisites can now be defined with glob expansion. This means that if there are
  198. many requisites, they can be defined on a single line.
  199. To watch all files in a directory:
  200. .. code-block:: yaml
  201. http:
  202. service:
  203. - running
  204. - enable: True
  205. - watch:
  206. - file: /etc/http/conf.d/*
  207. This example will watch all defined files that match the glob
  208. ``/etc/http/conf.d/*``
  209. Batch Size
  210. ----------
  211. The new batch size option allows commands to be executed while maintaining that
  212. only so many hosts are executing the command at one time. This option can
  213. take a percentage or a finite number:
  214. .. code-block:: bash
  215. salt '*' -b 10 test.ping
  216. salt -G 'os:RedHat' --batch-size 25% apache.signal restart
  217. This will only run test.ping on 10 of the targeted minions at a time and then
  218. restart apache on 25% of the minions matching ``os:RedHat`` at a time and work
  219. through them all until the task is complete. This makes jobs like rolling web
  220. server restarts behind a load balancer or doing maintenance on BSD firewalls
  221. using carp much easier with salt.
  222. Module Updates
  223. --------------
  224. This is a list of notable, but non-exhaustive updates with new and existing
  225. modules.
  226. Windows support has seen a flurry of support this release cycle. We've gained
  227. all new :mod:`file <alt.modules.win_file>`,
  228. :mod:`network <salt.modules.win_network>`, and
  229. :mod:`shadow <salt.modules.win_shadow>` modules. Please note
  230. that these are still a work in progress.
  231. For our ruby users, new :mod:`rvm <salt.modules.rvm>` and
  232. :mod:`gem <salt.modules.gem>` modules have been added along
  233. with the :mod:`associated <salt.states.rvm>`
  234. :mod:`states <salt.states.gem>`
  235. The :mod:`virt <salt.modules.virt>` module gained basic Xen support.
  236. The :mod:`yum <salt.modules.yumpkg>` module gained
  237. Scientific Linux support.
  238. The :mod:`pkg <salt.modules.aptpkg>` module on Debian, Ubuntu,
  239. and derivatives force apt to run in a non-interactive mode. This prevents
  240. issues when package installation waits for confirmation.
  241. A :mod:`pkg <salt.modules.zypper>` module for OpenSUSE's
  242. zypper was added.
  243. The :mod:`service <salt.modules.upstart>` module on Ubuntu
  244. natively supports upstart.
  245. A new :mod:`debconf <salt.modules.debconfmod>` module was
  246. contributed by our community for more advanced control over deb package
  247. deployments on Debian based distributions.
  248. The :mod:`mysql.user <salt.states.mysql_user>` state and
  249. :mod:`mysql <salt.modules.mysql>` module gained a
  250. *password_hash* argument.
  251. The :mod:`cmd <salt.modules.cmdmod>` module and state gained
  252. a *shell* keyword argument for specifying a shell other than ``/bin/sh`` on
  253. Linux / Unix systems.
  254. New :mod:`git <salt.modules.git>` and
  255. :mod:`mercurial <salt.modules.hg>` modules have been added
  256. for fans of distributed version control.
  257. In Progress Development
  258. =======================
  259. Master Side State Compiling
  260. ---------------------------
  261. While we feel strongly that the advantages gained with minion side state
  262. compiling are very critical, it does prevent certain features that may be
  263. desired. 0.9.8 has support for initial master side state compiling, but many
  264. more components still need to be developed, it is hoped that these can be
  265. finished for 0.9.9.
  266. The goal is that states can be compiled on both the master and the minion
  267. allowing for compilation to be split between master and minion. Why will
  268. this be great? It will allow storing sensitive data on the master and sending
  269. it to some minions without all minions having access to it. This will be
  270. good for handling ssl certificates on front-end web servers for instance.
  271. Solaris Support
  272. ---------------
  273. Salt 0.9.8 sees the introduction of basic Solaris support. The daemon runs
  274. well, but grains and more of the modules need updating and testing.
  275. Windows Support
  276. ---------------
  277. Salt states on windows are now much more viable thanks to contributions from
  278. our community! States for file, service, local user, and local group management are more fully
  279. fleshed out along with network and disk modules. Windows users can also now manage
  280. registry entries using the new "reg" module.