Saltstack Official Users Formula
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

200 linhas
5.8KB

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