Hi,
i am trying to add multiple sudoers line with template.
so, i am passing sudoers=abc,def within jenkins and use -e (extended vars) while running playbook
in template:
{% for item in sudoers %}
{{ item }} ALL=(ALL) NOPASSWD:ALL
{% endfor %}
yml files looks like :
- name: sudoers file
template:
src: /templates/app.j2
dest: /etc/sudoers.d/app
owner: root
group: root
mode: 0440
with_items: ‘{{ sudoers }}’
Out put is :
a ALL=(ALL) NOPASSWD:ALL
b ALL=(ALL) NOPASSWD:ALL
c ALL=(ALL) NOPASSWD:ALL
, ALL=(ALL) NOPASSWD:ALL
d ALL=(ALL) NOPASSWD:ALL
e ALL=(ALL) NOPASSWD:ALL
f ALL=(ALL) NOPASSWD:ALL
i was expecting :
abc (ALL) NOPASSWD:ALL
def (ALL) NOPASSWD:ALL
any ideas ?