0
0
mirror of https://github.com/saltstack-formulas/users-formula.git synced 2024-11-27 22:38:34 +01:00

Merge pull request #56 from Cottser/sudoers-dir-trailing-slash

Remove trailing slash from sudoers_dir
This commit is contained in:
Forrest 2014-10-24 21:03:07 -07:00
commit 8e9dae0e55
2 changed files with 13 additions and 13 deletions

View File

@ -148,7 +148,7 @@ include:
sudoer-{{ name }}:
file.managed:
- name: {{ users.sudoers_dir }}{{ name }}
- name: {{ users.sudoers_dir }}/{{ name }}
- user: root
- group: {{ users.root_group }}
- mode: '0440'
@ -163,10 +163,10 @@ sudoer-{{ name }}:
# Specify the rule via an env var to avoid shell quoting issues.
- rule: "{{ name }} {{ rule }}"
- require_in:
- file: {{ users.sudoers_dir }}{{ name }}
- file: {{ users.sudoers_dir }}/{{ name }}
{% endfor %}
{{ users.sudoers_dir }}{{ name }}:
{{ users.sudoers_dir }}/{{ name }}:
file.managed:
- contents: |
{%- for rule in user['sudo_rules'] %}
@ -177,9 +177,9 @@ sudoer-{{ name }}:
- file: sudoer-{{ name }}
{% endif %}
{% else %}
{{ users.sudoers_dir }}{{ name }}:
{{ users.sudoers_dir }}/{{ name }}:
file.absent:
- name: {{ users.sudoers_dir }}{{ name }}
- name: {{ users.sudoers_dir }}/{{ name }}
{% endif %}
{% endfor %}
@ -197,17 +197,17 @@ sudoer-{{ name }}:
{% else %}
user.absent
{% endif -%}
{{ users.sudoers_dir }}{{ name }}:
{{ users.sudoers_dir }}/{{ name }}:
file.absent:
- name: {{ users.sudoers_dir }}{{ name }}
- name: {{ users.sudoers_dir }}/{{ name }}
{% endfor %}
{% for user in pillar.get('absent_users', []) %}
{{ user }}:
user.absent
{{ users.sudoers_dir }}{{ user }}:
{{ users.sudoers_dir }}/{{ user }}:
file.absent:
- name: {{ users.sudoers_dir }}{{ user }}
- name: {{ users.sudoers_dir }}/{{ user }}
{% endfor %}
{% for group in pillar.get('absent_groups', []) %}

View File

@ -1,7 +1,7 @@
# vim: sts=2 ts=2 sw=2 et ai
{% set users = salt['grains.filter_by']({
'Debian': {
'sudoers_dir': '/etc/sudoers.d/',
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers',
'root_group': 'root',
'shell': '/bin/bash',
@ -10,7 +10,7 @@
'sudo_package': 'sudo',
},
'Gentoo': {
'sudoers_dir': '/etc/sudoers.d/',
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers',
'root_group': 'root',
'shell': '/bin/bash',
@ -19,7 +19,7 @@
'sudo_package': 'app-admin/sudo',
},
'FreeBSD': {
'sudoers_dir': '/usr/local/etc/sudoers.d/',
'sudoers_dir': '/usr/local/etc/sudoers.d',
'sudoers_file': '/usr/local/etc/sudoers',
'root_group': 'wheel',
'shell': '/bin/csh',
@ -28,7 +28,7 @@
'sudo_package': 'sudo',
},
'default': {
'sudoers_dir': '/etc/sudoers.d/',
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers',
'root_group': 'root',
'shell': '/bin/bash',