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