This means that the regex you provide doesn't match: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html#parameter-insertafter
On Tue, 15 Feb 2022 at 21:51, Praveen Dev <[email protected]> wrote: > HI All, > > i have a requirement to add a few lines after a particular match / > keyword or string in a shell script . below code is for reference when i > execute this code it is adding all the bold lines at the bottom . can you > please help thank you > > - name: EDIT DIP Job Runner > lineinfile: > path: "{{ sas_config }}/{{ sas_config_level > }}/Web/Applications/SASWIPSchedulingServices9.4/dip/DIPJobRunner.sh" > state: present > insertafter: 'kill $pid' > line: "{{ item }}" > with_items: > > > > * - sleep 3 - if [ -f $PIDFILE ]; then - kill -9 $pid - fi* > become: true > become_user: '{{ install_user.name }}' > when: '"midtier" in group_names' > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/f6fc4c37-1c24-4274-8509-d0873ac58dcan%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/f6fc4c37-1c24-4274-8509-d0873ac58dcan%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Sent from a mobile device - please excuse the brevity, spelling and punctuation. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwM0XM5sCON8pbLJsEywh2L0%3DDO%3DdH7hYM9kXLqzCtidFQ%40mail.gmail.com.
