Saltstack Official Users Formula
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

34 líneas
1.1KB

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