Przeglądaj źródła

Dont force vim-formula on users

master
N 6 lat temu
rodzic
commit
f7dfd1f47b
5 zmienionych plików z 25 dodań i 9 usunięć
  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 Wyświetl plik

@@ -45,7 +45,7 @@ True' in pillar per user. Defaults to False.

Ensures the vimrc file exists in the users home directory. Sets 'manage_vimrc:
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``
---------------

+ 1
- 0
pillar.example Wyświetl plik

@@ -1,4 +1,5 @@
users-formula:
use_vim_formula: True
lookup: # override the defauls in map.jinja
root_group: root


+ 6
- 0
users/defaults.yaml Wyświetl plik

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml

users-formula:
use_vim_formula: False


+ 12
- 8
users/map.jinja Wyświetl plik

@@ -1,6 +1,8 @@
# 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': {
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers',
@@ -10,7 +12,7 @@
'bash_package': 'bash',
'sudo_package': 'sudo',
'googleauth_package': 'google-authenticator-libpam',
},
},
'Debian': {
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers',
@@ -21,7 +23,7 @@
'bash_package': 'bash',
'sudo_package': 'sudo',
'googleauth_package': 'libpam-google-authenticator',
},
},
'Gentoo': {
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers',
@@ -32,7 +34,7 @@
'bash_package': 'app-shells/bash',
'sudo_package': 'app-admin/sudo',
'googleauth_package': 'libpam-google-authenticator',
},
},
'FreeBSD': {
'sudoers_dir': '/usr/local/etc/sudoers.d',
'sudoers_file': '/usr/local/etc/sudoers',
@@ -43,7 +45,7 @@
'bash_package': 'bash',
'sudo_package': 'sudo',
'googleauth_package': 'pam_google_authenticator',
},
},
'Solaris': {
'sudoers_dir': '/opt/local/etc/sudoers.d',
'sudoers_file': '/opt/local/etc/sudoers',
@@ -54,7 +56,7 @@
'bash_package': 'bash',
'sudo_package': 'sudo',
'googleauth_package': 'libpam-google-authenticator',
},
},
'default': {
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers',
@@ -65,8 +67,10 @@
'bash_package': 'bash',
'sudo_package': 'sudo',
'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' %}
{% set group = salt['cmd.run']("stat -f '%Sg' /dev/console") %}

+ 5
- 0
users/vimrc.sls Wyświetl plik

@@ -1,4 +1,7 @@
{% from "users/map.jinja" import users with context %}

{% if users.use_vim_formula %}

include:
- users
- vim
@@ -28,3 +31,5 @@ users_{{ name }}_user_vimrc:
- salt://users/files/vimrc/vimrc
{% endif %}
{% endfor %}

{% endif %}

Ładowanie…
Anuluj
Zapisz