Saltstack Official Users 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.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. .. _readme:
  2. users
  3. =====
  4. |img_travis| |img_sr|
  5. .. |img_travis| image:: https://travis-ci.com/saltstack-formulas/users-formula.svg?branch=master
  6. :alt: Travis CI Build Status
  7. :scale: 100%
  8. :target: https://travis-ci.com/saltstack-formulas/users-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. Formula to configure users via pillar.
  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 `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.
  28. Available states
  29. ----------------
  30. .. contents::
  31. :local:
  32. ``users``
  33. ^^^^^^^^^
  34. Configures a user's home directory, group, the user itself, secondary groups,
  35. and associated keys. Also configures sudo access, and absent users.
  36. ``users.sudo``
  37. ^^^^^^^^^^^^^^
  38. Ensures the sudo group exists, the sudo package is installed and the sudo file
  39. is configured.
  40. ``users.bashrc``
  41. ^^^^^^^^^^^^^^^^
  42. Ensures the bashrc file exists in the users home directory. Sets 'manage_bashrc:
  43. True' in pillar per user. Defaults to False.
  44. ``users.profile``
  45. ^^^^^^^^^^^^^^^^
  46. Ensures the profile file exists in the users home directory. Sets 'manage_profile:
  47. True' in pillar per user. Defaults to False.
  48. ``users.vimrc``
  49. ^^^^^^^^^^^^^^^
  50. Ensures the vimrc file exists in the users home directory. Sets 'manage_vimrc:
  51. True' in pillar per user. Defaults to False.
  52. This depends on the vim-formula being available and pillar `users:use_vim_formula: True`.
  53. ``users.user_files``
  54. ^^^^^^^^^^^^^^^^^^^^
  55. Permits the abitrary management of files. See pillar.example for configuration details.
  56. Overriding default values
  57. -------------------------
  58. In order to separate actual user account definitions from configuration the pillar ``users-formula`` was introduced:
  59. .. code-block:: yaml
  60. users:
  61. myuser:
  62. # stuff
  63. users-formula:
  64. lookup:
  65. root_group: toor
  66. shell: '/bin/zsh'
  67. Testing
  68. -------
  69. Linux testing is done with ``kitchen-salt``.
  70. Requirements
  71. ^^^^^^^^^^^^
  72. * Ruby
  73. * Docker
  74. .. code-block:: bash
  75. $ gem install bundler
  76. $ bundle install
  77. $ bin/kitchen test [platform]
  78. Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
  79. e.g. ``debian-9-2019-2-py3``.
  80. ``bin/kitchen converge``
  81. ^^^^^^^^^^^^^^^^^^^^^^^^
  82. Creates the docker instance and runs the ``template`` main state, ready for testing.
  83. ``bin/kitchen verify``
  84. ^^^^^^^^^^^^^^^^^^^^^^
  85. Runs the ``inspec`` tests on the actual instance.
  86. ``bin/kitchen destroy``
  87. ^^^^^^^^^^^^^^^^^^^^^^^
  88. Removes the docker instance.
  89. ``bin/kitchen test``
  90. ^^^^^^^^^^^^^^^^^^^^
  91. Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
  92. ``bin/kitchen login``
  93. ^^^^^^^^^^^^^^^^^^^^^
  94. Gives you SSH access to the instance for manual testing.