Saltstack Official Users Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

150 行
4.5KB

  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. # you can provide multiple keys, the keyname is taken as filename
  59. # make sure your public keys suffix is .pub
  60. foobar: PRIVATEKEY
  61. foobar.pub: PUBLICKEY
  62. # ... or you can pull them from a different pillar,
  63. # for example one called "ssh_keys":
  64. ssh_keys_pillar:
  65. id_rsa: "ssh_keys"
  66. another_key_pair: "ssh_keys"
  67. ssh_auth:
  68. - PUBLICKEY
  69. ssh_auth.absent:
  70. - PUBLICKEY_TO_BE_REMOVED
  71. # Generates an authorized_keys file for the user
  72. # with the given keys
  73. ssh_auth_file:
  74. - PUBLICKEY
  75. # ... or you can pull them from a different pillar similar to ssh_keys_pillar
  76. ssh_auth_pillar:
  77. id_rsa: "ssh_keys"
  78. # If you prefer to keep public keys as files rather
  79. # than inline in pillar, this works.
  80. ssh_auth_sources:
  81. - salt://keys/buser.id_rsa.pub
  82. ssh_auth_sources.absent:
  83. - salt://keys/deleteduser.id_rsa.pub # PUBLICKEY_FILE_TO_BE_REMOVED
  84. # Manage the ~/.ssh/config file
  85. ssh_known_hosts:
  86. importanthost:
  87. fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
  88. ssh_known_hosts.absent:
  89. - notimportanthost
  90. ssh_config:
  91. all:
  92. hostname: "*"
  93. options:
  94. - "StrictHostKeyChecking no"
  95. - "UserKnownHostsFile=/dev/null"
  96. importanthost:
  97. hostname: "needcheck.example.com"
  98. options:
  99. - "StrictHostKeyChecking yes"
  100. # Using gitconfig without Git installed will result in an error
  101. # https://docs.saltstack.com/en/latest/ref/states/all/salt.states.git.html:
  102. # This state module now requires git 1.6.5 (released 10 October 2009) or newer.
  103. gitconfig:
  104. user.name: B User
  105. user.email: buser@example.com
  106. "url.https://.insteadOf": "git://"
  107. google_2fa: True
  108. google_auth:
  109. ssh: |
  110. SOMEGAUTHHASHVAL
  111. " RESETTING_TIME_SKEW 46956472+2 46991595-2
  112. " RATE_LIMIT 3 30 1415800560
  113. " DISALLOW_REUSE 47193352
  114. " TOTP_AUTH
  115. 11111111
  116. 22222222
  117. 33333333
  118. 44444444
  119. 55555555
  120. uid: 1001
  121. user_files:
  122. enabled: True
  123. # 'source' allows you to define an arbitrary directory to sync, useful to use for default files.
  124. # should be a salt fileserver path either with or without 'salt://'
  125. # if not present, it defaults to 'salt://users/files/user/<username>
  126. source: users/files/default
  127. template: jinja
  128. # You can specify octal mode for files and symlinks that will be copied. Since version 2016.11.0
  129. # it's possible to use 'keep' for file_mode, to preserve file original mode, thus you can save
  130. # execution bit for example.
  131. file_mode: keep
  132. sym_mode: 640
  133. ## Absent user
  134. cuser:
  135. absent: True
  136. purge: True
  137. force: True
  138. ## Old syntax of absent_users still supported
  139. absent_users:
  140. - donald
  141. - bad_guy