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

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -