1+ users-formula:
2+ use_vim_formula: True
3+ lookup: # override the defauls in map.jinja
4+ root_group: root
5+
6+ # group initialization
7+ groups:
8+ foo:
9+ state: present
10+ gid: 500
11+ system: False
12+
113users:
214 ## Minimal required pillar values
315 auser:
416 fullname: A User
517
618 ## Full list of pillar values
19+ allow_gid_change: False
720 buser:
821 fullname: B User
922 password: $6$w.............
@@ -22,9 +35,13 @@ users:
2235 workphone: "(555) 555-5555"
2336 homephone: "(555) 555-5551"
2437 manage_vimrc: False
38+ allow_gid_change: True
2539 manage_bashrc: False
2640 manage_profile: False
2741 expire: 16426
42+ # Disables user management except sudo rules.
43+ # Useful for setting sudo rules for system accounts created by package instalation
44+ sudoonly: False
2845 sudouser: True
2946 # sudo_rules doesn't need the username as a prefix for the rule
3047 # this is added automatically by the formula.
@@ -55,6 +72,13 @@ users:
5572 ssh_keys:
5673 privkey: PRIVATEKEY
5774 pubkey: PUBLICKEY
75+ # or you can provide path to key on Salt fileserver
76+ privkey: salt://path_to_PRIVATEKEY
77+ pubkey: salt://path_to_PUBLICKEY
78+ # you can provide multiple keys, the keyname is taken as filename
79+ # make sure your public keys suffix is .pub
80+ foobar: PRIVATEKEY
81+ foobar.pub: PUBLICKEY
5882 # ... or you can pull them from a different pillar,
5983 # for example one called "ssh_keys":
6084 ssh_keys_pillar:
@@ -75,10 +99,18 @@ users:
7599 # than inline in pillar, this works.
76100 ssh_auth_sources:
77101 - salt://keys/buser.id_rsa.pub
102+ ssh_auth_sources.absent:
103+ - salt://keys/deleteduser.id_rsa.pub # PUBLICKEY_FILE_TO_BE_REMOVED
78104 # Manage the ~/.ssh/config file
79105 ssh_known_hosts:
80106 importanthost:
107+ port: 22
81108 fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
109+ key: PUBLICKEY
110+ enc: ssh-rsa
111+ hash_known_hosts: True
112+ timeout: 5
113+ fingerprint_hash_type: sha256
82114 ssh_known_hosts.absent:
83115 - notimportanthost
84116 ssh_config:
@@ -98,7 +130,11 @@ users:
98130 gitconfig:
99131 user.name: B User
100132 user.email: buser@example.com
101- url."https://".insteadOf: "git://"
133+ "url.https://.insteadOf": "git://"
134+
135+ gitconfig.absent:
136+ - push.default
137+ - color\..+
102138
103139 google_2fa: True
104140 google_auth:
@@ -113,6 +149,8 @@ users:
113149 33333333
114150 44444444
115151 55555555
152+ # unique: True allows user to have non unique uid
153+ unique: False
116154 uid: 1001
117155
118156 user_files:
@@ -121,6 +159,13 @@ users:
121159 # should be a salt fileserver path either with or without 'salt://'
122160 # if not present, it defaults to 'salt://users/files/user/<username>
123161 source: users/files/default
162+ template: jinja
163+ # You can specify octal mode for files and symlinks that will be copied. Since version 2016.11.0
164+ # it's possible to use 'keep' for file_mode, to preserve file original mode, thus you can save
165+ # execution bit for example.
166+ file_mode: keep
167+ sym_mode: 640
168+ exclude_pat: "*.gitignore"
124169
125170 ## Absent user
126171 cuser:
@@ -133,3 +178,17 @@ users:
133178absent_users:
134179 - donald
135180 - bad_guy
181+
182+ groups:
183+ badguys:
184+ absent: True
185+ niceguys:
186+ gid: 4242
187+ system: False
188+ addusers: root
189+ delusers: toor
190+ ssl-cert:
191+ system: True
192+ members:
193+ - www-data
194+ - openldap
0 commit comments