Saltstack Official Users Formula
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

151 lines
4.5KB

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