Saltstack Official Users Formula
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

46 lines
1.1KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. {##
  4. Name: users/absentusers.sls
  5. Description:
  6. This file removes users
  7. #}
  8. {% from "users/map.jinja" import users_settings with context %}
  9. {% for name, user in users_settings.items() %}
  10. {% if user.absent is defined and user.absent %}
  11. users-absent_user-{{ name }}:
  12. {% if 'purge' in user or 'force' in user %}
  13. user.absent:
  14. - name: {{ name }}
  15. {% if 'purge' in user %}
  16. - purge: {{ user['purge'] }}
  17. {% endif %}
  18. {% if 'force' in user %}
  19. - force: {{ user['force'] }}
  20. {% endif %}
  21. {% else %}
  22. user.absent:
  23. - name: {{ name }}
  24. {% endif -%}
  25. users_{{ users_settings.sudoers_dir }}/{{ name }}:
  26. file.absent:
  27. - name: {{ users_settings.sudoers_dir }}/{{ name }}
  28. {% endif %}
  29. {% endfor %}
  30. {% for user in pillar.get('absent_users', []) %}
  31. users_absent_user_2_{{ user }}:
  32. user.absent
  33. users_2_{{ users.sudoers_dir }}/{{ user }}:
  34. file.absent:
  35. - name: {{ users.sudoers_dir }}/{{ user }}
  36. {% endfor %}
  37. {% for group in pillar.get('absent_groups', []) %}
  38. users_absent_group_{{ group }}:
  39. group.absent:
  40. - name: {{ group }}
  41. {% endfor %}