Over the years I have learned to use
sed to “edit files in place”. This post how to do it with the latest toy – Ansible.
The task at hand – make a copy of
/etc/sudoers, replace every occurrence of
--- - hosts: localhost tasks: - name: edit /etc/sudoers replacing jbond with hkloss replace: dest=/etc/sudoers regexp='jbond' replace='hkloss' backup=yes