lazy evaluation - Ansible raw module: compare local time with target nodes time -



lazy evaluation - Ansible raw module: compare local time with target nodes time -

all target machine android , not have python

so wanna know each machine's time compared local time.

ansible -m raw -a "echo $(date +%s); date +%s"

does not work, since $(date +%s) evaluated since origin of execution, , there many nodes executes much later.

is there way delay evaluation?

imho using simple ssh easier ansible purpose.

if want go on using ansible check out the --forks|-f option if have 100 androids talk then:

ansible -f 100 -m raw -a "echo $(date +%s); date +%s"

or old ssh:

for h in `ansible -i inventory.ini --list-hosts`; d=`date +%s`; ssh $h "echo \$hostname - $(date +%s) - $d" & done

time lazy-evaluation ansible delayed-execution

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -