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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -