Browse Source

Remove trailing slash from sudoers_dir

lookup-fix-3
Scott Reeves 10 years ago
parent
commit
ea76d0d84f
2 changed files with 13 additions and 13 deletions
  1. +9
    -9
      users/init.sls
  2. +4
    -4
      users/map.jinja

+ 9
- 9
users/init.sls View File



sudoer-{{ name }}: sudoer-{{ name }}:
file.managed: file.managed:
- name: {{ users.sudoers_dir }}{{ name }}
- name: {{ users.sudoers_dir }}/{{ name }}
- user: root - user: root
- group: {{ users.root_group }} - group: {{ users.root_group }}
- mode: '0440' - mode: '0440'
# Specify the rule via an env var to avoid shell quoting issues. # Specify the rule via an env var to avoid shell quoting issues.
- rule: "{{ name }} {{ rule }}" - rule: "{{ name }} {{ rule }}"
- require_in: - require_in:
- file: {{ users.sudoers_dir }}{{ name }}
- file: {{ users.sudoers_dir }}/{{ name }}
{% endfor %} {% endfor %}


{{ users.sudoers_dir }}{{ name }}:
{{ users.sudoers_dir }}/{{ name }}:
file.managed: file.managed:
- contents: | - contents: |
{%- for rule in user['sudo_rules'] %} {%- for rule in user['sudo_rules'] %}
- file: sudoer-{{ name }} - file: sudoer-{{ name }}
{% endif %} {% endif %}
{% else %} {% else %}
{{ users.sudoers_dir }}{{ name }}:
{{ users.sudoers_dir }}/{{ name }}:
file.absent: file.absent:
- name: {{ users.sudoers_dir }}{{ name }}
- name: {{ users.sudoers_dir }}/{{ name }}
{% endif %} {% endif %}


{% endfor %} {% endfor %}
{% else %} {% else %}
user.absent user.absent
{% endif -%} {% endif -%}
{{ users.sudoers_dir }}{{ name }}:
{{ users.sudoers_dir }}/{{ name }}:
file.absent: file.absent:
- name: {{ users.sudoers_dir }}{{ name }}
- name: {{ users.sudoers_dir }}/{{ name }}
{% endfor %} {% endfor %}


{% for user in pillar.get('absent_users', []) %} {% for user in pillar.get('absent_users', []) %}
{{ user }}: {{ user }}:
user.absent user.absent
{{ users.sudoers_dir }}{{ user }}:
{{ users.sudoers_dir }}/{{ user }}:
file.absent: file.absent:
- name: {{ users.sudoers_dir }}{{ user }}
- name: {{ users.sudoers_dir }}/{{ user }}
{% endfor %} {% endfor %}


{% for group in pillar.get('absent_groups', []) %} {% for group in pillar.get('absent_groups', []) %}

+ 4
- 4
users/map.jinja View File

# 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']({
'Debian': { 'Debian': {
'sudoers_dir': '/etc/sudoers.d/',
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers', 'sudoers_file': '/etc/sudoers',
'root_group': 'root', 'root_group': 'root',
'shell': '/bin/bash', 'shell': '/bin/bash',
'sudo_package': 'sudo', 'sudo_package': 'sudo',
}, },
'Gentoo': { 'Gentoo': {
'sudoers_dir': '/etc/sudoers.d/',
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers', 'sudoers_file': '/etc/sudoers',
'root_group': 'root', 'root_group': 'root',
'shell': '/bin/bash', 'shell': '/bin/bash',
'sudo_package': 'app-admin/sudo', 'sudo_package': 'app-admin/sudo',
}, },
'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',
'root_group': 'wheel', 'root_group': 'wheel',
'shell': '/bin/csh', 'shell': '/bin/csh',
'sudo_package': 'sudo', 'sudo_package': 'sudo',
}, },
'default': { 'default': {
'sudoers_dir': '/etc/sudoers.d/',
'sudoers_dir': '/etc/sudoers.d',
'sudoers_file': '/etc/sudoers', 'sudoers_file': '/etc/sudoers',
'root_group': 'root', 'root_group': 'root',
'shell': '/bin/bash', 'shell': '/bin/bash',

Loading…
Cancel
Save