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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. users-formula
  2. =============
  3. |img_travis| |img_sr|
  4. .. |img_travis| image:: https://travis-ci.com/saltstack-formulas/users-formula.svg?branch=master
  5. :alt: Travis CI Build Status
  6. :scale: 100%
  7. :target: https://travis-ci.com/saltstack-formulas/users-formula
  8. .. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
  9. :alt: Semantic Release
  10. :scale: 100%
  11. :target: https://github.com/semantic-release/semantic-release
  12. Formula to configure users via pillar.
  13. .. contents:: **Table of Contents**
  14. General notes
  15. -------------
  16. See the full `SaltStack Formulas installation and usage instructions
  17. <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
  18. If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section
  19. <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas>`_.
  20. If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,
  21. which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/>`_.
  22. See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning>`_ for more details.
  23. Contributing to this repo
  24. -------------------------
  25. **Commit message formatting is significant!!**
  26. Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.
  27. Available states
  28. ----------------
  29. .. contents::
  30. :local:
  31. ``users``
  32. ^^^^^^^^^
  33. Configures a user's home directory, group, the user itself, secondary groups,
  34. and associated keys. Also configures sudo access, and absent users.
  35. ``users.sudo``
  36. ^^^^^^^^^^^^^^
  37. Ensures the sudo group exists, the sudo package is installed and the sudo file
  38. is configured.
  39. ``users.bashrc``
  40. ^^^^^^^^^^^^^^^^
  41. Ensures the bashrc file exists in the users home directory. Sets 'manage_bashrc:
  42. True' in pillar per user. Defaults to False.
  43. ``users.profile``
  44. ^^^^^^^^^^^^^^^^^
  45. Ensures the profile file exists in the users home directory. Sets 'manage_profile:
  46. True' in pillar per user. Defaults to False.
  47. ``users.vimrc``
  48. ^^^^^^^^^^^^^^^
  49. Ensures the vimrc file exists in the users home directory. Sets 'manage_vimrc:
  50. True' in pillar per user. Defaults to False.
  51. This depends on the vim-formula being available and pillar `users:use_vim_formula: True`.
  52. ``users.user_files``
  53. ^^^^^^^^^^^^^^^^^^^^
  54. Permits the abitrary management of files. See pillar.example for configuration details.
  55. Overriding default values
  56. -------------------------
  57. In order to separate actual user account definitions from configuration the pillar ``users-formula`` was introduced:
  58. .. code-block:: yaml
  59. users:
  60. myuser:
  61. # stuff
  62. users-formula:
  63. lookup:
  64. root_group: toor
  65. shell: '/bin/zsh'
  66. Testing
  67. -------
  68. Linux testing is done with ``kitchen-salt``.
  69. Requirements
  70. ^^^^^^^^^^^^
  71. * Ruby
  72. * Docker
  73. .. code-block:: bash
  74. $ gem install bundler
  75. $ bundle install
  76. $ bin/kitchen test [platform]
  77. Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
  78. e.g. ``debian-9-2019-2-py3``.
  79. ``bin/kitchen converge``
  80. ^^^^^^^^^^^^^^^^^^^^^^^^
  81. Creates the docker instance and runs the ``template`` main state, ready for testing.
  82. ``bin/kitchen verify``
  83. ^^^^^^^^^^^^^^^^^^^^^^
  84. Runs the ``inspec`` tests on the actual instance.
  85. ``bin/kitchen destroy``
  86. ^^^^^^^^^^^^^^^^^^^^^^^
  87. Removes the docker instance.
  88. ``bin/kitchen test``
  89. ^^^^^^^^^^^^^^^^^^^^
  90. Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
  91. ``bin/kitchen login``
  92. ^^^^^^^^^^^^^^^^^^^^^
  93. Gives you SSH access to the instance for manual testing.