ans-command

In the process of working on some other scripts I hacked this up as a test of a pretty simple ansible script. It is more or less a duplicate of func-command.

http://fedorapeople.org/gitweb?p=skvidal/public_git/scripts.git;a=tree;f=ansible/ans-command

ans-command uptime

runs uptime on all the boxes in the default inventory.

ans-command --host="host1" --host="@groupspec" "uname -a"

runs uname -a on host1 and all the hosts matching the groupspec.

We use func-command daily in fedora infrastructure and this lets us migrate to using ansible w/o having to relearn syntax.

I've also updated host-reboot to work with the new inventory api

http://fedorapeople.org/gitweb?p=skvidal/public_git/scripts.git;a=tree;f=ansible/host-reboot

-sv

runs uptime on all the boxes in the default inventory.

ans-command --host=“host1” --host=“@groupspec” “uname -a”

yay new inventory API. Much nicer.

quick question so I can understand – Is this command script any different in behavior from:

/usr/bin/ansible host1:groupspec -a “uname -a”

–Michael

in terms of ansible's functionality no.

In terms of my use yes - it is substantially easier for me to remember which args I need to place.

also for the operations I frequently need to zip out it is much shorter to type since I will often need to do something to ALL hosts.

I'll probably add the other options I added to func-command a while back like confirmation and --oneline output (really handy for grepping something for results)

-sv