Saltstack Official Users Formula
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

146 Zeilen
4.3KB

  1. users-formula:
  2. lookup: # override the defauls in map.jinja
  3. root_group: root
  4. users:
  5. ## Minimal required pillar values
  6. auser:
  7. fullname: A User
  8. ## Full list of pillar values
  9. buser:
  10. fullname: B User
  11. password: $6$w.............
  12. enforce_password: True
  13. # WARNING: If 'empty_password' is set to True, the 'password' statement
  14. # will be ignored by enabling password-less login for the user.
  15. empty_password: False
  16. hash_password: False
  17. system: False
  18. home: /custom/buser
  19. homedir_owner: buser
  20. homedir_group: primarygroup
  21. user_dir_mode: 750
  22. createhome: True
  23. roomnumber: "A-1"
  24. workphone: "(555) 555-5555"
  25. homephone: "(555) 555-5551"
  26. manage_vimrc: False
  27. manage_bashrc: False
  28. manage_profile: False
  29. expire: 16426
  30. sudouser: True
  31. # sudo_rules doesn't need the username as a prefix for the rule
  32. # this is added automatically by the formula.
  33. # ----------------------------------------------------------------------
  34. # In case your sudo_rules have a colon please have in mind to not leave
  35. # spaces around it. For example:
  36. # ALL=(ALL) NOPASSWD: ALL <--- THIS WILL NOT WORK (Besides syntax is ok)
  37. # ALL=(ALL) NOPASSWD:ALL <--- THIS WILL WORK
  38. sudo_rules:
  39. - ALL=(root) /usr/bin/find
  40. - ALL=(otheruser) /usr/bin/script.sh
  41. sudo_defaults:
  42. - '!requiretty'
  43. shell: /bin/bash
  44. remove_groups: False
  45. prime_group:
  46. name: primarygroup
  47. gid: 500
  48. groups:
  49. - users
  50. optional_groups:
  51. - some_groups_that_might
  52. - not_exist_on_all_minions
  53. ssh_key_type: rsa
  54. # You can inline the private keys ...
  55. ssh_keys:
  56. privkey: PRIVATEKEY
  57. pubkey: PUBLICKEY
  58. # ... or you can pull them from a different pillar,
  59. # for example one called "ssh_keys":
  60. ssh_keys_pillar:
  61. id_rsa: "ssh_keys"
  62. another_key_pair: "ssh_keys"
  63. ssh_auth:
  64. - PUBLICKEY
  65. ssh_auth.absent:
  66. - PUBLICKEY_TO_BE_REMOVED
  67. # Generates an authorized_keys file for the user
  68. # with the given keys
  69. ssh_auth_file:
  70. - PUBLICKEY
  71. # ... or you can pull them from a different pillar similar to ssh_keys_pillar
  72. ssh_auth_pillar:
  73. id_rsa: "ssh_keys"
  74. # If you prefer to keep public keys as files rather
  75. # than inline in pillar, this works.
  76. ssh_auth_sources:
  77. - salt://keys/buser.id_rsa.pub
  78. ssh_auth_sources.absent:
  79. - salt://keys/deleteduser.id_rsa.pub # PUBLICKEY_FILE_TO_BE_REMOVED
  80. # Manage the ~/.ssh/config file
  81. ssh_known_hosts:
  82. importanthost:
  83. fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
  84. ssh_known_hosts.absent:
  85. - notimportanthost
  86. ssh_config:
  87. all:
  88. hostname: "*"
  89. options:
  90. - "StrictHostKeyChecking no"
  91. - "UserKnownHostsFile=/dev/null"
  92. importanthost:
  93. hostname: "needcheck.example.com"
  94. options:
  95. - "StrictHostKeyChecking yes"
  96. # Using gitconfig without Git installed will result in an error
  97. # https://docs.saltstack.com/en/latest/ref/states/all/salt.states.git.html:
  98. # This state module now requires git 1.6.5 (released 10 October 2009) or newer.
  99. gitconfig:
  100. user.name: B User
  101. user.email: buser@example.com
  102. "url.https://.insteadOf": "git://"
  103. google_2fa: True
  104. google_auth:
  105. ssh: |
  106. SOMEGAUTHHASHVAL
  107. " RESETTING_TIME_SKEW 46956472+2 46991595-2
  108. " RATE_LIMIT 3 30 1415800560
  109. " DISALLOW_REUSE 47193352
  110. " TOTP_AUTH
  111. 11111111
  112. 22222222
  113. 33333333
  114. 44444444
  115. 55555555
  116. uid: 1001
  117. user_files:
  118. enabled: True
  119. # 'source' allows you to define an arbitrary directory to sync, useful to use for default files.
  120. # should be a salt fileserver path either with or without 'salt://'
  121. # if not present, it defaults to 'salt://users/files/user/<username>
  122. source: users/files/default
  123. template: jinja
  124. # You can specify octal mode for files and symlinks that will be copied. Since version 2016.11.0
  125. # it's possible to use 'keep' for file_mode, to preserve file original mode, thus you can save
  126. # execution bit for example.
  127. file_mode: keep
  128. sym_mode: 640
  129. ## Absent user
  130. cuser:
  131. absent: True
  132. purge: True
  133. force: True
  134. ## Old syntax of absent_users still supported
  135. absent_users:
  136. - donald
  137. - bad_guy