1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| ---
| - name: sample shell out
| hosts: foobar
| remote_user: olbohlen
| vars:
| keyword: "10"
| tasks:
| - name: run a sample shell command
| shell: cal
| register: shell_out
|
| - name: debug shell_out
| debug:
| var: item
| loop: "{{ shell_out['stdout_lines'] }}"
| when: "keyword in item"
|
|