Saltstack Official Users Formula
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

28 lines
821B

  1. {% from "users/map.jinja" import users with context %}
  2. include:
  3. - users
  4. {% for name, user in pillar.get('users', {}).items() if user.absent is not defined or not user.absent %}
  5. {%- if user == None -%}
  6. {%- set user = {} -%}
  7. {%- endif -%}
  8. {%- set home = user.get('home', "/home/%s" % name) -%}
  9. {%- set manage = user.get('manage_profile', False) -%}
  10. {%- if 'prime_group' in user and 'name' in user['prime_group'] %}
  11. {%- set user_group = user.prime_group.name -%}
  12. {%- else -%}
  13. {%- set user_group = name -%}
  14. {%- endif %}
  15. {%- if manage -%}
  16. users_{{ name }}_user_profile:
  17. file.managed:
  18. - name: {{ home }}/.profile
  19. - user: {{ name }}
  20. - group: {{ user_group }}
  21. - mode: 644
  22. - source:
  23. - salt://users/files/profile/{{ name }}/profile
  24. - salt://users/files/profile/profile
  25. {% endif %}
  26. {% endfor %}