Re: [ansible-project] What's the safest way to do grep-like searches in files?

2018-02-13 Thread Nico Sabbi
I like it. Thanks Il giorno martedì 13 febbraio 2018 16:50:44 UTC, Matt Martz ha scritto: > > I would honestly use slurp to fetch the file and maybe a set_fact to set a > var indicating it's existence. That is the pattern I have always used. > Something like: > > - slurp: > path:

Re: [ansible-project] What's the safest way to do grep-like searches in files?

2018-02-13 Thread Matt Martz
I would honestly use slurp to fetch the file and maybe a set_fact to set a var indicating it's existence. That is the pattern I have always used. Something like: - slurp: path: /etc/myfile register: myfile - set_fact: contains_cmdline: "{{ myfile.contents|b64decode|search("^CMDLINE")