I am configuring a server using Ansible playbook. My playbook works properly at the very first execution but when I run the same playbook again it creates the duplicates lines in the configuration file on the server.
I am using lineinfile
module. Example following task adds the line each time I run the playbook.
- lineinfile: dest=/etc/pam_ldap.conf line="ssl off"
Is there a way to avoid this, and maintain idempotency.