chore(user): inline sudoers template

This commit is contained in:
Jan Christian Grünhage 2024-08-19 17:06:27 +02:00
parent ab0e56e09a
commit 63480b4b87
No known key found for this signature in database
GPG key ID: EEC1170CE56FA2ED
2 changed files with 7 additions and 7 deletions

View file

@ -23,8 +23,13 @@
tags: ['deploy', 'deploy-users']
- name: "Template sudoers.d managed file"
ansible.builtin.template:
src: "sudoers.j2"
ansible.builtin.copy:
content: |
{% for name, attrs in users.items() %}
{% if attrs.root | default(false) and attrs.active | default(false) %}
{{ name }} ALL=(ALL) NOPASSWD:ALL
{% endif %}
{% endfor %}
dest: "/etc/sudoers.d/{{ users_sudo_namespace }}"
owner: "root"
mode: "0440"

View file

@ -1,5 +0,0 @@
{% for name, attrs in users.items() %}
{% if attrs.root | default(false) and attrs.active | default(false) %}
{{ name }} ALL=(ALL) NOPASSWD:ALL
{% endif %}
{% endfor %}