1

I have a log file on my machine called test.log. I would like to use ansible playbook to search on the content of the log file that the word below exist:

--- text 1230 mode 1

My playbook contain a task with :

  • name: Get my log file shell: "cat /home/user/test.log" register: text1

But how to make sure that my word above exist ?

  • 2
    If your goal is to look for a string in the log file before going on with other tasks, use the [`wait_for` module](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/wait_for_module.html) – Zeitounator Oct 21 '20 at 12:33

0 Answers0