Ansible lineinfile duplicates lines -
- vars: npm: npm_global: "{{ ansible_env.home }}/.npm-global" - name: update bashrc npm lineinfile: > dest={{ project.shell_rc_file }} regexp='export path={{ npm.npm_global }}/bin:$path' line='export path={{ npm.npm_global }}/bin:$path' state=present backup=yes create=yes
i tried many times duplicates line in export path=...
you need escape \$
in regexp
parameter since $
in regex means end of line. regex never matched since there can't string path
after end of line.
Comments
Post a Comment