瀏覽代碼

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

lookup-fix-3
7oku 10 年之前
父節點
當前提交
94d53d5ee7
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. +2
    -1
      users/init.sls

+ 2
- 1
users/init.sls 查看文件

@@ -141,7 +141,8 @@ sudoer-{{ name }}:
{% for rule in user['sudo_rules'] %}
"validate {{ name }} sudo rule {{ loop.index0 }} {{ name }} {{ rule }}":
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 }}
- env:
# Specify the rule via an env var to avoid shell quoting issues.

Loading…
取消
儲存