Overwrite a sudoer file rather than append to fix #21lookup-fix-3
{% endfor %} | {% endfor %} | ||||
/etc/sudoers.d/{{ name }}: | /etc/sudoers.d/{{ name }}: | ||||
file.append: | |||||
- text: | |||||
{% for rule in user['sudo_rules'] %} | |||||
- "{{ name }} {{ rule }}" | |||||
{% endfor %} | |||||
file.managed: | |||||
- contents: | | |||||
{%- for rule in user['sudo_rules'] %} | |||||
{{ name }} {{ rule }} | |||||
{%- endfor %} | |||||
- require: | - require: | ||||
- file: sudoer-defaults | - file: sudoer-defaults | ||||
- file: sudoer-{{ name }} | - file: sudoer-{{ name }} |