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.

README.rst 7.2KB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. .. _readme:
  2. salt-formula
  3. ============
  4. |img_travis| |img_sr|
  5. .. |img_travis| image:: https://travis-ci.com/saltstack-formulas/salt-formula.svg?branch=master
  6. :alt: Travis CI Build Status
  7. :scale: 100%
  8. :target: https://travis-ci.com/saltstack-formulas/salt-formula
  9. .. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
  10. :alt: Semantic Release
  11. :scale: 100%
  12. :target: https://github.com/semantic-release/semantic-release
  13. Yes, Salt can Salt itself!
  14. .. contents:: **Table of Contents**
  15. General notes
  16. -------------
  17. See the full `SaltStack Formulas installation and usage instructions
  18. <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
  19. If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section
  20. <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas>`_.
  21. If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,
  22. which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/>`_.
  23. See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning>`_ for more details.
  24. Contributing to this repo
  25. -------------------------
  26. **Commit message formatting is significant!!**
  27. Please see :ref:`How to contribute <CONTRIBUTING>` for more details.
  28. Available states
  29. ----------------
  30. .. contents::
  31. :local:
  32. ``salt.minion``
  33. ^^^^^^^^^^^^^^^
  34. Install a minion
  35. ``salt.master``
  36. ^^^^^^^^^^^^^^^
  37. Install a master.
  38. ``salt.syndic``
  39. ^^^^^^^^^^^^^^^
  40. Install a syndic.
  41. ``salt.cloud``
  42. ^^^^^^^^^^^^^^
  43. Install salt cloud.
  44. ``salt.ssh``
  45. ^^^^^^^^^^^^
  46. Install salt-ssh with roster file.
  47. Configure pillar data under salt:ssh_roster to feed the template.
  48. ``salt.api``
  49. ^^^^^^^^^^^^
  50. Install salt api
  51. Requisite: Configure salt-master with rest_cherrypy or rest_tornado.
  52. ``salt.standalone``
  53. ^^^^^^^^^^^^^^^^^^^
  54. Install a minion and configure it in `standalone mode
  55. <http://docs.saltstack.com/en/latest/topics/tutorials/standalone_minion.html>`_.
  56. ``salt.gitfs.dulwich``
  57. ^^^^^^^^^^^^^^^^^^^^^^
  58. Install gitfs backend dulwich dependencies. Set ``salt:master:gitfs_provider: dulwich`` in your pillar.
  59. ``salt.gitfs.gitpython``
  60. ^^^^^^^^^^^^^^^^^^^^^^^^
  61. Install gitfs backend GitPython dependenciess. Set ``salt:master:gitfs_provider: gitpython`` in your pillar.
  62. ``salt.gitfs.keys``
  63. ^^^^^^^^^^^^^^^^^^^
  64. Install ssh keys to be used by gitfs
  65. ``salt.gitfs.pygit2``
  66. ^^^^^^^^^^^^^^^^^^^^^
  67. Install gitfs backend libgit2/pygit2 dependenciess. Set ``salt:master:gitfs_provider: pygit2`` in your pillar.
  68. For EL distributions, pygit is installed from packages from `EPEL <https://github.com/saltstack-formulas/epel-formula>`_.
  69. ``salt.pkgrepo``
  70. ^^^^^^^^^^^^^^^^
  71. Enable the official saltstack package repository in order to always
  72. benefit from the latest version. This state currently only works on Debian, Ubuntu, RHEL 6/7 and aims to implement the `installation recommendations of the official documentation <http://docs.saltstack.com/en/latest/topics/installation/index.html#platform-specific-installation-instructions>`_.
  73. ``salt.pkgrepo.absent``
  74. ^^^^^^^^^^^^^^^^^^^^^^^
  75. Undo the effects of ``salt.pkgrepo``.
  76. ``salt.formulas``
  77. ^^^^^^^^^^^^^^^^^
  78. Clone selected `Salt formulas
  79. <http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_
  80. Git repositories under ``/srv/formulas`` and makes them available in the
  81. relevant ``file_roots`` settings. Pillar data can be used to customize all
  82. paths, URLs, etc.
  83. Here's a minimal pillar sample installing two formulas in the base
  84. environment.
  85. ::
  86. salt_formulas:
  87. list:
  88. base:
  89. - salt-formula
  90. - openssh-formula
  91. See pillar.example for an exhaustive list of settings available via pillar. Note
  92. that by default this state:
  93. - downloads the latest formulas from the `saltstack-formulas project
  94. <https://github.com/saltstack-formulas>`_ on GitHub.
  95. - does not update the local repositories after the initial clone.
  96. This is a safety measure since you do not control how the official
  97. repositories evolve.
  98. If you configure the state to download the formulas from repositories that
  99. you control, then you can safely enable the
  100. ``salt_formulas:git_opts:default:update`` pillar setting to ``True``.
  101. Configuration
  102. -------------
  103. Every option available in the templates can be set in pillar. Settings under 'salt' will be overridden by more specific settings under ``salt['master']``, ``salt['minion']`` or ``salt['cloud']``. Options specified in ``salt['minion']`` which are not present in the default configuration file will be added to the end of the configuration file.
  104. ::
  105. salt:
  106. ret_port: 4506
  107. master:
  108. user: saltuser
  109. ...
  110. minion:
  111. user: saltuser
  112. ...
  113. cloud:
  114. providers: ec2
  115. ...
  116. Extending
  117. ---------
  118. Additional templates can be added by the user under salt/files/minion.d and master.d. This might be useful if, for example, a recently-added configuration option is not yet provided by the default template.
  119. Vagrant
  120. -------
  121. Executing the provided `Vagrantfile <http://www.vagrantup.com/>`_ will create a Ubuntu 14.04 VM, add the default Saltstack Repository and install the current stable version.
  122. The folders inside the VM will be set up in a way that enables you to simply execute 'sudo salt "*" state.highstate' to apply the salt formula to the VM, using the pillar.example config. You can check /etc/salt/ for results.
  123. Remember, you will have to run ``state.highstate`` or ``state.sls salt.(master|minion|cloud)`` manually.
  124. MacOS Support
  125. -------------
  126. As MacOS has no native package management that pkg.installed can leverage appropriately, and brew does not count, the salt.minion state manages salt minion package upgrades by way of .pkg file download which is then installed using the macpackage.installed state.
  127. salt-minion packages on MacOS will not be upgraded by default. To enable package management you must set the following at a minimum,
  128. ::
  129. install_packages: True
  130. version: 2017.7.4
  131. salt_minion_pkg_source: https://repo.saltstack.com/osx/salt-2017.7.4-py3-x86_64.pkg
  132. install_packages must indicate that the installation of a package is desired. If so, version will be used to compare the version of the installed .pkg against the downloaded one. If version is not set and a salt.pkg is already installed the .pkg will not be installed again.
  133. A future update to the formula may include extraction of version from the downloaded .pkg itself; but for the time being you MUST set version to indicate what you believe it to be.
  134. Refer to pillar.example for more information.
  135. Testing
  136. -------
  137. Linux testing is done with ``kitchen-salt``.
  138. ``kitchen converge``
  139. ^^^^^^^^^^^^^^^^^^^^
  140. Creates the docker instance and runs the ``template`` main state, ready for testing.
  141. ``kitchen verify``
  142. ^^^^^^^^^^^^^^^^^^
  143. Runs the ``inspec`` tests on the actual instance.
  144. ``kitchen destroy``
  145. ^^^^^^^^^^^^^^^^^^^
  146. Removes the docker instance.
  147. ``kitchen test``
  148. ^^^^^^^^^^^^^^^^
  149. Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
  150. ``kitchen login``
  151. ^^^^^^^^^^^^^^^^^
  152. Gives you SSH access to the instance for manual testing.