Saltstack Official Users Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

154 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. 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. # or you can provide path to key on Salt fileserver
  59. privkey: salt://path_to_PRIVATEKEY
  60. pubkey: salt://path_to_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. uid: 1001
  124. user_files:
  125. enabled: True
  126. # 'source' allows you to define an arbitrary directory to sync, useful to use for default files.
  127. # should be a salt fileserver path either with or without 'salt://'
  128. # if not present, it defaults to 'salt://users/files/user/<username>
  129. source: users/files/default
  130. template: jinja
  131. # You can specify octal mode for files and symlinks that will be copied. Since version 2016.11.0
  132. # it's possible to use 'keep' for file_mode, to preserve file original mode, thus you can save
  133. # execution bit for example.
  134. file_mode: keep
  135. sym_mode: 640
  136. exclude_pat: "*.gitignore"
  137. ## Absent user
  138. cuser:
  139. absent: True
  140. purge: True
  141. force: True
  142. ## Old syntax of absent_users still supported
  143. absent_users:
  144. - donald
  145. - bad_guy