Append 2 lines in /etc/sudoers

Hi I have 2 lines starting with User_Alias

How do i make sure both lines get appended

at the moment only the last line is being appended using this playbook



tasks:

- name: add someuser to end of line

lineinfile:

dest: /etc/sudoers

state: present

regexp: '^(User_Alias(.*)$)'

backrefs: yes

backup: yes

line: '\1, someuser'


Output:


User_Alias SAP_ADMIN =user1, user2, user3, (see its blank here)

User_Alias ORA_ADMIN = user1, user2 ,user3, someuser

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9fa81932-2293-442d-996e-575f476aca08n%40googlegroups.com.

Reply via email to