|
|
|
|
|
|
|
|
- group: {{ name }} |
|
|
- group: {{ name }} |
|
|
group.present: |
|
|
group.present: |
|
|
- name: {{ name }} |
|
|
- name: {{ name }} |
|
|
|
|
|
- gid: {{ user['uid'] }} |
|
|
user.present: |
|
|
user.present: |
|
|
- name: {{ name }} |
|
|
- name: {{ name }} |
|
|
- home: {{ home }} |
|
|
- home: {{ home }} |
|
|
|
|
|
|
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
|
|
|
|
|
|
{% if 'sudouser' in user %} |
|
|
|
|
|
sudoer-{{ name }}: |
|
|
|
|
|
file.append: |
|
|
|
|
|
- name: /etc/sudoers |
|
|
|
|
|
- text: |
|
|
|
|
|
- "{{ name }} ALL=(ALL) NOPASSWD: ALL" |
|
|
|
|
|
- require: |
|
|
|
|
|
- file: sudoer-defaults |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% if 'sudouser' in user and user['sudouser'] %} |
|
|
|
|
|
sudoer-{{ name }}: |
|
|
|
|
|
file.managed: |
|
|
|
|
|
- name: /etc/sudoers.d/{{ name }} |
|
|
|
|
|
- user: root |
|
|
|
|
|
- group: root |
|
|
|
|
|
- mode: '0440' |
|
|
|
|
|
/etc/sudoers.d/{{ name }}: |
|
|
|
|
|
file.append: |
|
|
|
|
|
- text: |
|
|
|
|
|
- "{{ name }} ALL=(ALL) NOPASSWD: ALL" |
|
|
|
|
|
- require: |
|
|
|
|
|
- file: sudoer-defaults |
|
|
|
|
|
- file: sudoer-{{ name }} |
|
|
|
|
|
{% else %} |
|
|
|
|
|
/etc/sudoers.d/{{ name }}: |
|
|
|
|
|
file.absent: |
|
|
|
|
|
- name: /etc/sudoers.d/{{ name }} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
|
|
|
|
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
{% for user in pillar.get('absent_users', []) %} |
|
|
{% for user in pillar.get('absent_users', []) %} |
|
|
{{ user }}: |
|
|
{{ user }}: |
|
|
user.absent |
|
|
user.absent |
|
|
|
|
|
/etc/sudoers.d/{{ user }}: |
|
|
|
|
|
file.absent: |
|
|
|
|
|
- name: /etc/sudoers.d/{{ user }} |
|
|
{% endfor %} |
|
|
{% endfor %} |