On 20. mai 2016 15:25, jean-christophe manciot wrote:
I need to download & install the CA certificate *only if it is not present
on the remote host*.
Does anyone know how to achieve the CA certificate presence check with
Ansible?
That will be used to populate a variable used for something along those
lines:

  - name: Downloading the CA certificate from the official site
    get_url: url={{ ca_url }} dest={{ dest_cert_folder }} use_proxy=no
    when: ca_cert == 'absent'

Drop the when: line and it will work.
Because dest= is a folder in your code the file will be downloaded every time but only replaced if it differ.
If you do not want to download the file every time make dest= a file.

--
Kai Stian Olstad

--
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/3e0317bc-b881-89bd-94f3-e96e25996c3b%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to