|
|
|
|
|
|
|
|
- user: root |
|
|
- user: root |
|
|
- group: root |
|
|
- group: root |
|
|
- mode: '0440' |
|
|
- mode: '0440' |
|
|
|
|
|
{% if 'sudo_rules' in user %} |
|
|
/etc/sudoers.d/{{ name }}: |
|
|
/etc/sudoers.d/{{ name }}: |
|
|
file.append: |
|
|
file.append: |
|
|
- text: |
|
|
|
|
|
{% for rule in user.get('sudo_rules', []) %} |
|
|
|
|
|
- {{ rule }} |
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
- require: |
|
|
|
|
|
- file: sudoer-defaults |
|
|
|
|
|
- file: sudoer-{{ name }} |
|
|
|
|
|
|
|
|
- text: |
|
|
|
|
|
{% for rule in user['sudo_rules'] %} |
|
|
|
|
|
- "{{ name }} {{ rule }}" |
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
- require: |
|
|
|
|
|
- file: sudoer-defaults |
|
|
|
|
|
- file: sudoer-{{ name }} |
|
|
|
|
|
{% endif %} |
|
|
{% else %} |
|
|
{% else %} |
|
|
/etc/sudoers.d/{{ name }}: |
|
|
/etc/sudoers.d/{{ name }}: |
|
|
file.absent: |
|
|
file.absent: |