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


On Mon, Dec 21, 2015 at 10:22 AM, Yvonne Butler <[email protected]> wrote:

> 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?
>
> *ansible @hosts -m shell -a '/u01/app/em/core/12.1.0.5.0/root.sh' -k
> --sudo --ask-sudo*
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/db7b9b3d-6702-4b39-8e03-39e7555f224e%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/db7b9b3d-6702-4b39-8e03-39e7555f224e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v-U_TovJtMqHbFfeESYm-ncaaoGL9vcoX22Nw9grxXLbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to