Re: [ansible-project] why lineinfile not able to run with item.path

2023-05-01 Thread Abhijeet Kasurde
It is always upto us. On Mon, May 1, 2023 at 12:02 PM sumanth parakala wrote: > Except rol sites(that many don't have access) I don't think other sites > that google hit take the indentation into account for the examples..it's up > to us.. > > On Tue, 2 May 2023 at 12:27 AM, Abhijeet Kasurde >

Re: [ansible-project] why lineinfile not able to run with item.path

2023-05-01 Thread sumanth parakala
Except rol sites(that many don't have access) I don't think other sites that google hit take the indentation into account for the examples..it's up to us.. On Tue, 2 May 2023 at 12:27 AM, Abhijeet Kasurde wrote: > Please feel free to improve the error reporting if you feel it is > necessary. :)

Re: [ansible-project] why lineinfile not able to run with item.path

2023-05-01 Thread Abhijeet Kasurde
Please feel free to improve the error reporting if you feel it is necessary. :) On Mon, May 1, 2023 at 11:49 AM Sameer Modak wrote: > Hello MR. Walter, > > Thanks a lot. My code and understanding was fine but as you pointed out i > somehow couldn’t see space in front. And as we know ansible is

Re: [ansible-project] why lineinfile not able to run with item.path

2023-05-01 Thread sumanth parakala
Documentation in various sites have a problem with with_items , they all start the item list from the w of the with_items , the indentation is almost incorrect in all majority of the knowledge sites for the list of items with variables. On Tue, 2 May 2023 at 12:19 AM, Sameer Modak wrote: > Hel

Re: [ansible-project] why lineinfile not able to run with item.path

2023-05-01 Thread Sameer Modak
Hello MR. Walter, Thanks a lot. My code and understanding was fine but as you pointed out i somehow couldn’t see space in front. And as we know ansible is not good for error prompt i mislead it. Thanks again. it worked by add 2 spaces in with_items. By the way any good tool or editor you ca

Re: [ansible-project] why lineinfile not able to run with item.path

2023-05-01 Thread Sameer Modak
Exaclty. The error is misleading as you can see my code its straightforward {{ before item.pah. Anyways i m trying what MR. Walter has suggested. Lets c. Thanks by the way for your response. On Monday, May 1, 2023 at 9:05:56 PM UTC+5:30 Abhijeet Kasurde wrote: > It seems that you have a typo s

Re: [ansible-project] why lineinfile not able to run with item.path

2023-05-01 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
You need proper indentation. The module name and "with_items" must align with the task name. The module args would then outdent by two space to also reflect proper indentation. I used a "debug" vs "lineinfile" to display the item.path and item.line vars and it worked just fine once indentation w

Re: [ansible-project] why lineinfile not able to run with item.path

2023-05-01 Thread Abhijeet Kasurde
It seems that you have a typo since the error message reads '*Destination { item.path }} does not exist !*' which is missing a starting curling bracket. Your playbook works fine though. On Mon, May 1, 2023 at 8:25 AM Sameer Modak wrote: > Code==> > > - name: insert logggin file in log4j protper

[ansible-project] why lineinfile not able to run with item.path

2023-05-01 Thread Sameer Modak
Code==> - name: insert logggin file in log4j protperties lineinfile: path: '{{ item.path }}' insertafter: 'log4j.appender.kafkaAppender.layout.ConversionPattern=*' line: '{{ item.line }}' with_items: - { path: '/etc/kafka/confluent-6.2.10/kafka/log4j.properties'