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.

193 line
5.4KB

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