- name: Run shell command on multiple servers (Ansible)
hosts: webservers
tasks:
- name: Execute 'ls' command and capture output
ansible.builtin.shell: |
cd /tmp
pwd
ls -l
Back to list