Friday, January 23, 2026

Ansible - Command vs Shell

 If you need a shell environment, use the shell module. 


Command:

ansible <host in inventory> -m ansible.builtin.shell -a '<shell command>'


Example

-ansible webservers -m ansible.builtin.shell -a 'mkdir MyTestFolder'

No comments:

Post a Comment