ansible-practice/plugin-lines.yml
2023-11-08 17:37:18 +00:00

12 lines
289 B
YAML

---
- name: checking out lines and pipes lookup plugins
hosts: localhost
gather_facts: no
tasks:
- name: print the first line of any file
debug:
msg: "{{ item[0] }}"
loop:
- "{{ query('lines', 'cat /etc/hosts') }}"
- "{{ query('lines', 'cat /etc/passwd') }}"