Re: [ansible-project] Modifying a file

2021-01-28 Thread Aris Aguirre
I know, lineinfile. I was thinking of file or copy module. Like just absent/present and content as argument. My question is, how about replace? you think the module replace can help? Thanks On Thursday, January 28, 2021 at 1:43:57 AM UTC-6 brae...@gmail.com wrote: > On 1/28/21 6:12 AM, Aris Agu

Re: [ansible-project] Modifying a file

2021-01-27 Thread Stefan Hornburg (Racke)
On 1/28/21 6:12 AM, Aris Aguirre wrote: > >   - name: Delete Everything in the file >     lineinfile: >   path: /tmp/filetomodify >   regexp: "*" >   line: This is for File1 >       state: absent >     > > Existing File: > This is an existing file / $ % with invalid characters &*() Bl

Re: [ansible-project] Modifying a file

2021-01-27 Thread Aris Aguirre
- name: Delete Everything in the file lineinfile: path: /tmp/filetomodify regexp: "*" line: This is for File1 state: absent Existing File: This is an existing file / $ % with invalid characters &*() Blahh, a lot of characters here.. Everything in this file shou

Re: [ansible-project] Modifying a file

2021-01-26 Thread nagaraju balusa
please *don't* CC me. On Mon, Jan 25, 2021 at 11:46 AM Antony Stone < antony.st...@ansible.open.source.it> wrote: > On Monday 25 January 2021 at 20:37:31, Aris Aguirre wrote: > > > you cant...cos a lot of characters there.. i cant find a way how to > delete > > them in regex. > > Can you explain

Re: [ansible-project] Modifying a file

2021-01-25 Thread Antony Stone
On Monday 25 January 2021 at 20:37:31, Aris Aguirre wrote: > you cant...cos a lot of characters there.. i cant find a way how to delete > them in regex. Can you explain to us exactly what you want the command to identify? Are there, for example, certain characters which should never appear in a

Re: [ansible-project] Modifying a file

2021-01-25 Thread Aris Aguirre
you cant...cos a lot of characters there.. i cant find a way how to delete them in regex. On Monday, January 25, 2021 at 1:05:37 PM UTC-6 raub...@gmail.com wrote: > On Mon, Jan 25, 2021 at 1:58 PM Aris Aguirre wrote: > > > > I can easily use a file module to delete the existing file and create

Re: [ansible-project] Modifying a file

2021-01-25 Thread Mauricio Tavares
On Mon, Jan 25, 2021 at 1:58 PM Aris Aguirre wrote: > > I can easily use a file module to delete the existing file and create a new > one with File1 content. > But I want to modifile the file using lineinfile or replace. Please help. > Thanks > > Existing File: > This is an existing file / $ % wi

[ansible-project] Modifying a file

2021-01-25 Thread Aris Aguirre
I can easily use a file module to delete the existing file and create a new one with File1 content. But I want to modifile the file using lineinfile or replace. Please help. Thanks Existing File: This is an existing file / $ % with invalid characters &*() Blahh Expected Output: File1 -- You re