Просмотр исходного кода

Merge pull request #177 from noelmcloughlin/vimrc

Dont require vim-formula by default
master
N 6 лет назад
Родитель
Сommit
7ab8f2ed06
Аккаунт пользователя с таким Email не найден
5 измененных файлов: 25 добавлений и 9 удалений
  1. +1
    -1
      README.rst
  2. +1
    -0
      pillar.example
  3. +6
    -0
      users/defaults.yaml
  4. +12
    -8
      users/map.jinja
  5. +5
    -0
      users/vimrc.sls

+ 1
- 1
README.rst Просмотреть файл



Ensures the vimrc file exists in the users home directory. Sets 'manage_vimrc: Ensures the vimrc file exists in the users home directory. Sets 'manage_vimrc:
True' in pillar per user. Defaults to False. True' in pillar per user. Defaults to False.
This depends on the vim-formula to be installed.
This depends on the vim-formula being available and pillar `users:use_vim_formula: True`.


``users.user_files`` ``users.user_files``
--------------- ---------------

+ 1
- 0
pillar.example Просмотреть файл

users-formula: users-formula:
use_vim_formula: True
lookup: # override the defauls in map.jinja lookup: # override the defauls in map.jinja
root_group: root root_group: root



+ 6
- 0
users/defaults.yaml Просмотреть файл

# -*- coding: utf-8 -*-
# vim: ft=yaml

users-formula:
use_vim_formula: False


+ 12
- 8
users/map.jinja Просмотреть файл

# vim: sts=2 ts=2 sw=2 et ai # vim: sts=2 ts=2 sw=2 et ai


{% set users = salt['grains.filter_by']({
{% set users = salt['grains.filter_by'](
defaults,
merge=salt['grains.filter_by']({
'MacOS': { 'MacOS': {
'sudoers_dir': '/etc/sudoers.d', 'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers', 'sudoers_file': '/etc/sudoers',
'bash_package': 'bash', 'bash_package': 'bash',
'sudo_package': 'sudo', 'sudo_package': 'sudo',
'googleauth_package': 'google-authenticator-libpam', 'googleauth_package': 'google-authenticator-libpam',
},
},
'Debian': { 'Debian': {
'sudoers_dir': '/etc/sudoers.d', 'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers', 'sudoers_file': '/etc/sudoers',
'bash_package': 'bash', 'bash_package': 'bash',
'sudo_package': 'sudo', 'sudo_package': 'sudo',
'googleauth_package': 'libpam-google-authenticator', 'googleauth_package': 'libpam-google-authenticator',
},
},
'Gentoo': { 'Gentoo': {
'sudoers_dir': '/etc/sudoers.d', 'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers', 'sudoers_file': '/etc/sudoers',
'bash_package': 'app-shells/bash', 'bash_package': 'app-shells/bash',
'sudo_package': 'app-admin/sudo', 'sudo_package': 'app-admin/sudo',
'googleauth_package': 'libpam-google-authenticator', 'googleauth_package': 'libpam-google-authenticator',
},
},
'FreeBSD': { 'FreeBSD': {
'sudoers_dir': '/usr/local/etc/sudoers.d', 'sudoers_dir': '/usr/local/etc/sudoers.d',
'sudoers_file': '/usr/local/etc/sudoers', 'sudoers_file': '/usr/local/etc/sudoers',
'bash_package': 'bash', 'bash_package': 'bash',
'sudo_package': 'sudo', 'sudo_package': 'sudo',
'googleauth_package': 'pam_google_authenticator', 'googleauth_package': 'pam_google_authenticator',
},
},
'Solaris': { 'Solaris': {
'sudoers_dir': '/opt/local/etc/sudoers.d', 'sudoers_dir': '/opt/local/etc/sudoers.d',
'sudoers_file': '/opt/local/etc/sudoers', 'sudoers_file': '/opt/local/etc/sudoers',
'bash_package': 'bash', 'bash_package': 'bash',
'sudo_package': 'sudo', 'sudo_package': 'sudo',
'googleauth_package': 'libpam-google-authenticator', 'googleauth_package': 'libpam-google-authenticator',
},
},
'default': { 'default': {
'sudoers_dir': '/etc/sudoers.d', 'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers', 'sudoers_file': '/etc/sudoers',
'bash_package': 'bash', 'bash_package': 'bash',
'sudo_package': 'sudo', 'sudo_package': 'sudo',
'googleauth_package': 'libpam-google-authenticator', 'googleauth_package': 'libpam-google-authenticator',
},
}, merge=salt['pillar.get']('users-formula:lookup')) %}
},
}, merge=salt['pillar.get']('users-formula:lookup')),
base='users',
) %}


{% if grains.os == 'MacOS' %} {% if grains.os == 'MacOS' %}
{% set group = salt['cmd.run']("stat -f '%Sg' /dev/console") %} {% set group = salt['cmd.run']("stat -f '%Sg' /dev/console") %}

+ 5
- 0
users/vimrc.sls Просмотреть файл

{% from "users/map.jinja" import users with context %} {% from "users/map.jinja" import users with context %}

{% if users.use_vim_formula %}

include: include:
- users - users
- vim - vim
- salt://users/files/vimrc/vimrc - salt://users/files/vimrc/vimrc
{% endif %} {% endif %}
{% endfor %} {% endfor %}

{% endif %}

Загрузка…
Отмена
Сохранить