Browse Source

modified visudo to only report change in salt when there is an error.

lookup-fix-3
7oku 10 years ago
parent
commit
94d53d5ee7
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      users/init.sls

+ 2
- 1
users/init.sls View File

{% 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 }}":
cmd.run: cmd.run:
- name: 'visudo -cf - <<<"$rule"'
- name: 'visudo -cf - <<<"$rule" | { read output; if [[ $output != "stdin: parsed OK" ]] ; then echo $output ; fi }'
- stateful: True
- shell: {{ users.visudo_shell }} - shell: {{ users.visudo_shell }}
- env: - env:
# Specify the rule via an env var to avoid shell quoting issues. # Specify the rule via an env var to avoid shell quoting issues.

Loading…
Cancel
Save