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.

625 lines
18KB

  1. # vim: sts=2 ts=2 sw=2 et ai
  2. {% from "users/map.jinja" import users with context %}
  3. {% set used_sudo = [] %}
  4. {% set used_googleauth = [] %}
  5. {% set used_user_files = [] %}
  6. {% set used_polkit = [] %}
  7. {%- set create_dirs = [] %}
  8. {%- set created_groups = [] %}
  9. {% for group, setting in salt['pillar.get']('groups', {}).items() %}
  10. {% if setting.absent is defined and setting.absent or setting.get('state', "present") == 'absent' %}
  11. users_group_absent_{{ group }}:
  12. group.absent:
  13. - name: {{ group }}
  14. {% else %}
  15. {%- do created_groups.append(group) %}
  16. users_group_present_{{ group }}:
  17. group.present:
  18. - name: {{ group }}
  19. - gid: {{ setting.get('gid', "null") }}
  20. - system: {{ setting.get('system',"False") }}
  21. - members: {{ setting.get('members')|json }}
  22. - addusers: {{ setting.get('addusers')|json }}
  23. - delusers: {{ setting.get('delusers')|json }}
  24. {% endif %}
  25. {% endfor %}
  26. {%- for name, user in pillar.get('users', {}).items()
  27. if user.absent is not defined or not user.absent %}
  28. {%- if user == None -%}
  29. {%- set user = {} -%}
  30. {%- endif -%}
  31. {%- if 'sudoonly' in user and user['sudoonly'] %}
  32. {%- set _dummy=user.update({'sudouser': True}) %}
  33. {%- endif %}
  34. {%- if 'sudouser' in user and user['sudouser'] %}
  35. {%- do used_sudo.append(1) %}
  36. {%- endif %}
  37. {%- if 'google_auth' in user %}
  38. {%- do used_googleauth.append(1) %}
  39. {%- endif %}
  40. {%- if salt['pillar.get']('users:' ~ name ~ ':user_files:enabled', False) %}
  41. {%- do used_user_files.append(1) %}
  42. {%- endif %}
  43. {%- if user.get('polkitadmin', False) == True %}
  44. {%- do used_polkit.append(1) %}
  45. {%- endif %}
  46. {%- endfor %}
  47. {%- if used_sudo or used_googleauth or used_user_files or used_polkit %}
  48. include:
  49. {%- if used_sudo %}
  50. - users.sudo
  51. {%- endif %}
  52. {%- if used_googleauth %}
  53. - users.googleauth
  54. {%- endif %}
  55. {%- if used_user_files %}
  56. - users.user_files
  57. {%- endif %}
  58. {%- if used_polkit %}
  59. - users.polkit
  60. {%- endif %}
  61. {%- endif %}
  62. {% for name, user in pillar.get('users', {}).items()
  63. if user.absent is not defined or not user.absent %}
  64. {%- if user == None -%}
  65. {%- set user = {} -%}
  66. {%- endif -%}
  67. {%- set current = salt.user.info(name) -%}
  68. {%- set home = user.get('home', current.get('home', "/home/%s" % name)) -%}
  69. {%- set createhome = user.get('createhome', users.get('createhome')) -%}
  70. {%- if 'prime_group' in user and 'name' in user['prime_group'] %}
  71. {%- set user_group = user.prime_group.name -%}
  72. {%- else -%}
  73. {%- set user_group = name -%}
  74. {%- endif %}
  75. {%- if createhome %}
  76. {%- set required_dir = salt['file.dirname'](home) %}
  77. {%- do create_dirs.append(required_dir) %}
  78. {%- endif %}
  79. {%- if not ( 'sudoonly' in user and user['sudoonly'] ) %}
  80. {#- create prime group #}
  81. {%- if user_group not in created_groups %}
  82. {%- do created_groups.append(user_group) %}
  83. users_group_present_{{ user_group }}:
  84. group.present:
  85. - name: {{ user_group }}
  86. {%- if 'prime_group' in user and 'gid' in user['prime_group'] %}
  87. - gid: {{ user['prime_group']['gid'] }}
  88. {%- elif 'uid' in user %}
  89. - gid: {{ user['uid'] }}
  90. {%- endif %}
  91. {% if 'system' in user and user['system'] %}
  92. - system: True
  93. {% endif %}
  94. {%- endif %}
  95. {#- create required groups #}
  96. {%- for group in user.get('groups', []) if group not in created_groups %}
  97. {%- do created_groups.append(group) %}
  98. users_group_present_{{ group }}:
  99. group.present:
  100. - name: {{ group }}
  101. {% if group == 'sudo' %}
  102. - system: True
  103. {% endif %}
  104. {% endfor %}
  105. users_{{ name }}_user:
  106. {% if createhome -%}
  107. file.directory:
  108. - name: {{ home }}
  109. - user: {{ user.get('homedir_owner', name) }}
  110. - group: {{ user.get('homedir_group', user_group) }}
  111. - mode: {{ user.get('user_dir_mode', '0750') }}
  112. - makedirs: True
  113. - require:
  114. - user: users_{{ name }}_user
  115. - group: {{ user_group }}
  116. {%- endif %}
  117. user.present:
  118. - name: {{ name }}
  119. - home: {{ home }}
  120. - shell: {{ user.get('shell', current.get('shell', users.get('shell', '/bin/bash'))) }}
  121. {% if 'uid' in user -%}
  122. - uid: {{ user['uid'] }}
  123. {% endif -%}
  124. {% if 'password' in user -%}
  125. - password: '{{ user['password'] }}'
  126. {% endif -%}
  127. {% if user.get('empty_password') -%}
  128. - empty_password: {{ user.get('empty_password') }}
  129. {% endif -%}
  130. {% if 'enforce_password' in user -%}
  131. - enforce_password: {{ user['enforce_password'] }}
  132. {% endif -%}
  133. {% if 'hash_password' in user -%}
  134. - hash_password: {{ user['hash_password'] }}
  135. {% endif -%}
  136. {% if user.get('system', False) -%}
  137. - system: True
  138. {% endif -%}
  139. {% if 'prime_group' in user and 'gid' in user['prime_group'] -%}
  140. - gid: {{ user['prime_group']['gid'] }}
  141. {% elif 'prime_group' in user and 'name' in user['prime_group'] %}
  142. - gid: {{ user['prime_group']['name'] }}
  143. {% elif grains.os != 'MacOS' -%}
  144. - gid: {{ name }}
  145. {% endif -%}
  146. {% if 'fullname' in user %}
  147. - fullname: {{ user['fullname'] }}
  148. {% endif -%}
  149. {% if 'roomnumber' in user %}
  150. - roomnumber: {{ user['roomnumber'] }}
  151. {% endif %}
  152. {% if 'workphone' in user %}
  153. - workphone: {{ user['workphone'] }}
  154. {% endif %}
  155. {% if 'homephone' in user %}
  156. - homephone: {{ user['homephone'] }}
  157. {% endif %}
  158. - createhome: {{ createhome }}
  159. {% if not user.get('unique', True) %}
  160. - unique: False
  161. {% endif %}
  162. {%- if grains['saltversioninfo'] >= [2018, 3, 1] %}
  163. - allow_gid_change: {{ users.allow_gid_change if 'allow_gid_change' not in user else user['allow_gid_change'] }}
  164. {%- endif %}
  165. {% if 'expire' in user -%}
  166. {% if grains['kernel'].endswith('BSD') and
  167. user['expire'] < 157766400 %}
  168. {# 157762800s since epoch equals 01 Jan 1975 00:00:00 UTC #}
  169. - expire: {{ user['expire'] * 86400 }}
  170. {% elif grains['kernel'] == 'Linux' and
  171. user['expire'] > 84006 %}
  172. {# 2932896 days since epoch equals 9999-12-31 #}
  173. - expire: {{ (user['expire'] / 86400) | int }}
  174. {% else %}
  175. - expire: {{ user['expire'] }}
  176. {% endif %}
  177. {% endif -%}
  178. {% if 'mindays' in user %}
  179. - mindays: {{ user.get('mindays', None) }}
  180. {% endif %}
  181. {% if 'maxdays' in user %}
  182. - maxdays: {{ user.get('maxdays', None) }}
  183. {% endif %}
  184. {% if 'inactdays' in user %}
  185. - inactdays: {{ user.get('inactdays', None) }}
  186. {% endif %}
  187. {% if 'warndays' in user %}
  188. - warndays: {{ user.get('warndays', None) }}
  189. {% endif %}
  190. - remove_groups: {{ user.get('remove_groups', 'False') }}
  191. - groups:
  192. - {{ user_group }}
  193. {% for group in user.get('groups', []) -%}
  194. - {{ group }}
  195. {% endfor %}
  196. {% if 'optional_groups' in user %}
  197. - optional_groups:
  198. {% for optional_group in user['optional_groups'] -%}
  199. - {{ optional_group }}
  200. {% endfor %}
  201. {% endif %}
  202. - require:
  203. - group: {{ user_group }}
  204. {% for group in user.get('groups', []) -%}
  205. - group: {{ group }}
  206. {% endfor %}
  207. {%- if createhome and required_dir != '/' %}
  208. - file: users_prereq_dir_{{ required_dir }}
  209. {%- endif %}
  210. {% if 'ssh_keys' in user or
  211. 'ssh_auth' in user or
  212. 'ssh_auth_file' in user or
  213. 'ssh_auth_pillar' in user or
  214. 'ssh_auth.absent' in user or
  215. 'ssh_config' in user %}
  216. user_keydir_{{ name }}:
  217. file.directory:
  218. - name: {{ home }}/.ssh
  219. - user: {{ name }}
  220. - group: {{ user_group }}
  221. - makedirs: True
  222. - mode: '0700'
  223. - dir_mode: '0700'
  224. - require:
  225. - user: {{ name }}
  226. - group: {{ user_group }}
  227. {%- for group in user.get('groups', []) %}
  228. - group: {{ group }}
  229. {%- endfor %}
  230. {% endif %}
  231. {% if 'ssh_keys' in user %}
  232. {% for _key in user.ssh_keys.keys() %}
  233. {% if _key == 'privkey' %}
  234. {% set key_name = 'id_' + user.get('ssh_key_type', 'rsa') %}
  235. {% elif _key == 'pubkey' %}
  236. {% set key_name = 'id_' + user.get('ssh_key_type', 'rsa') + '.pub' %}
  237. {% else %}
  238. {% set key_name = _key %}
  239. {% endif %}
  240. users_{{ name }}_{{ key_name }}_key:
  241. file.managed:
  242. - name: {{ home }}/.ssh/{{ key_name }}
  243. - user: {{ name }}
  244. - group: {{ user_group }}
  245. {% if key_name.endswith(".pub") %}
  246. - mode: '0644'
  247. {% else %}
  248. - mode: '0600'
  249. {% endif %}
  250. - show_diff: False
  251. {%- set key_value = salt['pillar.get']('users:'+name+':ssh_keys:'+_key) %}
  252. {%- if 'salt://' in key_value[:7] %}
  253. - source: {{ key_value }}
  254. {%- else %}
  255. - contents_pillar: users:{{ name }}:ssh_keys:{{ _key }}
  256. {%- endif %}
  257. - require:
  258. - user: users_{{ name }}_user
  259. {% for group in user.get('groups', []) %}
  260. - group: users_{{ name }}_{{ group }}_group
  261. {% endfor %}
  262. {% endfor %}
  263. {% endif %}
  264. {% if 'ssh_auth_file' in user or 'ssh_auth_pillar' in user %}
  265. users_authorized_keys_{{ name }}:
  266. file.managed:
  267. - name: {{ home }}/.ssh/authorized_keys
  268. - user: {{ name }}
  269. - group: {{ user_group }}
  270. - mode: '0600'
  271. {% if 'ssh_auth_file' in user %}
  272. - contents: |
  273. {% for auth in user.ssh_auth_file -%}
  274. {{ auth }}
  275. {% endfor -%}
  276. {% else %}
  277. - contents: |
  278. {%- for key_name, pillar_name in user['ssh_auth_pillar'].items() %}
  279. {{ salt['pillar.get'](pillar_name + ':' + key_name + ':pubkey', '') }}
  280. {%- endfor %}
  281. {% endif %}
  282. {% endif %}
  283. {% if 'ssh_auth' in user %}
  284. {% for auth in user['ssh_auth'] %}
  285. users_ssh_auth_{{ name }}_{{ loop.index0 }}:
  286. ssh_auth.present:
  287. - user: {{ name }}
  288. - name: {{ auth }}
  289. - require:
  290. - file: user_keydir_{{ name }}
  291. - user: users_{{ name }}_user
  292. {% endfor %}
  293. {% endif %}
  294. {% if 'ssh_keys_pillar' in user %}
  295. {% for key_name, pillar_name in user['ssh_keys_pillar'].items() %}
  296. user_ssh_keys_files_{{ name }}_{{ key_name }}_private_key:
  297. file.managed:
  298. - name: {{ home }}/.ssh/{{ key_name }}
  299. - user: {{ name }}
  300. - group: {{ user_group }}
  301. - mode: '0600'
  302. - show_diff: False
  303. - contents_pillar: {{ pillar_name }}:{{ key_name }}:privkey
  304. - require:
  305. - user: users_{{ name }}_user
  306. {% for group in user.get('groups', []) %}
  307. - group: users_{{ name }}_{{ group }}_group
  308. {% endfor %}
  309. user_ssh_keys_files_{{ name }}_{{ key_name }}_public_key:
  310. file.managed:
  311. - name: {{ home }}/.ssh/{{ key_name }}.pub
  312. - user: {{ name }}
  313. - group: {{ user_group }}
  314. - mode: '0644'
  315. - show_diff: False
  316. - contents_pillar: {{ pillar_name }}:{{ key_name }}:pubkey
  317. - require:
  318. - user: users_{{ name }}_user
  319. {% for group in user.get('groups', []) %}
  320. - group: users_{{ name }}_{{ group }}_group
  321. {% endfor %}
  322. {% endfor %}
  323. {% endif %}
  324. {% if 'ssh_auth_sources' in user %}
  325. {% for pubkey_file in user['ssh_auth_sources'] %}
  326. users_ssh_auth_source_{{ name }}_{{ loop.index0 }}:
  327. ssh_auth.present:
  328. - user: {{ name }}
  329. - source: {{ pubkey_file }}
  330. - require:
  331. {% if createhome -%}
  332. - file: users_{{ name }}_user
  333. {% endif -%}
  334. - user: users_{{ name }}_user
  335. {% endfor %}
  336. {% endif %}
  337. {% if 'ssh_auth_sources.absent' in user %}
  338. {% for pubkey_file in user['ssh_auth_sources.absent'] %}
  339. users_ssh_auth_source_delete_{{ name }}_{{ loop.index0 }}:
  340. ssh_auth.absent:
  341. - user: {{ name }}
  342. - source: {{ pubkey_file }}
  343. - require:
  344. {% if createhome -%}
  345. - file: users_{{ name }}_user
  346. {% endif -%}
  347. - user: users_{{ name }}_user
  348. {% endfor %}
  349. {% endif %}
  350. {% if 'ssh_auth.absent' in user %}
  351. {% for auth in user['ssh_auth.absent'] %}
  352. users_ssh_auth_delete_{{ name }}_{{ loop.index0 }}:
  353. ssh_auth.absent:
  354. - user: {{ name }}
  355. - name: {{ auth }}
  356. - require:
  357. {% if createhome -%}
  358. - file: users_{{ name }}_user
  359. {% endif -%}
  360. - user: users_{{ name }}_user
  361. {% endfor %}
  362. {% endif %}
  363. {% if 'ssh_config' in user %}
  364. users_ssh_config_{{ name }}:
  365. file.managed:
  366. - name: {{ home }}/.ssh/config
  367. - user: {{ name }}
  368. - group: {{ user_group }}
  369. - mode: '0640'
  370. - contents: |
  371. # Managed by Saltstack
  372. # Do Not Edit
  373. {% for label, setting in user.ssh_config.items() %}
  374. # {{ label }}
  375. Host {{ setting.get('hostname') }}
  376. {%- for opts in setting.get('options') %}
  377. {{ opts }}
  378. {%- endfor %}
  379. {% endfor -%}
  380. {% endif %}
  381. {% if 'ssh_known_hosts' in user %}
  382. {% for hostname, host in user['ssh_known_hosts'].items() %}
  383. users_ssh_known_hosts_{{ name }}_{{ loop.index0 }}:
  384. ssh_known_hosts.present:
  385. - user: {{ name }}
  386. - name: {{ hostname }}
  387. {% if 'port' in host %}
  388. - port: {{ host['port'] }}
  389. {% endif -%}
  390. {% if 'fingerprint' in host %}
  391. - fingerprint: {{ host['fingerprint'] }}
  392. {% endif -%}
  393. {% if 'key' in host %}
  394. - key: {{ host['key'] }}
  395. {% endif -%}
  396. {% if 'enc' in host %}
  397. - enc: {{ host['enc'] }}
  398. {% endif -%}
  399. {% if 'hash_known_hosts' in host %}
  400. - hash_known_hosts: {{ host['hash_known_hosts'] }}
  401. {% endif -%}
  402. {% if 'timeout' in host %}
  403. - timeout: {{ host['timeout'] }}
  404. {% endif -%}
  405. {% if 'fingerprint_hash_type' in host %}
  406. - fingerprint_hash_type: {{ host['fingerprint_hash_type'] }}
  407. {% endif -%}
  408. {% endfor %}
  409. {% endif %}
  410. {% if 'ssh_known_hosts.absent' in user %}
  411. {% for host in user['ssh_known_hosts.absent'] %}
  412. users_ssh_known_hosts_delete_{{ name }}_{{ loop.index0 }}:
  413. ssh_known_hosts.absent:
  414. - user: {{ name }}
  415. - name: {{ host }}
  416. {% endfor %}
  417. {% endif %}
  418. {% endif %}
  419. {% set sudoers_d_filename = name|replace('.','_') %}
  420. {% if 'sudouser' in user and user['sudouser'] %}
  421. users_sudoer-{{ name }}:
  422. file.managed:
  423. - replace: False
  424. - name: {{ users.sudoers_dir }}/{{ sudoers_d_filename }}
  425. - user: root
  426. - group: {{ users.root_group }}
  427. - mode: '0440'
  428. {% if 'sudo_rules' in user or 'sudo_defaults' in user %}
  429. #{#%
  430. {% if 'sudo_rules' in user %}
  431. {% for rule in user['sudo_rules'] %}
  432. "validate {{ name }} sudo rule {{ loop.index0 }} {{ name }} {{ rule }}":
  433. cmd.run:
  434. - name: 'visudo -cf - <<<"$rule" | { read output; if [[ $output != "stdin: parsed OK" ]] ; then echo $output ; fi }'
  435. - stateful: True
  436. - shell: {{ users.visudo_shell }}
  437. - env:
  438. # Specify the rule via an env var to avoid shell quoting issues.
  439. - rule: "{{ name }} {{ rule }}"
  440. - require_in:
  441. - file: users_{{ users.sudoers_dir }}/{{ name }}
  442. {% endfor %}
  443. {% endif %}
  444. {% if 'sudo_defaults' in user %}
  445. {% for entry in user['sudo_defaults'] %}
  446. "validate {{ name }} sudo Defaults {{ loop.index0 }} {{ name }} {{ entry }}":
  447. cmd.run:
  448. - name: 'visudo -cf - <<<"$rule" | { read output; if [[ $output != "stdin: parsed OK" ]] ; then echo $output ; fi }'
  449. - stateful: True
  450. - shell: {{ users.visudo_shell }}
  451. - env:
  452. # Specify the rule via an env var to avoid shell quoting issues.
  453. - rule: "Defaults:{{ name }} {{ entry }}"
  454. - require_in:
  455. - file: users_{{ users.sudoers_dir }}/{{ name }}
  456. {% endfor %}
  457. {% endif %}
  458. #%#}
  459. users_{{ users.sudoers_dir }}/{{ name }}:
  460. file.managed:
  461. - replace: True
  462. - name: {{ users.sudoers_dir }}/{{ sudoers_d_filename }}
  463. - contents: |
  464. {%- if 'sudo_defaults' in user %}
  465. {%- for entry in user['sudo_defaults'] %}
  466. Defaults:{{ name }} {{ entry }}
  467. {%- endfor %}
  468. {%- endif %}
  469. {%- if 'sudo_rules' in user %}
  470. ########################################################################
  471. # File managed by Salt (users-formula).
  472. # Your changes will be overwritten.
  473. ########################################################################
  474. #
  475. {%- for rule in user['sudo_rules'] %}
  476. {{ name }} {{ rule }}
  477. {%- endfor %}
  478. {%- endif %}
  479. - require:
  480. - file: users_sudoer-defaults
  481. - file: users_sudoer-{{ name }}
  482. cmd.wait:
  483. - name: visudo -cf {{ users.sudoers_dir }}/{{ sudoers_d_filename }} || ( rm -rvf {{ users.sudoers_dir }}/{{ sudoers_d_filename }}; exit 1 )
  484. - watch:
  485. - file: {{ users.sudoers_dir }}/{{ sudoers_d_filename }}
  486. {% endif %}
  487. {% else %}
  488. users_{{ users.sudoers_dir }}/{{ sudoers_d_filename }}:
  489. file.absent:
  490. - name: {{ users.sudoers_dir }}/{{ sudoers_d_filename }}
  491. {% endif %}
  492. {%- if not grains['os_family'] in ['RedHat', 'Suse'] %}
  493. {%- if 'google_auth' in user %}
  494. {%- for svc in user['google_auth'] %}
  495. users_googleauth-{{ svc }}-{{ name }}:
  496. file.managed:
  497. - replace: false
  498. - name: {{ users.googleauth_dir }}/{{ name }}_{{ svc }}
  499. - contents_pillar: 'users:{{ name }}:google_auth:{{ svc }}'
  500. - user: root
  501. - group: {{ users.root_group }}
  502. - mode: '0400'
  503. - require:
  504. - pkg: users_googleauth-package
  505. {%- endfor %}
  506. {%- endif %}
  507. {%- endif %}
  508. # this doesn't work (Salt bug), therefore need to run state.apply twice
  509. #include:
  510. # - users
  511. #
  512. #git:
  513. # pkg.installed:
  514. # - require_in:
  515. # - sls: users
  516. #
  517. {% if salt['cmd.has_exec']('git') %}
  518. {% if 'gitconfig' in user %}
  519. {% for key, value in user['gitconfig'].items() %}
  520. users_{{ name }}_user_gitconfig_{{ loop.index0 }}:
  521. {% if grains['saltversioninfo'] >= [2015, 8, 0, 0] %}
  522. git.config_set:
  523. {% else %}
  524. git.config:
  525. {% endif %}
  526. - name: {{ key }}
  527. - value: "{{ value }}"
  528. - user: {{ name }}
  529. {% if grains['saltversioninfo'] >= [2015, 8, 0, 0] %}
  530. - global: True
  531. {% else %}
  532. - is_global: True
  533. {% endif %}
  534. {% endfor %}
  535. {% endif %}
  536. {% if 'gitconfig.absent' in user and grains['saltversioninfo'] >= [2015, 8, 0, 0] %}
  537. {% for key in user.get('gitconfig.absent') %}
  538. users_{{ name }}_user_gitconfig_absent_{{ key }}:
  539. git.config_unset:
  540. - name: '{{ key }}'
  541. - user: {{ name }}
  542. - global: True
  543. - all: True
  544. {% endfor %}
  545. {% endif %}
  546. {% endif %}
  547. {% endfor %}
  548. {#- create directories for homes #}
  549. {%- for dir in create_dirs|unique|reject('equalto', '/') %}
  550. users_prereq_dir_{{ dir }}:
  551. file.directory:
  552. - name: {{ dir }}
  553. - makedirs: True
  554. {%- endfor %}
  555. {% for name, user in pillar.get('users', {}).items()
  556. if user.absent is defined and user.absent %}
  557. users_absent_user_{{ name }}:
  558. {% if 'purge' in user or 'force' in user %}
  559. user.absent:
  560. - name: {{ name }}
  561. {% if 'purge' in user %}
  562. - purge: {{ user['purge'] }}
  563. {% endif %}
  564. {% if 'force' in user %}
  565. - force: {{ user['force'] }}
  566. {% endif %}
  567. {% else %}
  568. user.absent:
  569. - name: {{ name }}
  570. {% endif -%}
  571. users_{{ users.sudoers_dir }}/{{ name }}:
  572. file.absent:
  573. - name: {{ users.sudoers_dir }}/{{ name }}
  574. {% endfor %}
  575. {% for user in pillar.get('absent_users', []) %}
  576. users_absent_user_2_{{ user }}:
  577. user.absent:
  578. - name: {{ user }}
  579. users_2_{{ users.sudoers_dir }}/{{ user }}:
  580. file.absent:
  581. - name: {{ users.sudoers_dir }}/{{ user }}
  582. {% endfor %}
  583. {% for group in pillar.get('absent_groups', []) %}
  584. users_absent_group_{{ group }}:
  585. group.absent:
  586. - name: {{ group }}
  587. {% endfor %}