Browse Source

Merge pull request #96 from skandyla/master

changing visudo checking to avoid wrong reporting when launched in a test mode
tags/v0.45.0
Forrest 9 years ago
parent
commit
d3d6cfba61
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      users/init.sls

+ 6
- 0
users/init.sls View File

- group: {{ users.root_group }} - group: {{ users.root_group }}
- mode: '0440' - mode: '0440'
{% if 'sudo_rules' in user or 'sudo_defaults' in user %} {% if 'sudo_rules' in user or 'sudo_defaults' in user %}
#{#%
{% if 'sudo_rules' in user %} {% if 'sudo_rules' in user %}
{% for rule in user['sudo_rules'] %} {% for rule in user['sudo_rules'] %}
"validate {{ name }} sudo rule {{ loop.index0 }} {{ name }} {{ rule }}": "validate {{ name }} sudo rule {{ loop.index0 }} {{ name }} {{ rule }}":
- file: users_{{ users.sudoers_dir }}/{{ name }} - file: users_{{ users.sudoers_dir }}/{{ name }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
#%#}


users_{{ users.sudoers_dir }}/{{ name }}: users_{{ users.sudoers_dir }}/{{ name }}:
file.managed: file.managed:
- require: - require:
- file: users_sudoer-defaults - file: users_sudoer-defaults
- file: users_sudoer-{{ name }} - file: users_sudoer-{{ name }}
cmd.wait:
- name: visudo -cf {{ users.sudoers_dir }}/{{ name }} || ( rm -rvf {{ users.sudoers_dir }}/{{ name }}; exit 1 )
- watch:
- file: {{ users.sudoers_dir }}/{{ name }}
{% endif %} {% endif %}
{% else %} {% else %}
users_{{ users.sudoers_dir }}/{{ name }}: users_{{ users.sudoers_dir }}/{{ name }}:

Loading…
Cancel
Save