Le 27/09/2013 17:33, Michael DeHaan a �crit :
> Something like this:
>
> - get_url: url=
http://example.com/tarball.tar.gz dest=/the/tarball.tar.gz
> register: get_url_result
>
> - shell: tar -xvf /the/tarball.tar.gz
> when: register.changed
>
> - shell: make install chdir=/whatever/directory
> when: register.changed
>
> This will only download the tarball when it is not already present
> (saving upstream bandwidth -- always locally cache or have a copy of
> content and don't have a hundred nodes hit the same upstream server!
> That's not fair to the upstream and it's also slow), but will only
> extract it when it has needed to be downloaded.
>
> This will make your playbooks both faster and more repeatable.
I think you meant
when: get_url_result.changed
Otherwise it fails :
TASK: [Extract Java archive]
**************************************************
fatal: [localhost] => error while evaluating conditional: {% if
register.changed %} True {% else %} False {% endif %}
FATAL: all hosts have already failed -- aborting
Thank you ! My playbook runs now faster !
-- Jean-Philippe Caruana