Saltstack Official Users Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pillar.example 4.9KB

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