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.

205 lines
5.9KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=yaml
  3. ---
  4. users-formula:
  5. use_vim_formula: true
  6. lookup: # override the defauls in map.jinja
  7. root_group: root
  8. # group initialization
  9. groups:
  10. foo:
  11. state: present
  12. gid: 1500
  13. system: false
  14. badguys:
  15. absent: true
  16. niceguys:
  17. gid: 4242
  18. system: false
  19. addusers:
  20. - root
  21. delusers:
  22. - toor
  23. ssl-cert:
  24. system: true
  25. members:
  26. # *TODO*: run groups after all users created and then use `auser` and
  27. # `buser` instead
  28. - root
  29. - sshd
  30. # - bin
  31. # - daemon
  32. users:
  33. ## Minimal required pillar values
  34. auser:
  35. fullname: A User
  36. ## Full list of pillar values
  37. buser:
  38. fullname: B User
  39. password: $6$w.............
  40. enforce_password: true
  41. # WARNING: If 'empty_password' is set to true, the 'password' statement
  42. # will be ignored by enabling password-less login for the user.
  43. empty_password: false
  44. hash_password: false
  45. system: false
  46. home: /custom/buser
  47. homedir_owner: buser
  48. homedir_group: primarygroup
  49. user_dir_mode: 750
  50. createhome: true
  51. roomnumber: "A-1"
  52. workphone: "(555) 555-5555"
  53. homephone: "(555) 555-5551"
  54. manage_vimrc: false
  55. allow_gid_change: false
  56. manage_bashrc: false
  57. manage_profile: false
  58. expire: 16426
  59. # Disables user management except sudo rules.
  60. # Useful for setting sudo rules for system accounts created by package instalation
  61. sudoonly: false
  62. sudouser: true
  63. # sudo_rules doesn't need the username as a prefix for the rule
  64. # this is added automatically by the formula.
  65. # ----------------------------------------------------------------------
  66. # In case your sudo_rules have a colon please have in mind to not leave
  67. # spaces around it. For example:
  68. # ALL=(ALL) NOPASSWD: ALL <--- THIS WILL NOT WORK (Besides syntax is ok)
  69. # ALL=(ALL) NOPASSWD:ALL <--- THIS WILL WORK
  70. sudo_rules:
  71. - ALL=(root) /usr/bin/find
  72. - ALL=(otheruser) /usr/bin/script.sh
  73. sudo_defaults:
  74. - '!requiretty'
  75. # enable polkitadmin to make user an AdminIdentity for polkit
  76. polkitadmin: true
  77. shell: /bin/bash
  78. remove_groups: false
  79. prime_group:
  80. name: primarygroup
  81. gid: 1501
  82. groups:
  83. - users
  84. optional_groups:
  85. - some_groups_that_might
  86. - not_exist_on_all_minions
  87. ssh_key_type: rsa
  88. # # You can inline the private keys ...
  89. # ssh_keys:
  90. # privkey: PRIVATEKEY
  91. # pubkey: PUBLICKEY
  92. # # or you can provide path to key on Salt fileserver
  93. # # privkey: salt://path_to_PRIVATEKEY
  94. # # pubkey: salt://path_to_PUBLICKEY
  95. # # you can provide multiple keys, the keyname is taken as filename
  96. # # make sure your public keys suffix is .pub
  97. # foobar: PRIVATEKEY
  98. # foobar.pub: PUBLICKEY
  99. # # ... or you can pull them from a different pillar,
  100. # # for example one called "ssh_keys":
  101. # ssh_keys_pillar:
  102. # id_rsa: "ssh_keys"
  103. # another_key_pair: "ssh_keys"
  104. # ssh_auth:
  105. # - PUBLICKEY
  106. # ssh_auth.absent:
  107. # - PUBLICKEY_TO_BE_REMOVED
  108. # # Generates an authorized_keys file for the user
  109. # # with the given keys
  110. # ssh_auth_file:
  111. # - PUBLICKEY
  112. # # ... or you can pull them from a different pillar similar to ssh_keys_pillar
  113. # ssh_auth_pillar:
  114. # id_rsa: "ssh_keys"
  115. # # If you prefer to keep public keys as files rather
  116. # # than inline in pillar, this works.
  117. # ssh_auth_sources:
  118. # - salt://keys/buser.id_rsa.pub
  119. # ssh_auth_sources.absent:
  120. # - salt://keys/deleteduser.id_rsa.pub # PUBLICKEY_FILE_TO_BE_REMOVED
  121. # Manage the ~/.ssh/config file
  122. ssh_known_hosts:
  123. importanthost:
  124. port: 22
  125. fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
  126. key: PUBLICKEY
  127. enc: ssh-rsa
  128. hash_known_hosts: true
  129. timeout: 5
  130. fingerprint_hash_type: sha256
  131. ssh_known_hosts.absent:
  132. - notimportanthost
  133. ssh_config:
  134. all:
  135. hostname: "*"
  136. options:
  137. - "StrictHostKeyChecking no"
  138. - "UserKnownHostsFile=/dev/null"
  139. importanthost:
  140. hostname: "needcheck.example.com"
  141. options:
  142. - "StrictHostKeyChecking yes"
  143. # Using gitconfig without Git installed will result in an error
  144. # https://docs.saltstack.com/en/latest/ref/states/all/salt.states.git.html:
  145. # This state module now requires git 1.6.5 (released 10 October 2009) or newer.
  146. gitconfig:
  147. user.name: B User
  148. user.email: buser@example.com
  149. "url.https://.insteadOf": "git://"
  150. gitconfig.absent:
  151. - push.default
  152. - color\..+
  153. google_2fa: true
  154. google_auth:
  155. sshd: |
  156. SOMEGAUTHHASHVAL
  157. " RESETTING_TIME_SKEW 46956472+2 46991595-2
  158. " RATE_LIMIT 3 30 1415800560
  159. " DISALLOW_REUSE 47193352
  160. " TOTP_AUTH
  161. 11111111
  162. 22222222
  163. 33333333
  164. 44444444
  165. 55555555
  166. # unique: true allows user to have non unique uid
  167. unique: false
  168. uid: 1001
  169. user_files:
  170. enabled: true
  171. # 'source' allows you to define an arbitrary directory to sync,
  172. # useful to use for default files.
  173. # should be a salt fileserver path either with or without 'salt://'
  174. # if not present, it defaults to 'salt://users/files/user/<username>
  175. source: users/files
  176. # template: jinja
  177. # You can specify octal mode for files and symlinks that will be copied.
  178. # Since version 2016.11.0 it's possible to use 'keep' for file_mode,
  179. # to preserve file original mode, thus you can save execution bit for example.
  180. file_mode: keep
  181. # You can specify octal mode for directories as well.
  182. # This won't work on Windows minions
  183. # dir_mode: 775
  184. sym_mode: 640
  185. exclude_pat: "*.gitignore"
  186. ## Absent user
  187. cuser:
  188. absent: true
  189. purge: true
  190. force: true
  191. ## Old syntax of absent_users still supported
  192. absent_users:
  193. - donald
  194. - bad_guy