Saltstack Official Users Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

155 lines
4.7KB

  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. # Disables user management except sudo rules.
  31. # Useful for setting sudo rules for system accounts created by package instalation
  32. sudoonly: False
  33. sudouser: True
  34. # sudo_rules doesn't need the username as a prefix for the rule
  35. # this is added automatically by the formula.
  36. # ----------------------------------------------------------------------
  37. # In case your sudo_rules have a colon please have in mind to not leave
  38. # spaces around it. For example:
  39. # ALL=(ALL) NOPASSWD: ALL <--- THIS WILL NOT WORK (Besides syntax is ok)
  40. # ALL=(ALL) NOPASSWD:ALL <--- THIS WILL WORK
  41. sudo_rules:
  42. - ALL=(root) /usr/bin/find
  43. - ALL=(otheruser) /usr/bin/script.sh
  44. sudo_defaults:
  45. - '!requiretty'
  46. shell: /bin/bash
  47. remove_groups: False
  48. prime_group:
  49. name: primarygroup
  50. gid: 500
  51. groups:
  52. - users
  53. optional_groups:
  54. - some_groups_that_might
  55. - not_exist_on_all_minions
  56. ssh_key_type: rsa
  57. # You can inline the private keys ...
  58. ssh_keys:
  59. privkey: PRIVATEKEY
  60. pubkey: PUBLICKEY
  61. # you can provide multiple keys, the keyname is taken as filename
  62. # make sure your public keys suffix is .pub
  63. foobar: PRIVATEKEY
  64. foobar.pub: PUBLICKEY
  65. # ... or you can pull them from a different pillar,
  66. # for example one called "ssh_keys":
  67. ssh_keys_pillar:
  68. id_rsa: "ssh_keys"
  69. another_key_pair: "ssh_keys"
  70. ssh_auth:
  71. - PUBLICKEY
  72. ssh_auth.absent:
  73. - PUBLICKEY_TO_BE_REMOVED
  74. # Generates an authorized_keys file for the user
  75. # with the given keys
  76. ssh_auth_file:
  77. - PUBLICKEY
  78. # ... or you can pull them from a different pillar similar to ssh_keys_pillar
  79. ssh_auth_pillar:
  80. id_rsa: "ssh_keys"
  81. # If you prefer to keep public keys as files rather
  82. # than inline in pillar, this works.
  83. ssh_auth_sources:
  84. - salt://keys/buser.id_rsa.pub
  85. ssh_auth_sources.absent:
  86. - salt://keys/deleteduser.id_rsa.pub # PUBLICKEY_FILE_TO_BE_REMOVED
  87. # Manage the ~/.ssh/config file
  88. ssh_known_hosts:
  89. importanthost:
  90. fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
  91. ssh_known_hosts.absent:
  92. - notimportanthost
  93. ssh_config:
  94. all:
  95. hostname: "*"
  96. options:
  97. - "StrictHostKeyChecking no"
  98. - "UserKnownHostsFile=/dev/null"
  99. importanthost:
  100. hostname: "needcheck.example.com"
  101. options:
  102. - "StrictHostKeyChecking yes"
  103. # Using gitconfig without Git installed will result in an error
  104. # https://docs.saltstack.com/en/latest/ref/states/all/salt.states.git.html:
  105. # This state module now requires git 1.6.5 (released 10 October 2009) or newer.
  106. gitconfig:
  107. user.name: B User
  108. user.email: buser@example.com
  109. "url.https://.insteadOf": "git://"
  110. google_2fa: True
  111. google_auth:
  112. ssh: |
  113. SOMEGAUTHHASHVAL
  114. " RESETTING_TIME_SKEW 46956472+2 46991595-2
  115. " RATE_LIMIT 3 30 1415800560
  116. " DISALLOW_REUSE 47193352
  117. " TOTP_AUTH
  118. 11111111
  119. 22222222
  120. 33333333
  121. 44444444
  122. 55555555
  123. # unique: True allows user to have non unique uid
  124. unique: False
  125. uid: 1001
  126. user_files:
  127. enabled: True
  128. # 'source' allows you to define an arbitrary directory to sync, useful to use for default files.
  129. # should be a salt fileserver path either with or without 'salt://'
  130. # if not present, it defaults to 'salt://users/files/user/<username>
  131. source: users/files/default
  132. template: jinja
  133. # You can specify octal mode for files and symlinks that will be copied. Since version 2016.11.0
  134. # it's possible to use 'keep' for file_mode, to preserve file original mode, thus you can save
  135. # execution bit for example.
  136. file_mode: keep
  137. sym_mode: 640
  138. ## Absent user
  139. cuser:
  140. absent: True
  141. purge: True
  142. force: True
  143. ## Old syntax of absent_users still supported
  144. absent_users:
  145. - donald
  146. - bad_guy