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
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
- 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
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
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
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
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
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