Saltstack Official Nginx 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 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. =====
  2. nginx
  3. =====
  4. Install nginx either by source or by package.
  5. .. note::
  6. See the full `Salt Formulas installation and usage instructions
  7. <http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
  8. Available states
  9. ================
  10. .. contents::
  11. :local:
  12. ``nginx``
  13. ---------
  14. Runs the states to install nginx, configure the common files, and the users.
  15. ``nginx.common``
  16. ----------------
  17. Ensures standard nginx files are in place, and configures enabled sites.
  18. ``nginx.luajit2``
  19. -----------------
  20. Installs luajit.
  21. ``nginx.openresty``
  22. -------------------
  23. Installs openresty.
  24. ``nginx.package``
  25. -----------------
  26. Installs the nginx package via package manager.
  27. ``nginx.source``
  28. ----------------
  29. Installs nginx via the source files.
  30. ``nginx.users``
  31. ---------------
  32. Installs apache utils, and configures nginx users specified in the pillar.
  33. This requires `basicauth <https://github.com/saltstack/salt-contrib/blob/master/modules/basicauth.py>`_
  34. from `salt-contrib <https://github.com/saltstack/salt-contrib/>`_ (either add it to your salt or ship
  35. this single file in your `_modules` directory see `Dynamic Module Distribution
  36. <https://docs.saltstack.com/en/latest/ref/file_server/dynamic-modules.html>`_
  37. Next-generation, alternate approach
  38. ===================================
  39. The following states provide an alternate approach to managing Nginx and Nginx
  40. servers, as well as code organization. Please provide feedback by filing issues,
  41. discussing in ``#salt`` in Freenode and the mailing list as normal.
  42. .. contents::
  43. :local:
  44. ``nginx.ng``
  45. ------------
  46. Meta-state for inclusion of all ng states.
  47. **Note:** nginx.ng requires the merge parameter of salt.modules.pillar.get(),
  48. first available in the Helium release.
  49. ``nginx.ng.pkg``
  50. --------------------
  51. Installs nginx from package, from the distribution repositories, the official nginx repo or the ppa from Launchpad.
  52. ``nginx.ng.src``
  53. --------------------
  54. Builds and installs nginx from source.
  55. ``nginx.ng.certificates``
  56. -------------------
  57. Manages the deployment of nginx certificates.
  58. ``nginx.ng.config``
  59. -------------------
  60. Manages the nginx main server configuration file.
  61. ``nginx.ng.service``
  62. --------------------
  63. Manages the startup and running state of the nginx service.
  64. ``nginx.ng.servers_config``
  65. --------------------------
  66. Manages virtual host files. This state only manages the content of the files
  67. and does not bind them to service calls.
  68. ``nginx.ng.servers``
  69. -------------------
  70. Manages nginx virtual hosts files and binds them to service calls.
  71. ``nginx.ng.passenger``
  72. ----------------------
  73. Installs and configures Phusion Passenger module for nginx. You need to enable
  74. the upstream phusion passenger repository with `install_from_phusionpassenger: true`.
  75. Nginx will also be installed from that repository, as it needs to be modified to
  76. allow the passenger module to work.
  77. Running Tests
  78. =============
  79. This test runner was implemented using the formula-test-harness_ project.
  80. Tests will be run on the following base images:
  81. * ``simplyadrian/allsalt:centos_master_2017.7.2``
  82. * ``simplyadrian/allsalt:debian_master_2017.7.2``
  83. * ``simplyadrian/allsalt:opensuse_master_2017.7.2``
  84. * ``simplyadrian/allsalt:ubuntu_master_2016.11.3``
  85. * ``simplyadrian/allsalt:ubuntu_master_2017.7.2``
  86. Local Setup
  87. -----------
  88. .. code-block:: shell
  89. pip install -U virtualenv
  90. virtualenv .venv
  91. source .venv/bin/activate
  92. make setup
  93. Run tests
  94. ---------
  95. * ``make test-centos_master_2017.7.2``
  96. * ``make test-debian_master_2017.7.2``
  97. * ``make test-opensuse_master_2017.7.2``
  98. * ``make test-ubuntu_master_2016.11.3``
  99. * ``make test-ubuntu_master_2017.7.2``
  100. Run Containers
  101. --------------
  102. * ``make local-centos_master_2017.7.2``
  103. * ``make local-debian_master_2017.7.2``
  104. * ``make local-opensuse_master_2017.7.2``
  105. * ``make local-ubuntu_master_2016.11.3``
  106. * ``make local-ubuntu_master_2017.7.2``
  107. .. _formula-test-harness: https://github.com/intuitivetechnologygroup/formula-test-harness