Arnaud Dubois
Arnaud Dubois

Reputation: 124

Get lines from file using Ansible module for Windows and UNIX Systems

I want to check and extract all the lines that contain the ERROR word in an Ansible playbook so that I can process them after with a non case sensitive pattern.

And I need to do that on Windows and Linux systems.

The lineinfile module I tried doesn't allow me to extract the full line and doesn't do the job when multiple lines with the error word need to be extracted from a single file.

I made some research and the most appropriate solution I found is to use grep via the command module but I'll prefer using a dedicated module, moreover I'm still stuck for Windows logs processing.

Upvotes: 0

Views: 35

Answers (0)

Related Questions