Saltstack Official Users Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

33 rindas
980B

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. {##
  4. Name: users/bashrc.sls
  5. Description:
  6. This file sets up bashrcs
  7. #}
  8. {% from "users/map.jinja" import users_settings with context %}
  9. {% for name, user in users_settings.items() %}
  10. {% if user.absent is not defined or not user.absent or user != None %}
  11. {% set home = user.get('home', "/home/%s" % name) %}
  12. {% set manage = user.get('manage_bashrc', False) %}
  13. {% if 'prime_group' in user and 'name' in user.get('prime_group', []) %}
  14. {% set user_group = user.prime_group.name %}
  15. {% else %}
  16. {% set user_group = name %}
  17. {% endif %}
  18. {% if manage %}
  19. users-{{ name }}-user-bashrc:
  20. file.managed:
  21. - name: {{ home }}/.bashrc
  22. - user: {{ name }}
  23. - group: {{ user_group }}
  24. - mode: 644
  25. - source:
  26. - salt://users/files/bashrc/{{ name }}/bashrc
  27. - salt://users/files/bashrc/bashrc
  28. {% endif %}
  29. {% endif %}
  30. {% endfor %}