How to update a text file
How to update text file
- Need to add account ansible_acct_name to SYS_ADMIN group in sudo file if it is not already there.
- name: Add svc_ansible to sudo file lineinfile: path: /etc/sudoers state: present backrefs: yes regex: '(^User_Alias\s+SYS_ADMIN\s+)=(((?!).)*)$' line: '\1=\2, ' validate: /usr/sbin/visudo -cf %s
Leave a comment