Ansible newbie

Hi,

I’m new to using ansible and want to run a command on a number of servers which I have listed within a text file. I’ve tried the command below where “hosts” is the file containing the server name list but no luck, any ideas how I can achieve this?

I think what you are wanting is something like:

ansible all -i hosts -m shell -a ‘/u01/app/em/core/12.1.0.5.0/root.sh’ -k --sudo --ask-sudo

The change there is to switch from @hosts to all -i hosts. all specifies to connect to all hosts in the hosts file, and -i hosts specifies the host file as hosts.

This inventory file information is documented at:

http://docs.ansible.com/ansible/intro_inventory.html