/etc/passwd 조회 후 특정 계정 출력
---
- hosts: linux
tasks:
- name: get value
shell:
cmd: cat /etc/passwd | grep magnus
register: grep_output
ignore_errors: yes
changed_when: false
- name: Print
debug:
msg: "{{ inventory_hostname }}: '{{ grep_output.stdout }}'"
반응형
댓글