|
|
|
|
|
|
|
|
|
|
|
|
|
|
sudoer-{{ name }}: |
|
|
sudoer-{{ name }}: |
|
|
file.managed: |
|
|
file.managed: |
|
|
- name: {{ users.sudoers_dir }}{{ name }} |
|
|
|
|
|
|
|
|
- name: {{ users.sudoers_dir }}/{{ name }} |
|
|
- user: root |
|
|
- user: root |
|
|
- group: {{ users.root_group }} |
|
|
- group: {{ users.root_group }} |
|
|
- mode: '0440' |
|
|
- mode: '0440' |
|
|
|
|
|
|
|
|
# Specify the rule via an env var to avoid shell quoting issues. |
|
|
# Specify the rule via an env var to avoid shell quoting issues. |
|
|
- rule: "{{ name }} {{ rule }}" |
|
|
- rule: "{{ name }} {{ rule }}" |
|
|
- require_in: |
|
|
- require_in: |
|
|
- file: {{ users.sudoers_dir }}{{ name }} |
|
|
|
|
|
|
|
|
- file: {{ users.sudoers_dir }}/{{ name }} |
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
{{ users.sudoers_dir }}{{ name }}: |
|
|
|
|
|
|
|
|
{{ users.sudoers_dir }}/{{ name }}: |
|
|
file.managed: |
|
|
file.managed: |
|
|
- contents: | |
|
|
- contents: | |
|
|
{%- for rule in user['sudo_rules'] %} |
|
|
{%- for rule in user['sudo_rules'] %} |
|
|
|
|
|
|
|
|
- file: sudoer-{{ name }} |
|
|
- file: sudoer-{{ name }} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
{% else %} |
|
|
{% else %} |
|
|
{{ users.sudoers_dir }}{{ name }}: |
|
|
|
|
|
|
|
|
{{ users.sudoers_dir }}/{{ name }}: |
|
|
file.absent: |
|
|
file.absent: |
|
|
- name: {{ users.sudoers_dir }}{{ name }} |
|
|
|
|
|
|
|
|
- name: {{ users.sudoers_dir }}/{{ name }} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
|
|
|
|
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
{% else %} |
|
|
{% else %} |
|
|
user.absent |
|
|
user.absent |
|
|
{% endif -%} |
|
|
{% endif -%} |
|
|
{{ users.sudoers_dir }}{{ name }}: |
|
|
|
|
|
|
|
|
{{ users.sudoers_dir }}/{{ name }}: |
|
|
file.absent: |
|
|
file.absent: |
|
|
- name: {{ users.sudoers_dir }}{{ name }} |
|
|
|
|
|
|
|
|
- name: {{ users.sudoers_dir }}/{{ name }} |
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
{% for user in pillar.get('absent_users', []) %} |
|
|
{% for user in pillar.get('absent_users', []) %} |
|
|
{{ user }}: |
|
|
{{ user }}: |
|
|
user.absent |
|
|
user.absent |
|
|
{{ users.sudoers_dir }}{{ user }}: |
|
|
|
|
|
|
|
|
{{ users.sudoers_dir }}/{{ user }}: |
|
|
file.absent: |
|
|
file.absent: |
|
|
- name: {{ users.sudoers_dir }}{{ user }} |
|
|
|
|
|
|
|
|
- name: {{ users.sudoers_dir }}/{{ user }} |
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
{% for group in pillar.get('absent_groups', []) %} |
|
|
{% for group in pillar.get('absent_groups', []) %} |